This is a NX Monorepo that will provide you with a Doughnuts API app ready to use. When you build this project it will fetch doughnuts being sold at Boxcar Donuts
It will include names, descriptions, prices, images and if its a special doughnut meaning that its available for a limited time or if its a standard doughnut.
id: "lemon-sherbet",
name: "Lemon Sherbet",
price: "$3.25",
description: "Our house glaze infused with naturallemon flavour and a touch of lemon buttercream. Tart and tangy on top of our soft yeast risen donut.",
type: 'standard' | 'weekly',
imageUrl: "https://boxcardonuts.ca/wp-content/uploads/2020/05/271BE853-10DE-4DB2-B7A2-A38CB876A865-scaled.jpeg"
yarn
Using this command will fetch the new weekly doughnut flavours that are updated every Tuesday.
yarn doughnuts:build
Setup server to load your data on localhost:3000
yarn start api
To view Swagger docs go to http://localhost:3000/api
The following endpoints are available for you to use
// Returns all doughnuts
/doughnuts
// Returns filtered results of standard/weekly doughnuts
/doughnuts?type=doughnutType
// Returns a single doughnut
/doughnuts/:dounughtId
Continuous Integration (CI) has been setup using GitHub Actions. Please refer to the ci.yml
file for specifics.
Linting and tests are executed, and a test coverage report is posted to the corresponding PR.
The current CI build
status is displayed on the README as a badge:
Coverage reports are posted as an autogenerated PR comment, if the CI pipeline is configured with a valid NX_GITHUB_API_TOKEN
.
To run the coverage report locally, it is easiest done with
yarn test:api:coverage
Run nx build api
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run nx test api
to execute the unit tests via Jest.
Run nx affected:test
to execute the unit tests affected by a change.
Run ng e2e api
to execute the end-to-end tests via Cypress.
Run nx affected:e2e
to execute the end-to-end tests affected by a change.
Run nx dep-graph
to see a diagram of the dependencies of your projects.
Visit the Nx Documentation to learn more.