A full-stack e-commerce application built with Spring Boot and Angular, featuring JWT authentication, role-based access control, and MongoDB integration.
Clean and modern login interface with JWT authentication
User registration form with validation
Product grid with search, filtering, and add-to-cart functionality
Detailed product view with specifications and reviews
Cart management with quantity controls and checkout
Complete checkout flow with shipping information, payment options, and order placement
Order history with status tracking and cancellation functionality
Complete user profile management with profile picture upload, personal information editing, and account statistics
Real-time notifications with mark as read functionality
Product category browsing with filtering
- Framework: Spring Boot 3.2.0
- Database: MongoDB
- Authentication: JWT with Spring Security
- Build Tool: Maven
- Java Version: 18
- Framework: Angular 17
- UI Library: Angular Material
- Styling: CSS
- HTTP Client: Angular HttpClient
- State Management: RxJS
- User registration and login
- JWT-based authentication
- Role-based access control (USER, ADMIN)
- Protected routes and API endpoints
- Browse products with pagination
- Search products by name
- Filter products by category
- Product CRUD operations (admin only)
- View product categories
- Category CRUD operations (admin only)
- Create orders from cart items
- View order history
- Track order status (PENDING, CONFIRMED, SHIPPED, DELIVERED, CANCELLED)
- Order cancellation (PENDING orders only)
- Order management (admin only)
- Responsive Material Design
- Modern, clean interface
- Mobile-friendly layout
- Intuitive navigation
- User profile management
- Profile picture upload with MongoDB storage
- Personal information editing
- Account statistics
E-commerce app/
βββ backend/
β βββ src/main/java/com/ecommerce/
β β βββ controller/ # REST API controllers
β β βββ service/ # Business logic
β β βββ repository/ # Data access layer
β β βββ model/ # Entity classes
β β βββ dto/ # Data transfer objects
β β βββ security/ # Security configuration
β β βββ config/ # Application configuration
β βββ src/main/resources/
β βββ pom.xml
βββ frontend/
β βββ src/app/
β β βββ components/ # Angular components
β β βββ services/ # HTTP services
β β βββ models/ # TypeScript interfaces
β β βββ guards/ # Route guards
β β βββ material.module.ts
β βββ src/assets/
β βββ package.json
βββ README.md
- Java 17+
- Maven 3.6+
- Node.js 16+
- MongoDB
- Angular CLI 17+
-
Clone the repository (if applicable)
-
Backend Setup:
cd backend mvn clean install mvn spring-boot:runThe backend will start on
http://localhost:8080 -
Frontend Setup:
cd frontend npm install ng serveThe frontend will start on
http://localhost:4200 -
Database Setup:
- Ensure MongoDB is running on
localhost:27017 - The application will automatically create the
ecommerce_dbdatabase - Sample data will be populated on first startup
- Ensure MongoDB is running on
POST /api/auth/signin- User loginPOST /api/auth/signup- User registration
GET /api/products- Get all productsGET /api/products/{id}- Get product by IDGET /api/products/search?keyword={keyword}- Search productsPOST /api/products- Create product (admin only)PUT /api/products/{id}- Update product (admin only)DELETE /api/products/{id}- Delete product (admin only)
GET /api/categories- Get all categoriesGET /api/categories/{id}- Get category by IDPOST /api/categories- Create category (admin only)PUT /api/categories/{id}- Update category (admin only)DELETE /api/categories/{id}- Delete category (admin only)
GET /api/orders- Get all orders (admin only)GET /api/orders/my-orders- Get current user's ordersGET /api/orders/{id}- Get order by IDPOST /api/orders- Create orderPUT /api/orders/{id}/status- Update order status (admin only)DELETE /api/orders/{id}- Delete order (admin only)
The application automatically initializes with:
- Roles: USER, ADMIN
- Categories: Electronics, Clothing, Books
- Sample Products: Various products in each category
- JWT tokens with configurable expiration
- Password encryption with BCrypt
- CORS configuration for frontend-backend communication
- Role-based method-level security
- Input validation and sanitization
- Uses Spring Data MongoDB for database operations
- Implements RESTful API design principles
- Includes comprehensive error handling
- Follows layered architecture pattern
- Component-based architecture
- Reactive programming with RxJS
- Lazy loading for better performance
- Material Design components for consistent UI
- Shopping cart functionality
- Payment integration
- Product reviews and ratings
- Advanced search and filtering
- Admin dashboard
- Email notifications
- Image upload functionality
- Profile updates
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request