Welcome to Siloe, a full-featured eCommerce platform built with React.js, PostgreSQL, and secured with JWT authentication. This application provides a seamless shopping experience with secure payments via Razorpay integration.
- User Authentication: Secure JWT-based authentication system
- Product Management: Add, update, and manage products with ease
- Shopping Cart: Real-time cart updates and management
- Payment Integration: Secure checkout with Razorpay
- Order Tracking: Complete order history and tracking
- User Profiles: Customizable user profiles with order history
- Admin Dashboard: Comprehensive admin controls for product and order management
- Responsive Design: Seamless experience across all devices
-
Frontend
- React.js
- Redux for state management
- Axios for API calls
- Bootstrap for styling
-
Backend
- Node.js/Express.js
- PostgreSQL database
- JWT for authentication
- Razorpay payment gateway
- Clone the Repository
git clone https://github.com/Justparthi/Siloe.git
cd postecom
- Install Dependencies
Frontend:
cd frontend
npm install
Backend:
cd backend
npm install
- Environment Variables
Create .env
files in both frontend and backend directories:
Frontend .env
:
REACT_APP_API_URL=http://localhost:5000
REACT_APP_RAZORPAY_KEY_ID=<your-razorpay-key-id>
Backend .env
:
PORT=5000
DATABASE_URL=<your-postgresql-url>
JWT_SECRET=<your-jwt-secret>
RAZORPAY_KEY_ID=<your-razorpay-key-id>
RAZORPAY_KEY_SECRET=<your-razorpay-key-secret>
- Database Setup
cd backend
npm run migrate
- Run the Application
Frontend:
cd frontend
npm start
Backend:
cd backend
npm run dev
The application will be running at http://localhost:3000
(frontend) and http://localhost:5000
(backend).
βββ frontend/
β βββ src/
β β βββ components/
β β βββ pages/
β β βββ redux/
β β βββ services/
β β βββ utils/
β βββ public/
βββ backend/
βββ controllers/
βββ middleware/
βββ models/
βββ routes/
βββ utils/
- ProductList: Displays products with filtering and sorting
- Cart: Shopping cart management
- Checkout: Payment processing with Razorpay
- UserDashboard: Order history and profile management
- AdminPanel: Product and order management for admins
- Auth Controller: Handles user authentication and JWT
- Product Controller: Product CRUD operations
- Order Controller: Order processing and management
- Payment Controller: Razorpay integration and payment processing
-
Razorpay Setup
- Create a Razorpay account
- Get API keys from the dashboard
- Add keys to environment variables
-
Implementation
- Initialize Razorpay in checkout component
- Handle payment success/failure
- Verify payment signature on backend
-
Registration
- User submits registration form
- Password hashing
- JWT token generation
-
Login
- Credential verification
- JWT token generation and storage
-
Protected Routes
- JWT verification middleware
- Role-based access control
POST /api/auth/register
POST /api/auth/login
GET /api/auth/profile
GET /api/products
GET /api/products/:id
POST /api/products (Admin)
PUT /api/products/:id (Admin)
DELETE /api/products/:id (Admin)
POST /api/orders
GET /api/orders
GET /api/orders/:id
-
Frontend Deployment (Vercel)
- Build the React application
- Configure environment variables
- Deploy the build folder
-
Backend Deployment (render)
- Configure Procfile
- Set environment variables
- Deploy the backend application
-
Database Setup
- Set up PostgreSQL instance
- Run migrations
- Configure connection string
The application implements comprehensive error handling:
- Frontend axios interceptors
- Backend error middleware
- Payment failure handling
- Network error recovery
This project is licensed under the MIT License.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For any queries or support:
- Open an issue
- Contact: [email protected]
- Documentation: Wiki