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.
Find our user feedback, feature request and roadmap board here: feedback.halloffame.cs2.mtq.io.
- 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.
- Run
mise ito install the required version of Bun and Node.js, - Run
bun ito install dependencies. - You may
bun run buildto test that the project builds and everything is in order. - Start MongoDB in Docker with
mise dev:db:start(to stop:mise dev:db:stop). - Run
bun prisma db pushto create the database, collections and indexes. - Done! Test that the server is working with
mise dev:server.
TBD
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 bybun prisma db push.
- Create the
.env.remotefile. - Add
HOF_DATABASE_URL=XXXwhich is the connection string to the remote database. - Run
mise --env remote import-database
mise dev:deps-upgrade will update mise, will propose to update Bun, and then show an interactive
update for npm dependencies.
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.
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.
