- Prerequisites
- Manual Startup (Step-by-Step)
- Automated Startup - Linux/Mac
- Automated Startup - Windows
- Verification
- Stopping Services
- Troubleshooting
| Software | Version | Purpose |
|---|---|---|
| Java JDK | 17 or higher | Backend services |
| Maven | 3.8+ | Build tool |
| MySQL | 8.0+ | Database |
| Node.js | 16+ | Frontend runtime |
| Angular CLI | Latest | Frontend build tool |
| Git | Latest | Version control |
# Check Java version
java -version
# Expected: openjdk version "17.x.x" or higher
# Check Maven version
mvn -version
# Expected: Apache Maven 3.8.x or higher
# Check MySQL
mysql --version
# Expected: mysql Ver 8.0.x
# Check Node.js
node --version
# Expected: v16.x.x or higher
# Check Angular CLI
ng version
# Expected: Angular CLI: 15.x.x or higherEnsure the following ports are available:
| Port | Service |
|---|---|
| 3306 | MySQL Database |
| 4200 | Angular Frontend |
| 8761 | Discovery Server (Eureka) |
| 8181 | API Gateway |
| 9090 | User Auth Service |
| 8083 | Product Service |
| 8084 | Order Service |
| 8085 | Payment Service |
Check port availability:
# Linux/Mac
netstat -tuln | grep -E ":(3306|4200|8761|8181|9090|8083|8084|8085)"
# Windows
netstat -ano | findstr "3306 4200 8761 8181 9090 8083 8084 8085"# Start MySQL service
sudo service mysql start
# Or using systemctl
sudo systemctl start mysql
# Verify MySQL is running
sudo service mysql status# Start MySQL service
net start MySQL80
# Or using Services GUI
# Press Win+R, type "services.msc", find MySQL80, and start itVerify MySQL Connection:
mysql -u root -p
# Enter your MySQL root password
# If successful, you'll see the MySQL prompt: mysql>
# Type 'exit' to quitNavigate to the backend directory and build all services:
# Navigate to project root
cd /home/labuser/Downloads/Project_OSS
# Navigate to backend directory
cd backend
# Clean and build all services (skip tests for faster build)
mvn clean install -DskipTests
# Wait for build to complete
# Expected output: BUILD SUCCESS
# Total time: ~1-2 minutesExpected Output:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Online Shopping System Parent 0.0.1-SNAPSHOT:
[INFO]
[INFO] Online Shopping System Parent ...................... SUCCESS
[INFO] Shopping Service ................................... SUCCESS
[INFO] Discovery Server ................................... SUCCESS
[INFO] API Gateway ........................................ SUCCESS
[INFO] User Auth Service .................................. SUCCESS
[INFO] Product Service .................................... SUCCESS
[INFO] Order Service ...................................... SUCCESS
[INFO] Payment Service .................................... SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Terminal 1:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Start Discovery Server
java -jar backend/discovery-server/target/discovery-server-0.0.1-SNAPSHOT.jar
# Wait for startup message:
# "Started DiscoveryServerApplication in X.XXX seconds"Verify Eureka is running:
- Open browser: http://localhost:8761
- You should see the Eureka Dashboard
- Keep this terminal running
Terminal 2:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Wait 10-15 seconds after Eureka starts, then start API Gateway
java -jar backend/api-gateway/target/api-gateway-0.0.1-SNAPSHOT.jar
# Wait for startup message:
# "Started ApiGatewayApplication in X.XXX seconds"Verify API Gateway:
- Check Eureka Dashboard: http://localhost:8761
- You should see "API-GATEWAY" registered
- Keep this terminal running
Terminal 3:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Start User Auth Service
java -jar backend/user-auth-service/target/user-auth-service-0.0.1-SNAPSHOT.jar
# Wait for startup message:
# "Started UserAuthServiceApplication in X.XXX seconds"Verify Registration:
- Check Eureka Dashboard: http://localhost:8761
- You should see "USER-AUTH-SERVICE" registered
- Keep this terminal running
Terminal 4:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Start Product Service
java -jar backend/product-service/target/product-service-0.0.1-SNAPSHOT.jar
# Wait for startup message:
# "Started ProductServiceApplication in X.XXX seconds"Verify Registration:
- Check Eureka Dashboard: http://localhost:8761
- You should see "PRODUCT-SERVICE" registered
- Keep this terminal running
Terminal 5:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Start Order Service
java -jar backend/order-service/target/order-service-0.0.1-SNAPSHOT.jar
# Wait for startup message:
# "Started OrderServiceApplication in X.XXX seconds"Verify Registration:
- Check Eureka Dashboard: http://localhost:8761
- You should see "ORDER-SERVICE" registered
- Keep this terminal running
Terminal 6:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Start Payment Service
java -jar backend/payment-service/target/payment-service-0.0.1-SNAPSHOT.jar
# Wait for startup message:
# "Started PaymentServiceApplication in X.XXX seconds"Verify Registration:
- Check Eureka Dashboard: http://localhost:8761
- You should see "PAYMENT-SERVICE" registered
- Keep this terminal running
Terminal 7:
# From project root
cd /home/labuser/Downloads/Project_OSS
# Navigate to frontend directory
cd frontend
# Install dependencies (first time only)
npm install
# Start Angular development server
ng serve
# Wait for compilation:
# "Application bundle generation complete."
# "Local: http://localhost:4200/"Verify Frontend:
- Open browser: http://localhost:4200
- You should see the Online Shopping System homepage
- Keep this terminal running
Total Terminals Required: 7 (or use background processes)
Startup Order:
- MySQL Database
- Discovery Server (Eureka) - Port 8761
- API Gateway - Port 8181
- User Auth Service - Port 9090
- Product Service - Port 8083
- Order Service - Port 8084
- Payment Service - Port 8085
- Frontend (Angular) - Port 4200
Total Startup Time: ~3-5 minutes
The project includes an automated startup script for Linux/Mac systems.
Script Location: /home/labuser/Downloads/Project_OSS/start_all.sh
- ✅ Checks MySQL status before starting
- ✅ Builds all backend services
- ✅ Starts services in correct order
- ✅ Waits for Eureka to be ready
- ✅ Runs services in background
- ✅ Logs output to
logs/directory - ✅ Starts frontend development server
# Navigate to project root
cd /home/labuser/Downloads/Project_OSS
# Make script executable (first time only)
chmod +x start_all.sh
# Run the script
bash start_all.sh1. Check MySQL Status
├─ If running → Continue
└─ If not running → Exit with error message
2. Build Backend Services
├─ Run: mvn clean install -DskipTests
├─ If successful → Continue
└─ If failed → Exit with error message
3. Create logs directory
└─ mkdir -p logs
4. Start Discovery Server
├─ Run in background with nohup
├─ Wait for health check (http://localhost:8761)
└─ Continue when ready
5. Start API Gateway
├─ Run in background with nohup
└─ Wait 10 seconds for registration
6. Start Microservices (Parallel)
├─ User Auth Service
├─ Product Service
├─ Order Service
└─ Payment Service
7. Start Frontend
├─ Check if port 4200 is available
├─ Run: ng serve in background
└─ Output to logs/frontend.log
8. Complete
└─ Display "All services initiated."
Checking MySQL status...
MySQL is running.
Building Backend Services...
[INFO] BUILD SUCCESS
[INFO] Total time: 01:16 min
Starting Discovery Server...
Waiting for Discovery Server to start...
Discovery Server started.
Starting API Gateway...
API Gateway started.
Starting User Auth Service...
Starting Product Service...
Starting Order Service...
Starting Payment Service...
Backend Services Started. Check 'logs/' directory for output.
Starting Frontend...
Frontend starting on port 4200...
All services initiated.All service logs are saved in the logs/ directory:
# View all log files
ls -lh logs/
# View Discovery Server logs
tail -f logs/discovery-server.log
# View API Gateway logs
tail -f logs/api-gateway.log
# View User Auth Service logs
tail -f logs/user-auth-service.log
# View Product Service logs
tail -f logs/product-service.log
# View Order Service logs
tail -f logs/order-service.log
# View Payment Service logs
tail -f logs/payment-service.log
# View Frontend logs
tail -f logs/frontend.log
# View all logs simultaneously
tail -f logs/*.logThe project includes an automated startup script for Windows systems.
Script Location: /home/labuser/Downloads/Project_OSS/start_services.bat
- ✅ Checks MySQL status before starting
- ✅ Builds all backend services
- ✅ Starts services in correct order
- ✅ Waits for Eureka to be ready
- ✅ Runs services in background using
startcommand - ✅ Logs output to
logs\directory - ✅ Starts frontend development server
Option 1: Double-click
- Navigate to project folder in File Explorer
- Double-click
start_services.bat - A command prompt window will open and execute the script
Option 2: Command Prompt
REM Navigate to project root
cd C:\path\to\Project_OSS
REM Run the script
start_services.batOption 3: PowerShell
# Navigate to project root
cd C:\path\to\Project_OSS
# Run the script
.\start_services.bat1. Check MySQL Status
├─ Run: sc query MySQL80
├─ If running → Continue
└─ If not running → Exit with error message
2. Build Backend Services
├─ Run: mvn clean install -DskipTests
├─ If successful → Continue
└─ If failed → Exit with error message
3. Create logs directory
└─ mkdir logs (if not exists)
4. Start Discovery Server
├─ Run in new window: start "Discovery Server" java -jar ...
├─ Wait for health check
└─ Continue when ready
5. Start API Gateway
├─ Run in new window: start "API Gateway" java -jar ...
└─ Wait 10 seconds for registration
6. Start Microservices (Parallel)
├─ User Auth Service (new window)
├─ Product Service (new window)
├─ Order Service (new window)
└─ Payment Service (new window)
7. Start Frontend
├─ Check if port 4200 is available
├─ Run: start "Frontend" ng serve
└─ Output to logs\frontend.log
8. Complete
└─ Display "All services initiated."
Checking MySQL status...
MySQL is running.
Building Backend Services...
[INFO] BUILD SUCCESS
[INFO] Total time: 01:16 min
Starting Discovery Server...
Waiting for Discovery Server to start...
Discovery Server started.
Starting API Gateway...
API Gateway started.
Starting User Auth Service...
Starting Product Service...
Starting Order Service...
Starting Payment Service...
Backend Services Started. Check 'logs\' directory for output.
Starting Frontend...
Frontend starting on port 4200...
All services initiated.
Press any key to continue . . .
All service logs are saved in the logs\ directory:
REM View log files in File Explorer
explorer logs
REM View Discovery Server logs
type logs\discovery-server.log
REM View API Gateway logs
type logs\api-gateway.log
REM View User Auth Service logs
type logs\user-auth-service.log
REM View Product Service logs
type logs\product-service.log
REM View Order Service logs
type logs\order-service.log
REM View Payment Service logs
type logs\payment-service.log
REM View Frontend logs
type logs\frontend.logUsing PowerShell:
# View logs with tail equivalent
Get-Content logs\discovery-server.log -Wait -Tail 50Linux/Mac:
# Check Java processes
ps aux | grep -E "discovery-server|api-gateway|user-auth-service|product-service|order-service|payment-service" | grep -v grep
# Check Node process (Frontend)
ps aux | grep "ng serve" | grep -v grep
# Check listening ports
netstat -tuln | grep -E ":(8761|8181|9090|8083|8084|8085|4200)"Windows:
REM Check Java processes
tasklist | findstr java
REM Check Node process
tasklist | findstr node
REM Check listening ports
netstat -ano | findstr "8761 8181 9090 8083 8084 8085 4200"Eureka Dashboard:
- Open browser: http://localhost:8761
- Check "Instances currently registered with Eureka"
- You should see:
- API-GATEWAY
- USER-AUTH-SERVICE
- PRODUCT-SERVICE
- ORDER-SERVICE
- PAYMENT-SERVICE
# Test API Gateway health
curl http://localhost:8181/actuator/health
# Expected response:
# {"status":"UP"}- Open browser: http://localhost:4200
- You should see the homepage
- Try browsing products
- Try logging in (if you have test users)
Discovery Server:
curl http://localhost:8761
# Should return Eureka dashboard HTMLAPI Gateway:
curl http://localhost:8181/actuator/health
# Should return: {"status":"UP"}Product Service (via Gateway):
curl http://localhost:8181/api/products
# Should return product list JSONUser Auth Service (via Gateway):
curl -X POST http://localhost:8181/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password"}'
# Should return JWT token or 401 if user doesn't existIf you started services manually in separate terminals:
- Press
Ctrl+Cin each terminal window - Stop in reverse order:
- Frontend
- Payment Service
- Order Service
- Product Service
- User Auth Service
- API Gateway
- Discovery Server
- MySQL (optional)
# Kill all Java processes (backend services)
pkill -f "discovery-server|api-gateway|user-auth-service|product-service|order-service|payment-service"
# Kill Angular dev server
pkill -f "ng serve"
# Or kill all Java and Node processes (use with caution)
killall java
killall node
# Stop MySQL (optional)
sudo service mysql stopCreate a stop script (stop_all.sh):
#!/bin/bash
echo "Stopping all services..."
# Stop frontend
pkill -f "ng serve"
echo "Frontend stopped."
# Stop backend services
pkill -f "payment-service"
pkill -f "order-service"
pkill -f "product-service"
pkill -f "user-auth-service"
pkill -f "api-gateway"
pkill -f "discovery-server"
echo "Backend services stopped."
# Clean up log files (optional)
# rm -rf logs/*.log
echo "All services stopped."Create a stop script (stop_services.bat):
@echo off
echo Stopping all services...
REM Stop Java processes
taskkill /F /FI "IMAGENAME eq java.exe"
echo Backend services stopped.
REM Stop Node processes
taskkill /F /FI "IMAGENAME eq node.exe"
echo Frontend stopped.
REM Stop MySQL (optional)
REM net stop MySQL80
echo All services stopped.
pauseRun the stop script:
stop_services.batError:
MySQL is NOT running. Please start it using 'sudo service mysql start'.
Solution:
# Linux/Mac
sudo service mysql start
# Windows
net start MySQL80Error:
[ERROR] Failed to execute goal ... compilation failure
Solutions:
- Check Java version:
java -version(must be 17+) - Clean Maven cache:
mvn clean - Update dependencies:
mvn dependency:resolve - Check for missing files in source directories
Error:
Port 8761 is already in use
Solution:
Linux/Mac:
# Find process using the port
lsof -i :8761
# Kill the process
kill -9 <PID>Windows:
REM Find process using the port
netstat -ano | findstr :8761
REM Kill the process
taskkill /PID <PID> /FSymptoms:
- Service starts but doesn't appear in Eureka dashboard
Solutions:
- Wait 30-60 seconds (registration takes time)
- Check service logs for errors
- Verify Eureka URL in service's
application.properties - Restart the service
Error:
An unhandled exception occurred: Cannot find module '@angular/...'
Solution:
# Delete node_modules and package-lock.json
rm -rf node_modules package-lock.json
# Reinstall dependencies
npm install
# Try starting again
ng serveError:
Could not open JDBC Connection for transaction
Solutions:
- Verify MySQL is running
- Check database credentials in
application.properties - Ensure databases exist:
CREATE DATABASE IF NOT EXISTS user_auth_db; CREATE DATABASE IF NOT EXISTS product_db; CREATE DATABASE IF NOT EXISTS order_db; CREATE DATABASE IF NOT EXISTS payment_db;
Error:
java.lang.OutOfMemoryError: Java heap space
Solution:
# Increase JVM heap size
java -Xmx2g -jar backend/service-name/target/service-name.jarIf a service fails to start, check its log file:
# Linux/Mac
tail -100 logs/service-name.log
# Windows
type logs\service-name.log| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:4200 | Main application |
| Eureka Dashboard | http://localhost:8761 | Service registry |
| API Gateway | http://localhost:8181 | API entry point |
| User Auth Service | http://localhost:9090 | Direct access (dev only) |
| Product Service | http://localhost:8083 | Direct access (dev only) |
| Order Service | http://localhost:8084 | Direct access (dev only) |
| Payment Service | http://localhost:8085 | Direct access (dev only) |
# Build backend
cd backend && mvn clean install -DskipTests
# Start all services (Linux/Mac)
bash start_all.sh
# Start all services (Windows)
start_services.bat
# Check running services
ps aux | grep java
# View logs
tail -f logs/*.log
# Stop all services (Linux/Mac)
pkill -f "java|ng serve"Admin User:
- Email:
admin@example.com - Password:
admin123
Test User:
- Email:
user@example.com - Password:
user123
(Check data seeder classes for actual credentials)
Document Version: 1.0
Last Updated: December 26, 2025
Maintained By: Development Team