Skip to content

An API for recipes with user authentication created using Express and MongoDB

License

Notifications You must be signed in to change notification settings

Apfirebolt/express-recipe-api

Repository files navigation

Recipe API in Express

_👀 Create and share your recipes

NodeJS Express.js MongoDB

Requirements 🏃

  • Node
  • MongoDB
  • MongoDB Compass (Optional, GUI for MongoDB databases)
  • Postman (Optional, for API testing)

Install 💥

npm install
npm start

The Express app is configured to run by default on port 5000 but can be easily changed by tweaking server.js file

Features

  • User authentication 📦
  • CRUD on recipes module.
  • Recipes can have multiple images 🍗
  • Recipes can have multiple steps 🚶
  • Recipes can have multiple ingredients 🔖

Database Structure

User table fields and data types are described in the table below.

id username email password
int string string string

Recipe table structure

id title recipe
int string string

Ingredients Table

id name quantity recipe
int string int string

Recipe column links ingredients with recipes.

id title ingredient recipe name
int string string string string

The above table is for pictures table. It can be linked to either an 'ingredient' or a 'recipe', hence both these foreign key references are optional. Name is used to store the name of the final after it is generated by multer helper functions.

Database column structure for 'Steps'

id description recipe
int string string

API Docs

Detailed documentation for this API is not available yet, but below you can find some sample end points from the server.js file.

app.use('/api/users', userRoutes)
app.use('/api/recipes', recipeRoutes)
app.use('/api/steps', stepRoutes)
app.use('/api/ingredients', ingredientRoutes)
app.use('/api/pictures', pictureRoutes)

Deployment

Planned to be deployed on Azure using Docker containers.

Development

Easily set up a local development environment!

  • clone
  • npm install
  • npm start

Start coding! 🎉

Clone this repo on your machine, navigate to its location in the terminal and run:

Contributing

All contributions are welcome!
Please take a moment to review guidelines PR | Issues

About

An API for recipes with user authentication created using Express and MongoDB

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published