项目作者: aajungroth

项目描述 :
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.
高级语言: TypeScript
项目地址: git://github.com/aajungroth/fantasy-rpg-generator.git
创建时间: 2019-03-16T02:34:33Z
项目社区:https://github.com/aajungroth/fantasy-rpg-generator

开源协议:GNU Affero General Public License v3.0

下载


  1. ______ ______ __ __ ______ ______ ______ __ __ ______ ______ ______
  2. /\ ___/\ __ \/\ "-.\ \/\__ _/\ __ \/\ ___\/\ \_\ \ /\ == \/\ == /\ ___\
  3. \ \ __\ \ __ \ \ \-. \/_/\ \\ \ __ \ \___ \ \____ \ \ \ __<\ \ _-\ \ \__ \
  4. \ \_\ \ \_\ \_\ \_\\"\_\ \ \_\\ \_\ \_\/\_____\/\_____\ \ \_\ \_\ \_\ \ \_____\
  5. \/_/ \/_/\/_/\/_/ \/_/ \/_/ \/_/\/_/\/_____/\/_____/ \/_/ /_/\/_/ \/_____/
  6. ______ ______ __ __ ______ ______ ______ ______ ______ ______
  7. /\ ___\/\ ___\/\ "-.\ \/\ ___\/\ == \/\ __ \/\__ _/\ __ \/\ == \
  8. \ \ \__ \ \ __\\ \ \-. \ \ __\\ \ __<\ \ __ \/_/\ \\ \ \/\ \ \ __<
  9. \ \_____\ \_____\ \_\\"\_\ \_____\ \_\ \_\ \_\ \_\ \ \_\\ \_____\ \_\ \_\
  10. \/_____/\/_____/\/_/ \/_/\/_____/\/_/ /_/\/_/\/_/ \/_/ \/_____/\/_/ /_/

version 0.2.0


(Sub-Zero font from http://patorjk.com/software/taag/)

Description


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.

A Note About Passwords

\ 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.

Installation

  1. $ yarn install

Running the app

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.

  1. TYPEORM_TYPE = "postgres"
  2. TYPEORM_HOST = "localhost"
  3. TYPEORM_USERNAME = "postgres"
  4. TYPEORM_PASSWORD = <redacted>
  5. TYPEORM_DATABASE = "frg_db"
  6. TYPEORM_PORT = 5432
  7. TYPEORM_LOGGING = true
  8. TYPEORM_ENTITIES = "dist/model/*.entity.js"
  9. TYPEORM_MIGRATIONS_RUN = true
  10. 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.

  1. {
  2. "type" : "postgres",
  3. "host" : "localhost",
  4. "port" : 5432,
  5. "username" : "postgres",
  6. "password" : <redacted>,
  7. "database" : "frg_db",
  8. "entities" : ["dist/model/*.entity.js"],
  9. "migrations": ["dist/migration/*.js"],
  10. "cli" : {
  11. "migrationsDir": "src/migration"
  12. }
  13. }

When developing, start by running the migration run command and then start the app.

  1. # development
  2. $ npm run start
  3. # watch mode
  4. $ npm run start:dev
  5. # production mode
  6. $ npm run start:prod
  7. # Generates a new migration script
  8. $ npm run typeorm:migration:generate -- add_informative_migration_name
  9. # Runs all of the migrations that are not in the migration
  10. $ npm run typeorm:migration:run
  11. # Reverts the most recent migration
  12. $ npm run typeorm:migration:revert"

Starting the postgres docker image with the bash script

./script/start-db.sh \

Starting the postgres docker image with the docker command

docker run —name local-postgres -p 5432:5432 -e POSTGRES_PASSWORD= -d postgres -rm

Test

  1. # unit tests
  2. $ npm run test
  3. # e2e tests
  4. $ npm run test:e2e
  5. # test coverage
  6. $ npm run test:cov


Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.



@nestjs/core.svg" alt="NPM Version" />
@nestjs/core.svg" alt="Package License" />
@nestjs/core.svg" alt="NPM Downloads" />
Travis
Linux
Coverage
Gitter
Backers on Open Collective
Sponsors on Open Collective



Support

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.

Stay in touch

License

Nest is MIT licensed.