Skip to content

Code base to create a general project using GraphQL, Apollo, and Typescript by @albertcito

Notifications You must be signed in to change notification settings

albertcito/nodejs-web-typescript

Repository files navigation

Express + GraphQL

Build Status dependencies Status

Requitements

  • Node v15.2.1
  • PostgreSQL 13.1

To install:

  • Clone this project
  • Create .env file cp .env.example .env
  • Run yarn install (Installs all the dependencies for your project)
  • Run postgress: postgres -D /usr/local/var/postgres
    • You can also run the database in docker with docker-compose up
  • Run yarn typeorm migration:run (Creates all of the database tables)

Faker Data

To populate the DB with faker data. Using typeorm-seeding

  • yarn seeding seed

Run the server

mutation {
  login(email:"[email protected]", password:"Hola12345") {
    token
  }
}
  • Add the token in HTTP HEADERS tab to run the private queries:
{
  "Authorization": "Bearer ${token}"
}

Contribute

Before to send a PR please do it:

  • Run yarn test to run the test in dev environment.
  • Run yarn build to ensure build is working.
  • Run yarn prod:test to run the test in with the js files.
  • Run yarn eslint --fix to validate the code style.
  • Run yarn ejslint --fix to validate the ejs files.

Email Debug