Shop-API is a RESTful API built with Node.js, Express.js, and MongoDB. It features JWT authentication, CORS handling, and robust security measures. The API supports CRUD operations for products and orders, and user authentication.
- JWT Authentication: Secure user authentication using JSON Web Tokens.
- CORS Handling: Cross-Origin Resource Sharing setup for API accessibility.
- Security: Implementation of security best practices.
- CRUD Operations: Create, Read, Update, and Delete functionality for products and orders.
- Controllers: Business logic for handling requests (Auth, Orders, Products).
- Models: Mongoose schemas for Order, Product, and User.
- Routes: Express routes for handling API endpoints (Orders, Products, User).
- Middleware: Custom middleware for authentication and error handling.
- Clone the repository.
- Install dependencies:
npm install
- Set environment variables for MongoDB connection and JWT secret key.
- Start the server:
npm start
- User Authentication: Sign up, log in, and account deletion.
- Products: CRUD operations for products.
- Orders: CRUD operations for orders.
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT for authentication
- Bcrypt for password hashing