Skip to content

Learn about MERN stack and build a Demo Website to sell shoes online (Bao&Nhut's Shoe Store) - Module Backend

Notifications You must be signed in to change notification settings

realTranQuocBao/NBS-Store-BE

Repository files navigation

Setup backend

npm i bcryptjs dotenv express express-async-handler jsonwebtoken mongoose morgan swagger-ui-express yamljs multer uuid sharp cors
npm i --save-dev concurrently nodemon

multer: để xử  phần multipart/form-data.
uuid: UUID  viết tắt của Universally Unique IDentifier, hiểu nôm na   sẽ random ra một định danh duy nhất.
sharp: đây  thư viện image resize libraries.

Note

Module PORT Port
BE (API) /api/v1/* 5000
FE web (client) /* 3000
FE web (admin) /admin/* 3000

.env file

PORT=<port_here>
NODE_ENV=<development||production>
~~JWT_SECRET=<jwt_secret_key>~~ => ACCESS_TOKEN_SECRET=<access_secret_key>
REFRESH_TOKEN_SECRET=<refresh_secret_key>
ACCESS_TOKEN_EXPIRESIN=1h
REFRESH_TOKEN_EXPIRESIN=1.5h
PAYPAL_CLIENT_ID=<bảo cute vl>
MONGO_URL=<mongo_uri_here>

Database tables

<!-- Origin -->
product
user
order
<!-- New -->
producer
category
<!-- Future -->
config (for email)
slider (for slide on homepage)
discount

About

Learn about MERN stack and build a Demo Website to sell shoes online (Bao&Nhut's Shoe Store) - Module Backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published