Skip to content

toverux/HallOfFameServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

314 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hall of Fame logoHall of Fame Server

Discord Paradox Mods Crowdin

Server part of the Hall of Fame mod for Cities: Skylines II.

This is a Nest.js project with an Angular w/SSR frontend (skeleton, not developed yet) and Prisma as a MongoDB ORM.

Featuring a simple RESTish HTTP API for uploading photos from the mod and retrieving them.

Features & Roadmap

Find our user feedback, feature request and roadmap board here: feedback.halloffame.cs2.mtq.io.

Development

Installation

  1. Install mise-en-place for:
    • Per-project Bun & Node.js version management,
    • Task runner (also used in git hooks),
    • .env/.env.local/.env.remote file loading.
    • It is not required, but you will have to work around some issues if you don't have it.
  2. Run mise i to install the required version of Bun and Node.js,
  3. Run bun i to install dependencies.
  4. You may bun run build to test that the project builds and everything is in order.
  5. Start MongoDB in Docker with mise dev:db:start (to stop: mise dev:db:stop).
  6. Run bun prisma db push to create the database, collections and indexes.
  7. Done! Test that the server is working with mise dev:server.

Development Workflow

TBD

Generating Database Schema

Database schema is generated from the Prisma schema file in prisma/schema.prisma.

You might have to reconfigure the default development connection string if it differs from the default in .env. If it does differ, as .env is a defaults files that is versioned, do not change it, instead override locally in .env.local.

  • Update database schema from Prisma schema: bun prisma db push.
    As the database is MongoDB, which is schema-less, this essentially just creates the collections (and the database if it does not exist), and indexes.
  • Update Prisma Client definitions after schema change: bun prisma generate.
    Note that this is also done by bun prisma db push.

Dump & Restore Database

  1. Create the .env.remote file.
  2. Add HOF_DATABASE_URL=XXX which is the connection string to the remote database.
  3. Run mise --env remote import-database

Updating Dependencies & Toolchain

mise dev:deps-upgrade will update mise, will propose to update Bun, and then show an interactive update for npm dependencies.

Code Style

TypeScript

TypeScript code is formatted and linted by Biome.

Run mise check to typecheck the database, linting errors, format files and autofix simple issues. You can also use Biome directly with bun biome.

The formatter and linter should run as a pre-commit hook if you have it installed, which should be done automatically when running bun i (otherwise, run bun lefthook install).

I'd suggest using a Biome plugin for your editor to ease development.

If a rule seems out of place for this project, you can either disable/reconfigure it in the biome.json file or disable it with an annotation comment, but these should be justified and concerted.

Commit messages

Commits must follow the Conventional Commits specification and more specifically, the Angular one.

For the scope of the conventional commit, take inspiration from previously used scopes.

About

Server for the toverux/HallOfFame Cities: Skylines II mod

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages