Skip to content

EtienneDuv/backend-exercise-2023

 
 

Repository files navigation

Applifting Blog Engine fullstack exercise

Dev tools

Codegen

When dev api is running (port 3000), npm run codegen generates the types from exposed graphQL schema.

These generated types (src/generated/types.ts) are used to type arguments of all resolvers.

Run and try api

Dev environment

Run postgres container docker run --name devPostgres --env-file .env.dev -p 5432:5432 -d postgres

Install dependencies npm i

Create tables npm run db:migrate:dev

Seed tables npm run db:seed:dev

Run the api npm run start:dev

Access sandbox localhost:3000. You can play around and see documentation

Prod environment - docker-compose

  • npm run compose:dev will use .env.dev file. When hosting the api, we would run npm run compose:prod and copy .env file on the server.
  • try the api:
    • Access Apollo sandbox at http://localhost:13000
    • Import postman_collection.json in Postman to have prepared queries

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.2%
  • Dockerfile 0.8%