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 with Redis caching
- 📋 Order Processing: Complete order lifecycle management
- ⭐ Review System: Product reviews and ratings
- 🛡️ Rate Limiting: Redis-backed rate limiting for API protection
- ⚡ Caching: Redis caching for improved performance
- 📧 Email Notifications: Nodemailer integration for transactional emails
|
Node.js + TypeScript Express.js Framework |
MongoDB + Mongoose Redis Cache |
JWT Authentication Rate Limiting + Helmet |
- Node.js (v16 or higher)
- MongoDB
- Redis
- 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
- Redis URL
- 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/register- 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 stringREDIS_URL- Redis connection URLJWT_SECRET,JWT_REFRESH_SECRET,JWT_RESET_SECRETEMAIL_USER,EMAIL_PASSADMIN_SECRETFRONTEND_URLNODE_ENV=production
npm install && npm run buildnpm startsrc/
├── config/ # Configuration files (DB, Redis)
├── 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 Redis
- 🔑 JWT token authentication
- 🔐 Password hashing with bcryptjs
- ✅ Input validation and sanitization