A complete fullstack e-commerce web application built with Java Spring Boot, Node.js, React, and MySQL.
-
Java Spring Boot (Port 8080) - Main REST API
- Spring Data JPA
- Spring Security
- MySQL Database
- JWT Authentication
-
Node.js + Express (Port 5000) - Additional Services
- Payment Processing (Stripe)
- Analytics API
- MySQL Integration
- React (Port 3000)
- React Router
- Axios for API calls
- Modern responsive UI
- MySQL - Relational database for all data storage
ecommerce-fullstack/
├── backend-springboot/ # Java Spring Boot backend
│ ├── src/
│ │ └── main/
│ │ ├── java/com/ecommerce/
│ │ │ ├── model/ # Entity classes
│ │ │ ├── repository/ # Data access layer
│ │ │ ├── service/ # Business logic
│ │ │ ├── controller/ # REST endpoints
│ │ │ └── config/ # Configuration
│ │ └── resources/
│ │ └── application.properties
│ └── pom.xml
│
├── backend-nodejs/ # Node.js Express backend
│ ├── config/ # Database configuration
│ ├── routes/ # API routes
│ ├── server.js # Main server file
│ ├── package.json
│ └── .env
│
├── frontend-react/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── App.js
│ │ └── index.js
│ ├── package.json
│ └── .env
│
└── database/ # Database schema and setup
├── schema.sql
└── README.md
- Java 17 or higher
- Node.js 16+ and npm
- MySQL 8.0+
- Maven
- Git
- Install and start MySQL server
- Create the database and tables:
cd database mysql -u root -p < schema.sql
-
Navigate to the Spring Boot directory:
cd backend-springboot -
Update database credentials in
src/main/resources/application.properties:spring.datasource.username=your_mysql_username spring.datasource.password=your_mysql_password
-
Build and run the application:
mvn clean install mvn spring-boot:run
The Spring Boot API will run on
http://localhost:8080
-
Navigate to the Node.js directory:
cd backend-nodejs -
Install dependencies:
npm install
-
Update
.envfile with your credentials:DB_USER=your_mysql_username DB_PASSWORD=your_mysql_password STRIPE_SECRET_KEY=your_stripe_key (optional) -
Start the server:
npm start
Or for development with auto-reload:
npm run dev
The Node.js API will run on
http://localhost:5000
-
Navigate to the React directory:
cd frontend-react -
Install dependencies:
npm install
-
Update
.envfile if needed (default values should work):REACT_APP_API_URL=http://localhost:8080/api REACT_APP_NODE_API_URL=http://localhost:5000/api -
Start the development server:
npm start
The React app will run on
http://localhost:3000
- ✅ User registration and login
- ✅ Browse products with search and category filters
- ✅ View product details
- ✅ Add products to shopping cart
- ✅ Update cart quantities
- ✅ Checkout process
- ✅ Order history
- ✅ User profile management
- ✅ Product management (CRUD)
- ✅ Order management
- ✅ User management
- ✅ Sales analytics
- ✅ Inventory tracking
GET /api/products- Get all active productsGET /api/products/{id}- Get product by IDGET /api/products/category/{category}- Get products by categoryGET /api/products/search?keyword={keyword}- Search productsPOST /api/products- Create new productPUT /api/products/{id}- Update productDELETE /api/products/{id}- Delete product
GET /api/users- Get all usersGET /api/users/{id}- Get user by IDPOST /api/users/register- Register new userPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
GET /api/orders- Get all ordersGET /api/orders/{id}- Get order by IDGET /api/orders/user/{userId}- Get orders by userPOST /api/orders/user/{userId}- Create new orderPATCH /api/orders/{id}/status- Update order statusDELETE /api/orders/{id}- Delete order
POST /api/payments/create-payment-intent- Create payment intentPOST /api/payments/process- Process paymentGET /api/payments/verify/{paymentIntentId}- Verify payment
GET /api/analytics/sales- Get sales analyticsGET /api/analytics/top-products- Get top-selling productsGET /api/analytics/order-stats- Get order statisticsGET /api/analytics/customers- Get customer analytics
- Email:
admin@ecommerce.com - Password:
admin123
- Email:
customer@example.com - Password:
customer123
- users - Customer and admin information
- products - Product catalog
- orders - Customer orders
- order_items - Individual items in orders
- Responsive design for mobile and desktop
- Modern and clean interface
- Shopping cart with real-time updates
- Product search and filtering
- Order tracking
- User authentication flow
- Payment gateway integration (Stripe/PayPal)
- Product reviews and ratings
- Wishlist functionality
- Email notifications
- Admin dashboard
- Real-time inventory updates
- Promotional codes and discounts
This project is for educational purposes.
To run all services simultaneously:
- Terminal 1 - MySQL: Ensure MySQL is running
- Terminal 2 - Spring Boot:
cd backend-springboot && mvn spring-boot:run - Terminal 3 - Node.js:
cd backend-nodejs && npm start - Terminal 4 - React:
cd frontend-react && npm start
Visit http://localhost:3000 to access the application.
If you get port errors, ensure no other services are running on:
- 3000 (React)
- 5000 (Node.js)
- 8080 (Spring Boot)
- 3306 (MySQL)
- Verify MySQL is running
- Check credentials in application.properties and .env files
- Ensure the database
ecommerce_dbexists
- Ensure both backends have CORS enabled for
http://localhost:3000 - Check the SecurityConfig in Spring Boot and cors settings in Node.js
For issues or questions, please create an issue in the repository.
Happy Coding! 🚀