Modern e-commerce platform built with Node.js, Express, and Supabase.
- ✅ Product catalog with categories (iPhone, iPad, Mac, Watch)
- ✅ Shopping cart with localStorage persistence
- ✅ Checkout flow with multiple payment methods
- ✅ Admin panel for order management
- ✅ Client & Server-side validation
- ✅ Supabase backend integration
- ✅ Responsive design
- ✅ Automated testing with Jest
- Node.js 18.x or 20.x
- npm or yarn
- Supabase account (for database)
-
Clone the repository
git clone <repository-url> cd Website
-
Install dependencies
npm install
-
Setup environment variables
cp .env.example .env # Edit .env with your Supabase credentials -
Start the server
npm start # or for development with auto-reload: npm run dev -
Open in browser
http://localhost:3000
| Script | Description |
|---|---|
npm start |
Start production server |
npm run dev |
Start development server |
npm test |
Run Jest tests |
npm run test:watch |
Run tests in watch mode |
npm run test:coverage |
Generate coverage report |
npm run validate |
Check JavaScript syntax |
npm run check |
Run validation + tests |
Website/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI/CD pipeline
├── backend/
│ ├── server.js # Express server
│ ├── routes/
│ │ └── admin.js # Admin API routes
│ └── database/
│ └── schema.sql # Database schema
├── frontend/
│ ├── *.html # HTML pages
│ ├── scripts/ # JavaScript modules
│ └── styles/ # CSS stylesheets
├── __tests__/ # Jest test files
├── docs/ # Documentation
├── .env.example # Environment variables template
├── package.json # Dependencies
└── jest.config.js # Jest configuration
Create a .env file based on .env.example:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key-here
PORT=3000
NODE_ENV=development- Create a Supabase project
- Run the schema from
backend/database/schema.sql - Update
.envwith your Supabase credentials
Run all tests:
npm testRun specific test suite:
npm test -- backend-completeGenerate coverage report:
npm run test:coverageThe project includes a GitHub Actions workflow that:
- ✅ Runs tests on Node.js 18.x and 20.x
- ✅ Validates JavaScript syntax
- ✅ Performs security audit
- ✅ Uploads coverage reports
- ✅ Checks for outdated packages
- Push your code to GitHub
- The workflow runs automatically on push/PR to
main,master, ordevelop - View results in the "Actions" tab
GET /api/products- Get all productsGET /api/products/:id- Get single productGET /api/products/category/:category- Get products by category
POST /api/orders- Create new orderGET /api/orders/history- Get order historyPOST /api/checkout- Process checkout
GET /admin/orders- Get all orders (admin)PATCH /admin/orders/:id- Update order statusDELETE /admin/orders/:id- Delete order
- Server-side validation for all inputs
- Client-side validation for UX
- Environment variables for sensitive data
- CORS configuration
- Content Security Policy headers
- Apple Pay only works on HTTPS (use localhost for testing)
- Some older browsers may not support all features
MIT
- 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
For issues and questions, please open an issue on GitHub.