A full-stack e-commerce platform built with React, Node.js, Express, and PostgreSQL.
- 🔐 User authentication with email and OTP verification
- 🛍️ Product catalog with categories
- 🛒 Shopping cart functionality
- 💳 Secure checkout with Razorpay payment gateway
- 📦 Order management and tracking
- ❌ Order cancellation (for Processing/Confirmed orders)
- 👤 User profile with order history
- 📱 Responsive design for all devices
- 📊 Admin dashboard with order statistics
- 🔍 Search and filter orders
- ✏️ Update order status
- 📈 View all customer orders
- Framework: React 18 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- UI Components: Shadcn/ui
- Animations: Framer Motion
- State Management: React Context API
- HTTP Client: Axios
- Routing: React Router v6
- Runtime: Node.js
- Framework: Express.js
- Language: TypeScript
- Database: PostgreSQL
- Authentication: JWT (JSON Web Tokens)
- Password Hashing: bcrypt
- Email: Nodemailer
- Payment Gateway: Razorpay
- Node.js (v16 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
- Razorpay account (for payments)
git clone <repository-url>
cd auraexpresscd backend
npm installCreate a .env file in the backend directory:
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=auraexpress_auth
DB_USER=postgres
DB_PASSWORD=your_password
# JWT Configuration
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRY=24h
# Email Configuration (Gmail SMTP)
EMAIL_SERVICE=gmail
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
# Server Configuration
PORT=3001
NODE_ENV=development
# Frontend Configuration (for CORS)
FRONTEND_URL=http://localhost:3000
# Razorpay Configuration (Test Mode)
RAZORPAY_KEY_ID=rzp_test_your_key_id
RAZORPAY_KEY_SECRET=your_key_secretCreate the PostgreSQL database:
createdb auraexpress_authRun the schema:
psql -U postgres -d auraexpress_auth -f schema.sqlcd frontend
npm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:3001cd backend
npm run devBackend will run on http://localhost:3001
cd frontend
npm run devFrontend will run on http://localhost:3000
- Register: Create an account with email and password
- Verify OTP: Enter the OTP sent to your email
- Login: Login with your credentials
- Browse Products: Explore the product catalog
- Add to Cart: Add products to your shopping cart
- Checkout: Fill in shipping details and payment information
- Pay: Complete payment using Razorpay (test mode)
- Track Order: View order status and tracking information
- Cancel Order: Cancel orders that are in Processing or Confirmed status
- Login: Login with admin credentials
- Access Admin Panel: Navigate to
/admin/orders - View Orders: See all customer orders
- Update Status: Change order status (Processing → Confirmed → Shipped → Delivered)
- Search/Filter: Find specific orders using search and filters
POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/verify-otp- Verify OTPPOST /api/auth/resend-otp- Resend OTP
POST /api/orders- Create new orderGET /api/orders- Get user's ordersGET /api/orders/:id- Get order detailsPATCH /api/orders/:id/cancel- Cancel order
GET /api/admin/orders- Get all ordersGET /api/admin/orders/:id- Get order detailsPATCH /api/admin/orders/:id/status- Update order statusGET /api/admin/orders/stats- Get order statistics
POST /api/payments/razorpay/create-order- Create Razorpay orderPOST /api/payments/razorpay/verify- Verify paymentGET /api/payments/razorpay/key- Get Razorpay key
Use these test card details in Razorpay:
Card Number: 4111 1111 1111 1111
CVV: 123
Expiry: Any future date (e.g., 12/25)
Name: Any name
- Place an order
- Go to Orders page
- Click "Cancel Order" on any Processing/Confirmed order
- Confirm cancellation
- Order status changes to "Cancelled"
auraexpress/
├── backend/
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── controllers/ # Request handlers
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # Data models
│ │ ├── repositories/ # Database operations
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ └── utils/ # Utility functions
│ ├── tests/ # Test files
│ ├── schema.sql # Database schema
│ └── package.json
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── contexts/ # React contexts
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ └── lib/ # Utilities
│ ├── public/ # Static assets
│ └── package.json
└── README.md
| Variable | Description | Required |
|---|---|---|
| DB_HOST | PostgreSQL host | Yes |
| DB_PORT | PostgreSQL port | Yes |
| DB_NAME | Database name | Yes |
| DB_USER | Database user | Yes |
| DB_PASSWORD | Database password | Yes |
| JWT_SECRET | Secret key for JWT | Yes |
| EMAIL_USER | Email for sending OTPs | Yes |
| EMAIL_PASSWORD | Email app password | Yes |
| PORT | Backend server port | No (default: 3001) |
| FRONTEND_URL | Frontend URL for CORS | Yes |
| RAZORPAY_KEY_ID | Razorpay key ID | Yes |
| RAZORPAY_KEY_SECRET | Razorpay key secret | Yes |
| Variable | Description | Required |
|---|---|---|
| VITE_API_URL | Backend API URL | Yes |
- Passwords are hashed using bcrypt
- JWT tokens for authentication
- CORS protection
- Rate limiting on sensitive endpoints
- OTP verification for email
- Payment signature verification
- SQL injection prevention with parameterized queries
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
For support, email support@auraexpress.com or open an issue in the repository.
- Shadcn/ui for the beautiful UI components
- Razorpay for payment gateway integration
- PostgreSQL for the robust database
- React and Express communities
Built with ❤️ by the AuraExpress Team