Skip to content

ChayanSD/BackEnd-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend with js

Model Link

project setup :

part 1 :

  • npm init
  • create.gitkeep for push the empty file.
  • create.gitignore for hiding the secure file.
  • create .env file
  • create src folder
  • src/index.js is the entry file for this project
  • install nodemon for auto running the server npm i -D nodemon (-D for devDependencies)
  • "dev": "nodemon src/index.js"

part 2 :

  • src/ mkdir controllers db middlewares models routes utils
  • npm i express mongoose dotenv
  • npm i cookie-parser cors (cors -> cross-origin resource sharing)
  • npm install mongoose-aggregate-paginate-v2
  • npm install bcrypt (A library to help you hash passwords.)
  • npm isntall jsonwebtoken (An implementation of JSON Web Tokens.)
  • npm install cloudinary (Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline.)
  • npm install multer (Multer is a node.js middleware for handling multipart/form-data, which is primarily used for uploading files.)

run project with dotenv :

"dev": "nodemon -r dotenv/config --experimental-json-modules src/index.js"

Project Flow

  1. connect database (db folder)
  2. define constants.js file
  3. configuration express at app.js file
  4. utils/asyncHandler.js ->
  5. utils/errorHandler.js->Handling Errors
  6. utils/ApiResponse.js -> Handling Response
  7. models /user.js-> create user schema and model,implement bcryptjs for password hashing.
  8. models/video.js
  9. setup the cloudinary

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published