todo-api's Introduction
todo-api's People
Forkers
skrwebstarttodo-api's Issues
Use ESM - NodeJS
Fix Swagger Documentation
- Update to user v3
- https://swagger.io/docs/specification/about/
- Setup Authentication Method
- Update/Add Response Codes
Merge `ExpressJS-FileHandling`
Add Email Functionality - Using own mail server
Add sorting, pagination, filtering, searching - where possible
- products route
- orders route
- saved products routes
Update APIs response Structure
Example Success Response
- URL: GET:/users?pageSize=10&pageNumber=1
{
"metadata": {
"totalCount": 100,
"pageSize": 10,
"pageNumber": 1,
"sortBy": "name",
"sortOrder": "asc"
},
"status": true,
"message": "Success",
"data": [{}, {}]
}
Add `winston` for logging, Setup proper logging
- Explore
DEBUG
variable usage
Store userId in product model
Check for automatic Release Notes Generation
save Product (add limit of 100) products can be saved
Release v0.2
- Add
morgan
- Push image to Docker Hub
- Check for change log auto generate using Issues Done
Publish docker image on DockerHub
Check for DB Migrations(mongoose migrations)
Update User Entity
Add Following Fields
- Name
Brainstorm
Setup GitHub Actions for Building and Pushing to DockerHub
Add information with todo about with how many it is shared
Payment Integration - Phase - 1
Product is getting saved with invalid(productId) [Product that does not exists]
Add product exists check before following for Save Product List
- save
[ ] remove
Fix the total of Order Model
Current
- Storing the total of Each Product Separately
Expected
- Should store the total of complete order
Todo
- Move the field from
ProductInfo
Model toOrder
Model - Fix the Logic while placing the order
/checkout
Use Async Wrapper
- Or Explore how
express-async-errors
works
Setup Proper Error Throwing
- Setup Error Classes
- Add Proper and consistent Error Code and message in response
API Docs
- REF: https://github.com/aperkaz/express-open-api
- Also Check for Using Making Postman Collection Public
Store Price of Product at time of placing the order
- Update the Model
ProductInfo
Model name toOrderProductInfo
- Add new Field (
price
) in Model - All logic in '/checkout' to store
price
- Also, Update the
ProductInfo
Model name toCartProductInfo
in cart app
Update Eslint Configurations
[prod] Deployment setup
[find] Check if `cors` can be removed without any sideffect
Custom CORS handling Code Example
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept, Authorization"
);
if (req.method === "OPTIONS") {
res.header("Access-Control-Allow-Methods", "PUT, POST, PATCH, DELETE, GET");
return res.status(200).json({});
}
next();
});
Add Type Definitions to DB Models
Apps
- product
- user
- cart
- order
- saved
Other
- Create a Common Interface for Models with
_id
,createdAt
,updatedAt
- Add
_id
in Model Interfaces
Setup GitHub Actions
Create Docker Image of the server
TODOs
Refactoring
Code Structure Changes
- Separate code into index, server files
- Move common coded to shared folder files
- Separate user into user and auth
- Auth for login, register
- Setup Prettier, ESLint, editorconfig
- Setup Husky
- Error handling, success/fail response sending
- Move code of controller to routes only and separate controller not needed
Implement Image Storage
- Store Images in MongoDB
- Store Images in S3
- Make it pluggable, what ever we will set, as a ExpressJS middleware it will store the images there
Add Util to Add Sample Products
Implement Left APIs
Add Request Body, Query Validator
Apps
- product
- user
- cart
- auth
- saved
- order
Implement the DB Operation using common file
- Ref: NodeJS-CRUD-Operations
Separate routes and controller logic to separate function
Add Custom HTTP Exceptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.