Skip to content

Latest commit

Β 

History

History
411 lines (277 loc) Β· 8.03 KB

File metadata and controls

411 lines (277 loc) Β· 8.03 KB

πŸš€ Starting the Servers - Timetable Generator

This guide provides step-by-step instructions for starting both the Frontend and Backend servers for the Bells University Timetable Generator application.


πŸ“‹ Prerequisites

Before starting the servers, ensure you have:

  • βœ… Java JDK installed (v17 or higher, currently using Java 25)
  • βœ… Gradle (included via gradlew wrapper)
  • βœ… Node.js installed (v14.0.0 or higher)
  • βœ… npm installed (comes with Node.js)
  • βœ… MySQL database server running
  • βœ… Database configured and seeded (see Database/seed_data.sql)

🎯 Quick Start (Both Servers)

Option 1: Start Both Servers Simultaneously

Open two separate terminal windows and run:

Terminal 1 - Backend Server (Spring Boot)

cd Backend/untitled2
./gradlew bootRun

Terminal 2 - Frontend Server (React)

cd Timetable-generator
npm start

Option 2: Using PowerShell (Windows)

Run this command from the project root to start both servers:

# Start Backend in new window
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd Backend/untitled2; ./gradlew bootRun"

# Start Frontend in new window
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd Timetable-generator; npm start"

πŸ–₯️ Backend Server (Spring Boot)

Location

Backend/untitled2/

Start Commands

Using Gradle Wrapper (Recommended)

cd Backend/untitled2
./gradlew bootRun          # Windows/Linux/Mac
# OR
gradlew.bat bootRun        # Windows explicitly

Build and Run JAR

cd Backend/untitled2
./gradlew build
java -jar build/libs/untitled2-0.0.1-SNAPSHOT.jar

Clean Build (if needed)

cd Backend/untitled2
./gradlew clean build bootRun

Server Details

  • Framework: Spring Boot 3.5.4
  • Java Version: 25
  • Port: 8080 (default Spring Boot port)
  • URL: http://localhost:8080
  • Database: MySQL (JPA/Hibernate)

Environment Setup

Create an application.properties file in Backend/untitled2/src/main/resources/ with:

# Server Configuration
server.port=8080

# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/timetable_db
spring.datasource.username=your_mysql_user
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.dialect=org.hibernate.dialect.MySQLDialect

# Logging
logging.level.org.springframework=INFO
logging.level.com.example=DEBUG

Verify Backend is Running

Open browser and visit:

http://localhost:8080

You should see the Spring Boot application running (or check specific API endpoints).


🎨 Frontend Server (React)

Location

Timetable-generator/

Start Commands

Development Mode

cd Timetable-generator
npm install          # Install dependencies (first time only)
npm start           # Start development server

Production Build

cd Timetable-generator
npm install          # Install dependencies (first time only)
npm run build       # Create production build

Server Details

  • Port: 3000 (default)
  • URL: http://localhost:3000
  • Auto-opens: Browser opens automatically
  • Hot Reload: Changes auto-refresh

Verify Frontend is Running

The browser should automatically open to:

http://localhost:3000

You should see the login page.


πŸ” Troubleshooting

Backend Issues

Port Already in Use (8080)

# Windows - Kill process on port 8080
netstat -ano | findstr :8080
taskkill /PID <PID> /F

Database Connection Failed

  • βœ… Check MySQL is running
  • βœ… Verify application.properties credentials
  • βœ… Ensure database exists: timetable_db
  • βœ… Check if data is seeded

Gradle Build Failed

cd Backend/untitled2
./gradlew clean
./gradlew build --refresh-dependencies

Gradle Daemon File Lock Issue ("Address already in use")

If you see an error like FileLockContentionHandler ... Address already in use, it means a Gradle daemon process is stuck.

Fix: Stop all Gradle values before restarting:

cd Backend/untitled2
./gradlew --stop
./gradlew bootRun

Java Version Issues

# Check Java version
java -version

# Should be Java 17 or higher (currently using Java 25)

Frontend Issues

Port Already in Use (3000)

# Windows - Kill process on port 3000
netstat -ano | findstr :3000
taskkill /PID <PID> /F

Compilation Errors

cd Timetable-generator
rm -rf node_modules package-lock.json
npm install
npm start

API Connection Failed

  • βœ… Ensure backend is running on port 8080
  • βœ… Check CORS settings in Spring Boot backend
  • βœ… Verify API endpoints in frontend code

πŸ“Š Server Status Check

Check if Servers are Running

Backend (Spring Boot)

# Windows PowerShell
Test-NetConnection -ComputerName localhost -Port 8080

Frontend (React)

# Windows PowerShell
Test-NetConnection -ComputerName localhost -Port 3000

View Running Processes

# Windows - View Java processes
tasklist | findstr java

# Windows - View Node processes
tasklist | findstr node

πŸ›‘ Stopping the Servers

Stop Individual Server

In the terminal running the server, press:

Ctrl + C

Stop All Java Processes (Windows)

# ⚠️ WARNING: This stops ALL Java processes
taskkill /F /IM java.exe

Stop All Node Processes (Windows)

# ⚠️ WARNING: This stops ALL Node.js processes
taskkill /F /IM node.exe

πŸ“± Access Points

Once both servers are running:

Service URL Purpose
Frontend http://localhost:3000 Main application UI
Backend API http://localhost:8080 REST API endpoints
Login Page http://localhost:3000/login Authentication
Dashboard http://localhost:3000/dashboard Main dashboard

πŸ” Default Login Credentials

For testing purposes (check with your admin for current credentials):

Username: admin
Password: admin123

πŸ“ Development Workflow

Recommended Startup Order

  1. Start Database (MySQL)
  2. Start Backend (Spring Boot on port 8080)
  3. Start Frontend (React on port 3000)
  4. Open Browser (http://localhost:3000)

Daily Development

# Morning startup
cd Backend/untitled2 && ./gradlew bootRun    # Terminal 1
cd Timetable-generator && npm start          # Terminal 2

# Make changes to code
# Frontend auto-reloads on save
# Backend needs restart for changes (or use Spring DevTools)

# End of day
# Press Ctrl+C in both terminals

πŸš€ Production Deployment

For production deployment, see:

  • QUICK_START_DEPLOYMENT.md - Deployment guide
  • EXECUTIVE_SUMMARY.md - System overview

πŸ“ž Need Help?

Documentation

  • Frontend Guide: FRONTEND_IMPLEMENTATION_GUIDE.md
  • Login Guide: LOGIN_IMPLEMENTATION_GUIDE.md
  • Quick Reference: FRONTEND_QUICK_REFERENCE.md
  • Database Setup: Database/CONVERSION_SUMMARY.md

Common Issues

  • Compilation Fixes: COMPILATION_FIXES.md
  • Verification: FINAL_VERIFICATION_CHECKLIST.md

βœ… Success Checklist

Before you start working, ensure:

  • MySQL database is running
  • Backend server started successfully (port 8080)
  • Frontend server started successfully (port 3000)
  • Login page loads at http://localhost:3000
  • No console errors in browser (F12)
  • Backend API responds

πŸŽ‰ You're Ready!

Both servers should now be running. Happy coding! πŸš€

Commands Summary:

# Backend (Spring Boot)
cd Backend/untitled2 && ./gradlew bootRun

# Frontend (React)
cd Timetable-generator && npm start

Last Updated: January 24, 2026
Status: βœ… Production Ready