AureumPicks is a premium e-commerce platform that provides a seamless shopping experience with modern authentication, beautiful UI/UX, and robust backend architecture. Built with enterprise-grade technologies and best practices.
- π Secure Authentication - JWT-based auth with email OTP verification
- π§ Professional Email Templates - Beautiful, branded email communications
- π¨ Premium UI/UX - Luxury brand-inspired design with dark/light themes
- π Production Ready - Deployed on Railway with environment-based configuration
- π± Responsive Design - Works flawlessly on all devices
- β‘ High Performance - Optimized database queries and caching
- User Registration with Email Verification (OTP)
- Secure Login with JWT Token Authentication
- Password Reset with OTP Verification
- BCrypt Password Encryption
- Protected API Endpoints with Spring Security
- CORS Configuration for Frontend Integration
- Product Catalog with Advanced Filtering
- Shopping Cart Management
- Real-time Cart Updates
- Product Detail Views with Reviews
- Category-based Product Navigation
- Search Functionality
- Day/Night Theme Toggle
- Premium Design Inspired by Luxury Brands
- Smooth Animations and Transitions
- Mobile-Responsive Layout
- Professional Email Templates with Brevo Integration
- Welcome emails with OTP verification
- Password reset emails
- Professional HTML templates with golden gradient design
- Branded footer and headers
- Mobile-responsive email design
| Technology | Version | Purpose |
|---|---|---|
| Spring Boot | 4.0.1 | Main Framework |
| Spring Security | 7.0.2 | Authentication & Authorization |
| Spring Data JPA | 4.0.1 | Database ORM |
| Hibernate | 7.2.0 | ORM Implementation |
| MySQL | 8.0+ | Database |
| JWT (jjwt) | 0.12.3 | Token-based Authentication |
| Brevo API | Latest | Email Service |
| OkHttp | 4.12.0 | HTTP Client for Brevo |
| Lombok | Latest | Reduce Boilerplate Code |
| Maven | 3.6+ | Build Tool |
| Technology | Purpose |
|---|---|
| HTML5 | Structure |
| CSS3 | Styling with Custom Design System |
| JavaScript (Vanilla) | Dynamic Functionality |
| Fetch API | REST API Communication |
| Tool | Purpose |
|---|---|
| Railway | Cloud Hosting Platform |
| GitHub | Version Control |
| Git | Source Control |
| Railway PostgreSQL | Production Database |
aureumpicks-ecommerce/
β
βββ src/
β βββ main/
β β βββ java/com/aureumpicks/ecommerce/
β β β βββ config/ # Security & JWT Configuration
β β β β βββ SecurityConfig.java
β β β β βββ JwtAuthenticationFilter.java
β β β β βββ CorsConfig.java
β β β β
β β β βββ controller/ # REST API Controllers
β β β β βββ AuthController.java
β β β β βββ ProductController.java
β β β β βββ CartController.java
β β β β
β β β βββ dto/ # Data Transfer Objects
β β β β βββ SignupRequest.java
β β β β βββ LoginRequest.java
β β β β βββ VerifyEmailRequest.java
β β β β βββ ForgotPasswordRequest.java
β β β β βββ ResetPasswordRequest.java
β β β β βββ AuthResponse.java
β β β β βββ MessageResponse.java
β β β β βββ CartRequest.java
β β β β βββ CartResponse.java
β β β β
β β β βββ model/ # JPA Entity Classes
β β β β βββ User.java
β β β β βββ Product.java
β β β β βββ Cart.java
β β β β
β β β βββ repository/ # JPA Repositories
β β β β βββ UserRepository.java
β β β β βββ ProductRepository.java
β β β β βββ CartRepository.java
β β β β
β β β βββ service/ # Business Logic Layer
β β β β βββ UserService.java
β β β β βββ AuthService.java
β β β β βββ EmailService.java
β β β β βββ ProductService.java
β β β β βββ CartService.java
β β β β
β β β βββ util/ # Utility Classes
β β β β βββ JwtUtil.java
β β β β βββ OtpUtil.java
β β β β
β β β βββ AureumPicksApplication.java
β β β
β β βββ resources/
β β βββ application.properties
β β βββ static/
β β βββ index.html # Frontend Application
β β
β βββ test/ # Unit Tests
β
βββ pom.xml # Maven Dependencies
βββ .gitignore
βββ README.md
-- Users Table
CREATE TABLE users (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
is_verified BIT(1) DEFAULT 0,
otp VARCHAR(6),
otp_expiry DATETIME,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Products Table
CREATE TABLE products (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10, 2) NOT NULL,
stock INT DEFAULT 0,
category VARCHAR(100) DEFAULT 'Electronics',
image_url VARCHAR(500),
rating DECIMAL(2, 1) DEFAULT 0.0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- Carts Table
CREATE TABLE carts (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
user_id BIGINT NOT NULL,
product_id BIGINT NOT NULL,
quantity INT DEFAULT 1,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE CASCADE,
UNIQUE KEY unique_user_product (user_id, product_id)
);Before you begin, ensure you have the following installed:
- Java JDK 17+ - Download
- Maven 3.6+ - Download
- MySQL 8.0+ - Download
- Git - Download
- Brevo Account - Sign up
git clone https://github.com/Sumeet-Y1/ecommerce-fullstack.git
cd ecommerce-fullstackCREATE DATABASE aureumpicks_db;
USE aureumpicks_db;Run the SQL script to create tables:
-- Run the schema from Database Schema section aboveOr let Spring Boot auto-create tables by setting spring.jpa.hibernate.ddl-auto=update in application.properties.
Create src/main/resources/application.properties:
# ===============================
# SERVER CONFIGURATION
# ===============================
server.port=8080
# ===============================
# DATABASE CONFIGURATION
# ===============================
spring.datasource.url=jdbc:mysql://localhost:3306/aureumpicks_db
spring.datasource.username=root
spring.datasource.password=YOUR_MYSQL_PASSWORD
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# ===============================
# JPA/HIBERNATE CONFIGURATION
# ===============================
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
# ===============================
# JWT CONFIGURATION
# ===============================
jwt.secret=AureumPicksSecureSecretKeyMinimum32CharactersLongForProductionUse2024
jwt.expiration=86400000
# ===============================
# BREVO EMAIL CONFIGURATION
# ===============================
brevo.api.key=YOUR_BREVO_API_KEY
spring.mail.username=noreply.aureumpicks@gmail.com
# ===============================
# APPLICATION CONFIGURATION
# ===============================
app.name=AureumPicks- Sign up at Brevo
- Go to Settings β SMTP & API β API Keys
- Generate new API key
- Copy and paste in
application.properties - Verify sender email in Brevo Dashboard β Senders
mvn clean installmvn spring-boot:runThe application will start at http://localhost:8080
Open your browser and navigate to:
http://localhost:8080
For Railway or other cloud deployments, use environment variables:
# Database
DATABASE_URL=jdbc:mysql://host:port/database
DB_USERNAME=your_username
DB_PASSWORD=your_password
# JWT
JWT_SECRET=your-super-secure-jwt-secret-key-minimum-32-characters
JWT_EXPIRATION=86400000
# Brevo Email
BREVO_API_KEY=xkeysib-your-api-key
SPRING_MAIL_USERNAME=noreply.aureumpicks@gmail.com
# Application
APP_NAME=AureumPicksspring.datasource.url=${DATABASE_URL}
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
jwt.secret=${JWT_SECRET}
jwt.expiration=${JWT_EXPIRATION}
brevo.api.key=${BREVO_API_KEY}
spring.mail.username=${SPRING_MAIL_USERNAME}
app.name=${APP_NAME}Local: http://localhost:8080/api
Production: https://your-app.railway.app/api
POST /api/auth/signup
Content-Type: application/json
{
"email": "user@example.com",
"password": "securepassword123"
}
Response: 201 Created
{
"message": "Signup successful! Please check your email for OTP verification."
}POST /api/auth/verify-email
Content-Type: application/json
{
"email": "user@example.com",
"otp": "123456"
}
Response: 200 OK
{
"message": "Email verified successfully! You can now login."
}POST /api/auth/resend-otp
Content-Type: application/json
{
"email": "user@example.com"
}
Response: 200 OK
{
"message": "OTP resent successfully! Please check your email."
}POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "securepassword123"
}
Response: 200 OK
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"email": "user@example.com",
"message": "Login successful!"
}POST /api/auth/forgot-password
Content-Type: application/json
{
"email": "user@example.com"
}
Response: 200 OK
{
"message": "Password reset OTP sent to your email."
}POST /api/auth/reset-password
Content-Type: application/json
{
"email": "user@example.com",
"otp": "123456",
"newPassword": "newsecurepassword123"
}
Response: 200 OK
{
"message": "Password reset successful! You can now login with your new password."
}GET /api/products/all
Authorization: Bearer {your-jwt-token}
Response: 200 OK
[
{
"id": 1,
"name": "Asus TUF F16",
"description": "High performance gaming laptop",
"price": 89999.00,
"stock": 15,
"category": "Laptops",
"imageUrl": "https://...",
"rating": 4.5
}
]GET /api/products/{id}
Authorization: Bearer {your-jwt-token}
Response: 200 OK
{
"id": 1,
"name": "Asus TUF F16",
"description": "High performance gaming laptop",
"price": 89999.00,
"stock": 15,
"category": "Laptops",
"imageUrl": "https://...",
"rating": 4.5
}GET /api/products/category/{category}
Authorization: Bearer {your-jwt-token}
Response: 200 OK
[...]GET /api/products/search?name={productName}
Authorization: Bearer {your-jwt-token}
Response: 200 OK
[...]GET /api/cart
Authorization: Bearer {your-jwt-token}
Response: 200 OK
[
{
"id": 1,
"productId": 1,
"productName": "Asus TUF F16",
"productImage": "https://...",
"productPrice": 89999.00,
"quantity": 2,
"totalPrice": 179998.00
}
]POST /api/cart/add
Authorization: Bearer {your-jwt-token}
Content-Type: application/json
{
"productId": 1,
"quantity": 2
}
Response: 201 Created
{
"id": 1,
"productId": 1,
"productName": "Asus TUF F16",
"productImage": "https://...",
"productPrice": 89999.00,
"quantity": 2,
"totalPrice": 179998.00
}PUT /api/cart/update/{cartId}?quantity={newQuantity}
Authorization: Bearer {your-jwt-token}
Response: 200 OK
{...}DELETE /api/cart/remove/{cartId}
Authorization: Bearer {your-jwt-token}
Response: 200 OK
{
"message": "Item removed from cart"
}DELETE /api/cart/clear
Authorization: Bearer {your-jwt-token}
Response: 200 OK
{
"message": "Cart cleared successfully"
}- GitHub account
- Railway account (Sign up)
- Push your code to GitHub
- Go to Railway.app
- Click New Project
- Select Deploy from GitHub repo
- Choose your repository
- Railway will auto-detect Spring Boot
- In your Railway project, click + New
- Select Database β MySQL
- Railway will provision a MySQL database
Go to your service β Variables tab:
# Database (Auto-configured by Railway MySQL)
SPRING_DATASOURCE_URL=${DATABASE_URL}
SPRING_DATASOURCE_USERNAME=${MYSQLUSER}
SPRING_DATASOURCE_PASSWORD=${MYSQLPASSWORD}
# JWT
JWT_SECRET=AureumPicksSecureSecretKeyMinimum32CharactersLongForProductionUse2024
JWT_EXPIRATION=86400000
# Brevo
BREVO_API_KEY=xkeysib-your-brevo-api-key
SPRING_MAIL_USERNAME=noreply.aureumpicks@gmail.com
# App
APP_NAME=AureumPicksRailway will automatically deploy your application. You'll get a URL like:
https://your-app-name.railway.app
Visit your Railway URL and test:
- User signup
- Email OTP verification
- Login
- Product browsing
- Cart functionality
mvn testmvn jacoco:report- User Registration
- Email OTP Verification
- Login with JWT
- Forgot Password
- Password Reset
- Browse Products
- Add to Cart
- Update Cart Quantity
- Remove from Cart
- Logout
- β Verify Brevo API key is correct
- β Check sender email is verified in Brevo
- β Review Railway logs for email errors
- β Verify MySQL is running
- β Check database credentials
- β
Ensure database
aureumpicks_dbexists
- β Ensure JWT secret is at least 32 characters
- β Check token expiration settings
- β Clear browser localStorage and login again
- β
Check CORS configuration in
CorsConfig.java - β Verify frontend URL is whitelisted
Sumeet Yadav
- GitHub: @Sumeet-Y1
- Email: sumeety202@gmail.com
- LinkedIn: linkedin.com/in/sumeet-backenddev
- Portfolio:sumeetyadav-dev.netlify.app
- Spring Boot Documentation
- Brevo API Documentation
- JWT.io for JWT documentation
- Railway Documentation
If you have any questions or need help, feel free to:
- Open an Issue
- Email: sumeety202@gmail.com
- Star β this repository if you find it helpful!
Made with β€οΈ by Sumeet Yadav
#SpringBoot #Ecommerce #JWT #MySQL #Railway #Brevo