Skip to content

This is a NX Monorepo that will provide you with a Doughnuts API app ready to use

Notifications You must be signed in to change notification settings

tbauman88/doughnuts-and-dls

Repository files navigation

CI code style: prettier


What is Doughnuts API? 🍩

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"

Setup & Run the Application

Get Started

yarn

Build Doughnuts

Using this command will fetch the new weekly doughnut flavours that are updated every Tuesday.

yarn doughnuts:build

Start API

Setup server to load your data on localhost:3000

yarn start api

To view Swagger docs go to http://localhost:3000/api

APIS

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

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

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

Scaffolded using NX

Build

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.

Running unit tests

Run nx test api to execute the unit tests via Jest.

Run nx affected:test to execute the unit tests affected by a change.

Running end-to-end tests

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.

Understand your workspace

Run nx dep-graph to see a diagram of the dependencies of your projects.

Further help

Visit the Nx Documentation to learn more.

About

This is a NX Monorepo that will provide you with a Doughnuts API app ready to use

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published