A full-stack electronics e-commerce web application with JWT authentication, persistent cart management, and complete order processing.
CodeAlpha Internship โ Full Stack Web Development | Task 1
๐ฆ GitHub Repository
TechStore is a full-stack electronics e-commerce platform built with React + Vite on the frontend and Node.js + Express + SQLite on the backend.
The application delivers a complete shopping experience โ product browsing, authentication, persistent shopping carts, secure checkout, order history, responsive layouts, and light/dark theme support.
This project was developed as Task 1 of the CodeAlpha Full Stack Web Development Internship, with a focus on building, testing, and deploying a complete, production-ready full-stack web application.
- 25+ realistic consumer technology products
- Multiple categories: Audio, Computer Accessories, Workspace, Mobile Accessories, Wearables, Gaming, and Networking
- Category filtering chips with keyboard-accessible navigation
- Horizontal scroll snapping for category navigation
- Interactive product cards with whole-card navigation and dedicated CTA buttons
- High-resolution product images
- Real-time stock indicators
- Quantity selectors
- Detailed product information and pricing
- Warranty and free-shipping value propositions
- Add-to-cart feedback banners with direct navigation to the cart
- User registration and login
- JSON Web Token (JWT) authentication
- Password hashing with
bcryptjs - Security-question setup during registration
- Three-step password recovery flow (email verification โ security-question verification โ password reset)
- Protected cart and order routes
- Persistent shopping cart
- Real-time stock validation preventing over-ordering
- Quantity controls and individual line-item removal
- Full cart clearing and total calculation
- Empty-cart state with clear calls-to-action
- Support for authenticated and guest shopping experiences
- Shipping-address form with validation
- Atomic order creation using SQLite transactions
- Product prices captured at time of checkout
- Automatic cart clearing after successful order creation
- User-isolated order history with individual order receipt/detail views
- Light and dark theme support, persisted via
localStorage - Zero flash-of-unformatted-content (FOUC) during theme loading
- Custom UI built with CSS Modules
- Consistent design tokens with a 4px/8px spacing rhythm
- Three-level elevation system
lucide-reacticonography- Responsive layouts for mobile, tablet, and desktop
| Layer | Technologies |
|---|---|
| Frontend | React 19, Vite 8, React Router 7, Lucide React, CSS Modules |
| Backend | Node.js, Express.js, CORS, Dotenv |
| Database | SQLite via better-sqlite3 (WAL mode) |
| Authentication | JSON Web Tokens (jsonwebtoken), bcryptjs |
| Version Control | Git & GitHub |
| Frontend Deployment | Vercel |
| Backend Deployment | Render |
โโโโโโโโโโโโโโโโโโโโโโโโ
โ USER โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ React + Vite โ
โ Frontend โ
โ (Vercel) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
HTTP / REST API
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Node.js + Express โ
โ Backend โ
โ (Render) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ SQLite โ
โ better-sqlite3 โ
โโโโโโโโโโโโโโโโโโโโโโโโ
CodeAlpha_Ecommerce/
โโโ backend/
โ โโโ data/
โ โ โโโ store.db # Auto-generated SQLite database (gitignored)
โ โโโ src/
โ โ โโโ controllers/ # Auth, cart, order & product controllers
โ โ โโโ database/ # Database initialization & seed data
โ โ โโโ middleware/ # JWT authentication middleware
โ โ โโโ models/ # User, Product, Cart & Order data models
โ โ โโโ routes/ # Express API route definitions
โ โ โโโ server.js # API entry point & health check
โ โโโ .env.example # Backend environment template
โ โโโ package.json
โโโ frontend/
โ โโโ public/ # Static assets & favicons
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โโโ context/ # Auth, Cart & Theme contexts
โ โ โโโ hooks/ # Product-related custom hooks
โ โ โโโ pages/ # Application pages
โ โ โโโ App.jsx # Application routing & layout
โ โ โโโ index.css # Global styles & design tokens
โ โ โโโ main.jsx # React DOM entry point
โ โโโ .env.example # Frontend environment template
โ โโโ index.html # HTML shell & theme initialization
โ โโโ package.json
โโโ .gitignore # Git ignore rules
โโโ README.md # Project documentation
โโโ LICENSE # MIT License
- Node.js v18.0.0 or higher
- npm v9.0.0 or higher
- Git
Verify your installation:
node --version
npm --version
git --versiongit clone YOUR_GITHUB_REPOSITORY_URL
cd CodeAlpha_EcommerceNavigate to the backend directory:
cd backendInstall dependencies:
npm installCreate the environment file:
macOS / Linux:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .envConfigure .env:
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRES=7dStart the backend:
npm run devBackend API: http://localhost:5000
Health check: http://localhost:5000/api/health
Open a new terminal and navigate to the frontend directory:
cd frontendInstall dependencies:
npm installCreate the environment file:
macOS / Linux:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .envConfigure the frontend environment according to the backend API URL.
Start the frontend:
npm run devThe application will normally be available at: http://localhost:5173
TechStore uses an embedded SQLite database through better-sqlite3. No external database server is required for local development.
When the backend starts for the first time:
- The SQLite database is automatically created.
- The database schema is initialized.
- Required tables are created.
- Seed data is inserted when the product catalog is empty.
The database includes the following tables:
productsuserscart_itemsordersorder_items
The generated database is stored at backend/data/store.db and is excluded from Git version control via .gitignore.
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
GET |
/api/health |
Returns server status and environment information | โ |
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
GET |
/api/products |
Retrieve all products | โ |
GET |
/api/products/:id |
Retrieve a specific product | โ |
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
POST |
/api/auth/register |
Register a new user | โ |
POST |
/api/auth/login |
Authenticate user and receive JWT | โ |
POST |
/api/auth/security-question |
Retrieve security question | โ |
POST |
/api/auth/verify-security-answer |
Verify security answer | โ |
POST |
/api/auth/reset-password |
Reset password using reset token | โ |
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
GET |
/api/cart |
Retrieve current user's cart | ๐ JWT |
POST |
/api/cart |
Add product to cart | ๐ JWT |
PUT |
/api/cart/:productId |
Update cart item quantity | ๐ JWT |
DELETE |
/api/cart/:productId |
Remove an item from cart | ๐ JWT |
DELETE |
/api/cart |
Clear the current user's cart | ๐ JWT |
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
POST |
/api/orders |
Create order from current cart | ๐ JWT |
GET |
/api/orders |
Retrieve authenticated user's orders | ๐ JWT |
GET |
/api/orders/:id |
Retrieve individual order details | ๐ JWT |
- Zero Hardcoded Secrets โ sensitive configuration is managed through environment variables
- Password Hashing โ passwords and security answers are hashed using
bcryptjs - JWT Authentication โ protected API requests require a valid JWT token
- Route Protection โ cart and order endpoints are protected by authentication middleware
- Git Protection โ
.env, SQLite database files,node_modules, and build artifacts are excluded from version control
The application uses a separate frontend and backend deployment architecture:
GitHub
โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโ
โ โ
โผ โผ
Vercel Render
โ โ
โผ โผ
React Frontend Express Backend
โ โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
API
The React + Vite frontend is deployed on Vercel. ๐ Live Application: Open TechStore
The Node.js + Express backend is deployed on Render. The production frontend communicates with the deployed backend through the configured API URL.
Store screenshots inside a
screenshots/folder in the repository so the images below render correctly on GitHub.
The application was tested across the major user workflows.
Functional Testing
- User registration
- User login
- Password recovery
- Product loading
- Product browsing
- Category filtering
- Product details
- Add to cart
- Update cart quantity
- Remove cart items
- Clear cart
- Checkout
- Order creation
- Order history
- Order details
- Frontend/backend communication
- Production API communication
Responsive Testing
- ๐ฑ Mobile
- ๐ Tablet
- ๐ป Desktop
Deployment Testing
- Frontend availability
- Backend availability
- API communication
- Product loading
- Authentication flow
- Cart functionality
- Checkout functionality
Local Development
โ
โผ
Feature Development
โ
โผ
Local Testing
โ
โผ
Git Commit
โ
โผ
GitHub
โ
โโโโโโโโโโโโโโโโบ Vercel โโโบ Frontend Deploy
โ
โโโโโโโโโโโโโโโโบ Render โโโบ Backend Deploy
This workflow keeps the project version-controlled while supporting deployment of both the frontend and backend.
This project provided practical, hands-on experience with:
- Full-stack web development and component-based architecture
- React 19, Vite configuration, React Router, and the Context API
- Custom React hooks
- REST API development with Express.js
- SQLite integration and database transactions
- JWT authentication, password hashing, and middleware
- CORS and environment variable management
- Git and GitHub workflows
- Responsive web design and production debugging
- Vercel and Render deployment
- Frontend/backend integration
The following are potential enhancements and are not yet implemented:
- ๐ณ Online payment gateway integration
- โค๏ธ Wishlist functionality
- ๐ Advanced product search
- ๐ท๏ธ Advanced filtering and sorting
- โญ Product reviews and ratings
- ๐ค User profile management
- ๐ Admin dashboard
- ๐ Sales analytics
- ๐ฆ Advanced order tracking
- ๐ง Email notifications
- ๐ Order-status notifications
- ๐ผ๏ธ Advanced product image management
- ๐ Internationalization and multiple currencies
- โฟ Further accessibility improvements
Contributions and suggestions are welcome.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature- Make your changes
- Commit your changes:
git commit -m "feat: add your feature"- Push your branch:
git push origin feature/your-feature- Open a Pull Request
This project is licensed under the MIT License. You are free to use, modify, and distribute this project according to the terms of the license.
See the LICENSE file for the complete license text.
YOUR NAME B.E. Information Technology Student
- ๐ GitHub: GITHUB_PROFILE
- ๐ผ LinkedIn: LINKEDIN_PROFILE
CodeAlpha Internship Program โ Task 1: Full Stack E-Commerce Website
This project demonstrates the development, testing, and deployment of a complete full-stack e-commerce application using modern JavaScript technologies.
If you found this project useful or interesting, consider giving the repository a โญ on GitHub.
Built with โค๏ธ using React, Node.js, Express, SQLite and modern web technologies.
CodeAlpha Internship โข Task 1 โข Full Stack Web Development




