- Mongo
- Mongoose
- Express
- BodyParser
- CORS
- Node
The backend API for Strange Flora, a React eCommerce site. API development is tested during development using Postman.
/api/products/all //view all products
/api/products/:id //view specific product
/api/featured/:type_id //get featured products for category
/api/categories/all //view all categories
/api/categories/:category_id //view specific category
/api/categories/:category/products //view all products in category
/api/landingsections/ //get all landingsections
/api/deliveries/ //get all delivery options
- Install base dependencies
- Create
index
- Create error handler in index
- Create
handlers/error
to format JSON errors - Use in app
- Create
models/index
- Add all basic schemas based on frontend seeds
- Add preSave bcrypt to encrypt password
- Add comparePassword to check correct password
- Add .env
- Async signup
- Signup JWT
- Handle validation error
- Add signup route
- Add signin handler
- Include in routes
- Link Users and Reviews
- Include in
models/index
- Include in
index.js
- Add routes
- Add loginrequired function
- Check header token for user logged in
- Add ensureCorrectUser function
- check user id of request matches user logged in
- Include middleware in app
- Pass to reviews routes
- Post, GetAll handlers
- Post, GetAll routes
- Post, GetAll handlers
- Post, GetAll routes
- Post, GetAll handlers
- Post, GetAll routes
- Copy seed function from frontend
- Convert to Mongoose population
- Include in app
- Add route
- Add handler to return products in specific category
- Add delivery option model
- Add route to get delivery options
- Add handler to return array of name, price objects
- Change type in Product to category id ref
- Update category model to 'type' for clearer syntax
- Populate product response type fields
- Update seeds
- Add type lookup to routes which require id/type conversion
- Add procfile
- Change port listener
- Add url for MongoDB
- Add dotEnv for MongoDB ID
- Add heroku app
- Link to Github master branch
- Push live
- Simplify function to add last objects to array instead of random
- Add user handlers
- Add user routes
- Add personal wishlist & cart arrays to user model
- Add deleteUser route for testing