Skip to content

mustakadem/fuelPriceApp

Repository files navigation

FuelPriceApp Back

Getting started

  1. Clone this repository and open it
$ git clone https://github.com/mustakadem/fuelPriceApp.git
$ cd fuelPriceApp
  1. Install dependencies
$ yarn
  1. Create a copy of the .env.development file and call it .env. Update the environment variables to match your current environment.
$ cp .env.development .env
  1. Launch a PostgreSQL database with docker, it will use the port defined in the DB_PORT var.
$ docker-compose up
  1. Generate the prisma client
$ yarn prisma generate
  1. Create the database model
$ yarn migrate
  1. Launch the dev mode
$ yarn dev
  1. Now you can then open the GraphQL Playground in http:https://localhost:3000/graphql

  2. If you're going to edit the GraphQL schema, run the following command to regenerate the TypeScript types.

$ yarn gql:typings --watch
  1. Launch the CLI and create the Z1 organization with the default values. After that, create a user. Make sure to use the same email domain in both the organization and user.
$ yarn cli
  1. Install git hooks locally
$ yarn husky install

Scripts

  • yarn dev. Runs the project in dev mode, which means that it won't check types and will restart with every change you make.
  • yarn build. Compiles the project to the ./dist folder.
  • yarn typecheck. Checks the typings of the project. Gets executed before trying to create a new commit but you can also run it manually.
  • yarn start. Runs the compiled program. Remember to execute yarn build before attempting to launch the program.
  • yarn lint. Runs ESLint. You can append --fix in order to fix autofixable issues.
  • yarn gql:typings. Watches for changes in the GraphQL files and regenerates the src/graphql.ts file.
  • yarn cli. Launch a CLI utility that allows you to manage your instance.
  • yarn test. Launch the test suite.
  • yarn test:debug. Launch the test suite in debug mode. You'll need to run all the tests at least one time before trying to set any breakpoint.
  • yarn makemigrations. Generates a migration of the changes made to the prisma schema.
  • yarn migrate. Execute pending migrations.

Debugging

You can attach a debugger to the Node.js instance that runs when you're using either yarn dev or yarn test:debug.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published