Base URL: https://glimpse-backend-9gln.onrender.com
Health Check: https://glimpse-backend-9gln.onrender.com/health
- π Authentication & Authorization: JWT-based authentication with refresh tokens
- π¦ Product Management: CRUD operations for products with search and filtering
- π Shopping Cart: Persistent cart management
- π Order Processing: Complete order lifecycle management
- β Review System: Product reviews and ratings
- π‘οΈ Rate Limiting: In-memory rate limiting for API protection
- β‘ Caching: In-memory caching for improved performance
- π§ Email Notifications: Nodemailer integration for transactional emails
|
Node.js + TypeScript Express.js Framework |
MongoDB + Mongoose In-Memory Cache |
JWT Authentication Rate Limiting + Helmet |
- Node.js (v16 or higher)
- MongoDB
- Clone the repository:
git clone <repository-url>
cd glimpse-backend- Install dependencies:
npm install- Configure environment variables:
cp .env.example .envEdit .env with your configuration:
- Database connection strings
- JWT secrets
- Email credentials
- Admin secret
- Build the project:
npm run build- Start the server:
# Development
npm run dev
# Production
npm startBase URL: https://glimpse-backend-9gln.onrender.com/api/v1
POST /auth/signup- Register new userPOST /auth/login- User loginPOST /auth/refresh- Refresh access tokenPOST /auth/logout- User logout
GET /products- Get all products (with filters)GET /products/:id- Get product by IDPOST /products- Create product (admin)PUT /products/:id- Update product (admin)DELETE /products/:id- Delete product (admin)
GET /cart- Get user cartPOST /cart- Add item to cartPUT /cart/:itemId- Update cart itemDELETE /cart/:itemId- Remove item from cart
GET /orders- Get user ordersGET /orders/:id- Get order by IDPOST /orders- Create new orderPUT /orders/:id- Update order status (admin)
GET /reviews/product/:productId- Get product reviewsPOST /reviews- Create reviewPUT /reviews/:id- Update reviewDELETE /reviews/:id- Delete review
This application is deployed on Render.
Make sure to set all required environment variables in your Render dashboard:
MONGODB_URI_PROD- Production MongoDB connection stringJWT_SECRET,JWT_REFRESH_SECRET,JWT_RESET_SECRETEMAIL_USER,EMAIL_PASSADMIN_SECRETFRONTEND_URLNODE_ENV=production
npm install && npm run buildnpm startsrc/
βββ config/ # Configuration files (DB)
βββ controllers/ # Route controllers
βββ middleware/ # Custom middleware (auth, rate limiting, error handling)
βββ models/ # Mongoose models
βββ routes/ # API routes
βββ services/ # Business logic
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions (cache, helpers)
βββ app.ts # Application entry point
- π‘οΈ Helmet for security headers
- π CORS configuration
- β±οΈ Rate limiting with in-memory store
- π JWT token authentication
- π Password hashing with bcryptjs
- β Input validation and sanitization