My first full-stack application exploring React/Node.js patterns. Built to understand e-commerce flows before learning distributed systems.
- User Authentication - Secure JWT-based login and registration
- Product Browsing - Browse products by category, brand, and price
- Product Search - Full-text search with filters
- Shopping Cart - Persistent cart management
- Checkout Flow - Seamless checkout with address management
- PayPal Payments - Payment integration demo
- Order Tracking - View order history and status
- Product Reviews - Rate and review purchased products
- Dashboard - Overview of orders and sales
- Product Management - CRUD operations for products with image uploads
- Order Management - View and update order statuses
- Feature Management - Manage homepage featured items
- Cloudinary Integration - Image upload and management
| Technology | Purpose |
|---|---|
| React 19 | UI Library |
| TypeScript | Type Safety |
| Vite | Build Tool |
| TailwindCSS | Styling |
| Shadcn/UI | UI Components |
| Redux Toolkit | State Management |
| React Router v7 | Navigation |
| Lucide React | Icons |
| Technology | Purpose |
|---|---|
| Node.js | Runtime |
| Express.js | Web Framework |
| MongoDB | Database |
| Mongoose | ODM |
| JWT | Authentication |
| Cloudinary | Image Storage |
| PayPal SDK | Payments |
| bcryptjs | Password Hashing |
elora/
├── client/ # React Frontend
│ ├── src/
│ │ ├── components/ # React Components
│ │ │ ├── ui/ # Shadcn UI Components
│ │ │ ├── auth/ # Auth Layout
│ │ │ ├── admin-view/ # Admin Components
│ │ │ ├── shopping-view/# Shopping Components
│ │ │ └── common/ # Shared Components
│ │ ├── pages/ # Route Pages
│ │ │ ├── auth/ # Login, Register
│ │ │ ├── admin-view/ # Dashboard, Products, Orders, Features
│ │ │ └── shopping-view/# Home, Listing, Checkout, Account
│ │ ├── store/ # Redux Slices
│ │ ├── lib/ # Utilities
│ │ ├── hooks/ # Custom Hooks
│ │ └── config/ # Form Configurations
│ └── package.json
├── server/ # Express Backend
│ ├── models/ # Mongoose Models
│ ├── controllers/ # Route Controllers
│ ├── routes/ # Express Routes
│ ├── middlewares/ # Custom Middleware
│ ├── services/ # Business Logic
│ └── package.json
└── README.md
- Node.js 18.x or higher
- MongoDB instance (local or cloud)
- Cloudinary account (for image uploads)
- PayPal Developer account (optional, for payments)
-
Clone the repository
git clone <repository-url> cd elora
-
Install root dependencies
npm install
-
Install client dependencies
cd client && npm install
-
Install server dependencies
cd ../server && npm install
-
Set up environment variables
Create a
.envfile in theserverdirectory:PORT=3001 MONGO_DB=mongodb://localhost:27017/elora MONGO_DB_NAME=elora JWT_SECRET_KEY=your_jwt_secret JWT_EXPIRES_IN=1d JWT_ALGORITHM=HS256 CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret # Payment Mode: "demo" | "sandbox" | "live" PAYMENT_MODE=demo # PayPal (required for sandbox/live modes) PAY_PAL_MODE=sandbox PAY_PAL_CLIENT_ID=your_paypal_client_id PAY_PAL_CLIENT_SECRET=your_paypal_client_secret NODE_ENV=development
Development Mode:
-
Start the server (from
serverdirectory):npm run dev
Server runs at: http://localhost:3001
-
Start the client (from
clientdirectory):npm run dev
Client runs at: http://localhost:5173
Production Mode:
-
Build the client:
cd client && npm run build
-
Start the server:
cd server && npm start
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login user |
| GET | /api/auth/check-auth |
Verify JWT token |
| POST | /api/auth/logout |
Logout user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shop/products/get |
Get all products |
| GET | /api/shop/products/get/:id |
Get product by ID |
| GET | /api/shop/products/search |
Search products |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shop/cart/get/:userId |
Get user cart |
| POST | /api/shop/cart/add |
Add to cart |
| PUT | /api/shop/cart/update-cart-item |
Update cart item |
| DELETE | /api/shop/cart/delete/:userId/:productId |
Remove from cart |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shop/orders/get/:userId |
Get user orders |
| POST | /api/shop/orders/create |
Create order |
| POST | /api/shop/orders/capture |
Capture PayPal payment |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/shop/address/get/:userId |
Get user addresses |
| POST | /api/shop/address/add |
Add address |
| PUT | /api/shop/address/update/:id |
Update address |
| DELETE | /api/shop/address/delete/:id |
Delete address |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/products/get |
Get all products |
| POST | /api/admin/products/add |
Add product |
| PUT | /api/admin/products/edit/:id |
Edit product |
| DELETE | /api/admin/products/delete/:id |
Delete product |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/orders/get |
Get all orders |
| GET | /api/admin/orders/details/:id |
Get order details |
| PUT | /api/admin/orders/update/:id |
Update order status |
Elora uses Shadcn/UI components with custom styling:
- Avatar - User avatars
- Badge - Status indicators
- Button - Various button variants
- Card - Content containers
- Checkbox - Form checkboxes
- Dialog - Modal dialogs
- Dropdown Menu - Navigation menus
- Input - Form inputs
- Select - Dropdown selects
- Skeleton - Loading states
- Tabs - Tab navigation
- Toast - Notifications
The application supports three payment modes configured via PAYMENT_MODE:
| Mode | Description | Use Case |
|---|---|---|
demo |
Mock payment, no real transactions | Development, demos, portfolios |
sandbox |
PayPal sandbox environment | Testing with PayPal |
live |
Production PayPal payments | Real transactions |
VITE_API_URL=http://localhost:3001/apiSee the .env.example file in the server directory for all required variables.
Client:
cd client
npm run dev # Start dev server
npm run build # Build for production
npm run lint # Run ESLint
npm run preview # Preview production buildServer:
cd server
npm run dev # Start with nodemon
npm start # Start production serverScreenshots temporarily removed - updating with new UI soon
- Push code to GitHub
- Connect repository to Vercel
- Set environment variables
- Deploy
- Push code to GitHub
- Create new Web Service on Render
- Set environment variables
- Deploy
- Create cluster on MongoDB Atlas
- Configure network access
- Get connection string
- Add to environment variables
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing TypeScript patterns
- Use the
cn()utility for class merging - Maintain consistent import order
- Write descriptive commit messages
Building Elora taught me:
- Database transactions matter: Race conditions in inventory taught me to use MongoDB sessions
- Payment state machines: The difference between "created" and "captured" requires idempotency keys
- Type safety: Migrating from JavaScript to TypeScript caught bugs I didn't know I had
Built with ❤️ using React, TypeScript, and Node.js