API to manage meal addons for the brands on the FoodCourt platform.
$ yarn install
- Create a
.env
file in the root directory of the project and add keys from the.env.example
file. - A databese user
postgres
was set inKnexfile.ts
. You can change this to your preferred database user. Create a database with the namefoodcourt
and update theenv
accordingly.
Run the following command to run migrations:
npm run migrate
Run the following command to seed the database:
npm run seed
# development
$ yarn run start
# watch mode
$ yarn run start:dev
Head on to http://localhost:3000/api
to view the API documentation.
In src/db/seeds/demo.ts
you can find the seed data for the database. Running the seed command will create a user and brand for you to use for testing.
Use the credentials to test the endpoints.
- Once you login with the admin credentials, an access token is generated.
- To test in places places Postman. pass
Bearer <access_token>
to the Authorization header - To test in the live swagger doc. pass only the <access_token> without any prefix to the authorize modal. (Click Authorize on the top right page to show modal)
- To test in places places Postman. pass
- Writing tests to cover the app
- Using nestjs authorization module to handle authorization (currently using a query to check users role)
- Author - Sodiq A.
- Twitter - @deyemiobaa