- Clone this repository and open it
$ git clone https://github.com/mustakadem/fuelPriceApp.git
$ cd fuelPriceApp
- Install dependencies
$ yarn
- 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
- Launch a PostgreSQL database with docker, it will use the port defined in the
DB_PORT
var.
$ docker-compose up
- Generate the prisma client
$ yarn prisma generate
- Create the database model
$ yarn migrate
- Launch the dev mode
$ yarn dev
-
Now you can then open the GraphQL Playground in http://localhost:3000/graphql
-
If you're going to edit the GraphQL schema, run the following command to regenerate the TypeScript types.
$ yarn gql:typings --watch
- 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
- Install git hooks locally
$ yarn husky install
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 executeyarn 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 thesrc/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.
You can attach a debugger to the Node.js instance that runs when you're using either yarn dev
or yarn test:debug
.