GraphQL based API to track history of Coup G54 games.
Notable rules
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
{
"printWidth": 80,
"singleQuote": true,
"arrowParens": "always"
}
Avaliable schemas
type Card {
name: String!
action: String!
category: String!
counteraction: String
}
type Session {
id: String!
name: String!
rounds: [Round]
}
type Round {
id: String!
winner: String
players: [String]!
type: String!
session: Session
}
type Mutation {
addSession(name: String): Session
}
type Query {
randomDeck: [Card]!
cardsInCategory(category: String!): [Card]
card(id: Int!): Card
cards: [Card]
session(id: String!): Session
sessions: [Session]
rounds: [Round]
round(id: String): Round
}
Also subscription is avaliable for Sessions
subscription sessionAdded {
sessionAdded {
name
}
}
You need active MongoDB server available to run or test the application locally.
MONGO_DB_CONNECTION=mongodb://localhost:27017/myproject
MONGO_DB_TEST_CONNECTION=mongodb://localhost:27017/myproject_test
PORT=8080
Run npm install
to install all packages, and npm run dev
to start app with hot reload using nodemon
.
Run npm run build && npm run start
to use production version.
Run npm run test
for testing.
GCP Cloud Build used to build test and deploy an app to the GCP App Engine. Take a look at cloudbuild.yaml
and app.yaml
for more information. To be able to deploy app successfully to Cloud Build
you would need to encrypt .env file with prod values using kms and commit it to the repository. Also, you need to update keyName and keyRing in cloudbuid.yaml
more information here
Demo avaliable at https://time-to-coup.appspot.com
MIT License