This is a scalable server-side application for an e-commerce platform, developed using Node.js, Express.js, and MongoDB. The application provides robust APIs for user management, product management, and order processing. It also integrates with third-party services for payment processing and logistics.
- Project Description
- Features
- Technologies Used
- Installation
- Environment Variables
- Usage
- API Documentation
- Testing
- Security Measures
- Scalability and Performance Optimization
- License
This project is a backend application for an e-commerce platform designed to handle user authentication, product catalog, and order processing. The application uses JWT for authentication, MongoDB for data storage, and integrates with mock payment gateways and logistics providers.
- User authentication and authorization using JWT
- Product management (CRUD operations)
- Order processing and management
- Integration with mock third-party services (payments and logistics)
- Secure data handling and storage
- Performance optimization for high-volume requests
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT (JSON Web Tokens)
- Helmet
- CORS
- Morgan
- Clone the repository:
git clone https://github.com/rohitchourey0809/Backend-MyIndiaa.git
http://backend-my-indiaa.vercel.app/
Usage Start the server:
npm start The server will be running at http://localhost:8080.
API Documentation
Authentication
Register: POST /api/auth/register
{
"name": "RohitChourey",
"email": "[email protected]",
"password": "test@123"
}
Login: POST /api/auth/login
{
"email": "[email protected]",
"password": "test@123"
}
Products
Get All Products:
GET /api/products
Create Product:
POST /api/products
Request body:
{ "name": "Sample Product", "price": 29.99, "description": "This is a sample product", "category": "Sample Category", "stock": 100 }
Get Orders:
GET /api/orders (requires authentication)
Create Order:
POST /api/orders (requires authentication)
Request body:
{
"products": [
{
"product": "product_id",
"quantity": 2
}
],
"totalAmount": 59.98
}
Security Measures
SSL/TLS for secure communication
Input validation
Rate limiting
Secure storage of sensitive information
Scalability and Performance Optimization
Optimized database queries
Efficient API design to handle high volume of requests
Use of indexes in MongoDB for faster query execution