A full-stack e-commerce application built with Angular and Node.js/Express, featuring a modern user interface and robustbackend functionality.
This repository contains two main projects:
eStore-angular/
- Frontend application built with AngulareStore-server/
- Backend API server built with Node.js and ExpressFrontend (eStore-angular) Angular 19.1.0 TypeScript 5.7.2 Bootstrap 5.3.3 Font Awesome Icons RxJS 7.8.0 Angular Router Angular Forms Node.js Express 4.21.2 MySQL 3.12.0 JWT Authentication (jsonwebtoken 9.0.2) bcryptjs 3.0.2 CORS support Before you begin, ensure you have the following installed:
Node.js (Latest LTS version recommended) npm (comes with Node.js) MySQL Server Angular CLI (npm install -g @angular/cli
) # Navigate to frontend directorycd eStore-angular# Install dependencies npm install# Start development server npm run start# Navigate to backend directorycd eStore-server# Install dependencies npm install# Create .env file and configure environment variables cp .env.example .env# Start development server nodemon index.jsEnvironment Configuration Frontend Environment Variables Create environment files ineStore-angular/src/environments/
:
// environment.ts export const environment = { production :false , apiUrl :'http://localhost:3000' } ; Backend Environment Variables Create a.env
file ineStore-server/
:
PORT = 3000 DB_HOST = localhost DB_USER = your_username DB_PASSWORD = your_password DB_NAME = estore_db JWT_SECRET = your_jwt_secret Create a MySQL database named 'estore_db' The application will automatically create required tables on first run Initial data can be imported using provided SQL scripts (if any) Responsive user interface using Bootstrap User authentication and authorization Product catalog with search and filter capabilities Shopping cart functionality User profile management Order history and tracking RESTful API endpoints JWT-based authentication MySQL database integration Password encryption CORS enabled Input validation and sanitization POST/api/auth/register
- User registration POST/api/auth/login
- User login GET/api/auth/profile
- Get user profile GET/api/products
- Get all products GET/api/products/:id
- Get product by ID POST/api/products
- Create new product (Admin only) PUT/api/products/:id
- Update product (Admin only) DELETE/api/products/:id
- Delete product (Admin only) GET/api/orders
- Get user orders POST/api/orders
- Create new order GET/api/orders/:id
- Get order details Build the production version: cd eStore-angularng build --configuration productionEnsure all environment variables are properly set Build and start the server: cd eStore-servernodemon index.js