The main goal of this exercise was to build an API in NodeJS and ExpressJS that uses TypeScript including tests - Jest - and documentation - swagger.
The secondary goal of our project was to enhance our ability to work together effectively, enabling us to successfully complete larger projects in the future. To accomplish this, we leveraged our collective work and life experiences, allowing us to incorporate valuable insights from each team member. As a result, we established productive patterns that fostered seamless communication and clarity in standards.
The main technical challenge was to incorporate TypeScript since we are both relatively new to building APIs with NodeJS and TypeOrm.
Github: github.com/MandyGan
LinkedIn: linkedin.com/in/lingling-gan/
Github: github.com/nicorithner
LinkedIn: linkedin.com/in/nicorithner/
- A CRUD a API with Users, Menus, and Recipes
- Recipes are generated by an external API - spoonacular api but transformed into a new recipe format before sending a JSON response through our API.
- APIs include tests
- APIs are documented using swagger
- a user can create a menu indicating preferred ingredients
- a user can create a menu based on a selection of preferred ingredients
- a user can update a menu's recipes individually without generating all recipes
- Implement User authentication
- NodejS
- ExpressJS
- TypeScript
- TypeOrm
- PosgreSQL
To run locally please first make sure to already have installed Node and NPM
- Clone this repo locally
git clone git@github.com:nicorithner/chinese-menu-generator-be.git
To run the api:
- Run
npm install
- Run
npm run build
- Run
npm run dev
It will run at http://localhost:8000/
To test:
- Run
npm run test
If this fails run tests individually:
- Run
npm run test __tests__/routes/users.test.ts
- Run
npm run test __tests__/routes/menus.test.ts
- Run
npm run test __tests__/routes/recipes.test.ts
- Id
- firstName
- lastName
a user has many menus
- Id
- name
- user_id
A menu belongs to a user
- Id
- category
- title
- summary
- steps
- ingredients
A recipe belongs to a menu
To access API documentation please navigate to
http://localhost:8000/api-docs
Visit postman to checkout the collection of enpoints and try it locally.
Finds all users
Finds an individual user by id
Creates a new user
Updates an individual user by id
Deletes an individual user by id
Lists a user by id menus
Finds all menus
Finds an individual menu by id
Creates a new menu
Updates an individual menu by id
Deletes an individual menu by id
Delete menu recipe by id
Finds all recipes
Finds an individual recipe by id
Creates a new recipe
Updates an individual recipe by id
Deletes an individual recipe by id