https://github.com/pragatisharma21/backend
This is a backend API built using Node.js and Express.js for handling user authentication, data management, and secure API interactions. The project follows MVC architecture and uses MongoDB as the database.
https://github.com/pragatisharma21/backend
cron-jobs docker dotenv expressjs mongodb nodejs nodemon pm2
Last synced: 2 months ago
JSON representation
This is a backend API built using Node.js and Express.js for handling user authentication, data management, and secure API interactions. The project follows MVC architecture and uses MongoDB as the database.
- Host: GitHub
- URL: https://github.com/pragatisharma21/backend
- Owner: pragatisharma21
- Created: 2025-01-16T19:25:21.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-25T13:54:59.000Z (over 1 year ago)
- Last Synced: 2026-01-03T13:19:46.892Z (6 months ago)
- Topics: cron-jobs, docker, dotenv, expressjs, mongodb, nodejs, nodemon, pm2
- Language: JavaScript
- Homepage:
- Size: 624 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
π Backend Project - Setup Guide
π Prerequisites
Before running this project, ensure you have the following installed:
Node.js (v16 or later) - Download
npm or yarn (Package Manager)
MongoDB (If using MongoDB locally, ensure itβs running)
Postman (For API testing - optional)
π Installation & Setup
1οΈβ£ Clone the repository:
sh
Copy
Edit
git clone
cd
2οΈβ£ Install dependencies:
sh
Copy
Edit
npm install
3οΈβ£ Set up environment variables:
Create a .env file in the root directory and configure:
sh
Copy
Edit
PORT=5000
MONGO_URI=
JWT_SECRET=
4οΈβ£ Run the server:
sh
Copy
Edit
npm run dev
(Default port is 5000, change in .env if needed)
π Project Structure
bash
Copy
Edit
π backend-project
β£ π src
β β£ π config # Database & other configurations
β β£ π controllers # Business logic for APIs
β β£ π middleware # Authentication & other middlewares
β β£ π models # Mongoose/Database models
β β£ π routes # API routes
β β π utils # Helper functions
β£ π .env # Environment variables
β£ π server.js # Entry point
β£ π package.json # Dependencies & scripts
β π README.md # Project documentation
π₯ API Endpoints
Method Route Description Auth Required
POST /auth/signup Register new user β
POST /auth/login User login & JWT token β
GET /users Get all users β
POST /data Add new data entry β
(For full API details, refer to routes folder)
β¨ Technologies Used
Node.js + Express.js
MongoDB + Mongoose
JWT Authentication
Bcrypt for Password Hashing
dotenv for Environment Variables