______ ______ __ __ ______ ______ ______ __ __ ______ ______ ______
/\ ___/\ __ \/\ "-.\ \/\__ _/\ __ \/\ ___\/\ \_\ \ /\ == \/\ == /\ ___\
\ \ __\ \ __ \ \ \-. \/_/\ \\ \ __ \ \___ \ \____ \ \ \ __<\ \ _-\ \ \__ \
\ \_\ \ \_\ \_\ \_\\"\_\ \ \_\\ \_\ \_\/\_____\/\_____\ \ \_\ \_\ \_\ \ \_____\
\/_/ \/_/\/_/\/_/ \/_/ \/_/ \/_/\/_/\/_____/\/_____/ \/_/ /_/\/_/ \/_____/
______ ______ __ __ ______ ______ ______ ______ ______ ______
/\ ___\/\ ___\/\ "-.\ \/\ ___\/\ == \/\ __ \/\__ _/\ __ \/\ == \
\ \ \__ \ \ __\\ \ \-. \ \ __\\ \ __<\ \ __ \/_/\ \\ \ \/\ \ \ __<
\ \_____\ \_____\ \_\\"\_\ \_____\ \_\ \_\ \_\ \_\ \ \_\\ \_____\ \_\ \_\
\/_____/\/_____/\/_/ \/_/\/_____/\/_/ /_/\/_/\/_/ \/_/ \/_____/\/_/ /_/
version 0.2.0
(Sub-Zero font from http://patorjk.com/software/taag/)
The generator that acts as the server for games. It starts the game, takes input from players, checks the database for matching input, passes the database entry to the game, and then sends the game's responses to the player.
It also maintains public information that players can read to learn more about the game. The database is not for storing save files or player accounts.
<redacted> means that a password has been removed.
The goal of redacting passwords is to prevent this project from ending up on plain text offenders. https://github.com/plaintextoffenders/plaintextoffenders/blob/master/offenders.csv
Supply your own password for the database. Avoid committing it to git in plain text.
$ yarn install
Add this to a .env file in the root of the project directory. This is for Nest.JS so it can connect to the postgres databse.
TYPEORM_TYPE = "postgres"
TYPEORM_HOST = "localhost"
TYPEORM_USERNAME = "postgres"
TYPEORM_PASSWORD = <redacted>
TYPEORM_DATABASE = "frg_db"
TYPEORM_PORT = 5432
TYPEORM_LOGGING = true
TYPEORM_ENTITIES = "dist/model/*.entity.js"
TYPEORM_MIGRATIONS_RUN = true
TYPEORM_SYNCHRONIZE = false
Add this to a ormconfig.json in the root of the project directory. This is for typeORM so it can run migrations against the postgres database.
{
"type" : "postgres",
"host" : "localhost",
"port" : 5432,
"username" : "postgres",
"password" : <redacted>,
"database" : "frg_db",
"entities" : ["dist/model/*.entity.js"],
"migrations": ["dist/migration/*.js"],
"cli" : {
"migrationsDir": "src/migration"
}
}
When developing, start by running the migration run command and then start the app.
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# Generates a new migration script
$ npm run typeorm:migration:generate -- add_informative_migration_name
# Runs all of the migrations that are not in the migration
$ npm run typeorm:migration:run
# Reverts the most recent migration
$ npm run typeorm:migration:revert"
./script/start-db.sh <redacted>
docker run --name local-postgres -p 5432:5432 -e POSTGRES_PASSWORD= -d postgres -rm
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.