Installation Guide¶
This guide will help you set up the Goals Tracker application on your local machine.
Prerequisites¶
Before you begin, ensure you have the following installed:
- Java 17 or higher (Download)
- Node.js 18 or higher (Download)
- Docker and Docker Compose (Download)
- Git (Download)
Optional¶
- Maven 3.6+ (included via Maven Wrapper in the project)
- PostgreSQL 14 (if running without Docker)
Clone the Repository¶
git clone https://github.com/CorentinCLERO/goals-tracker.git
cd goals-tracker
Environment Setup¶
Backend Environment Variables¶
-
Navigate to the backend directory:
cd goals-tracker-back -
Copy the example environment file:
cp .env.example .env -
Edit the
.envfile with your configuration:DATABASE_HOST=localhost DATABASE_PORT=5432 DATABASE_USER=user DATABASE_PASSWORD=password DATABASE_NAME=goals_tracker_db JWT_SECRET=your-secret-key-here JWT_EXPIRATION=86400000
Frontend Environment Variables¶
-
Navigate to the frontend directory:
cd ../goals-tracker-front -
Copy the example environment file:
cp .env.example .env -
Edit the
.envfile:VITE_API_URL=http://localhost:8080/api
Installation Methods¶
Choose one of the following installation methods:
Method 1: Docker Compose (Recommended)¶
This is the easiest way to get started. It will set up all services (backend, frontend, database) automatically.
# From the project root directory
docker compose up --build
The services will be available at: - Frontend: http://localhost:5173 - Backend API: http://localhost:8080 - Swagger UI: http://localhost:8080/swagger-ui.html - PostgreSQL: localhost:5432
To stop the services:
docker compose down
To reset the database (delete all data):
docker compose down -v
Method 2: Local Development (Without Docker)¶
Start PostgreSQL Database¶
You can either use Docker for just the database:
docker compose up db
Or install and configure PostgreSQL locally.
Backend Setup¶
cd goals-tracker-back
# Export environment variables (Linux/Mac)
export $(cat .env | grep -v "#" | xargs)
# For Windows PowerShell
Get-Content .env | ForEach-Object {
if ($_ -match '^([^#].*)=(.*)$') {
Set-Item -Path "env:$($matches[1])" -Value $matches[2]
}
}
# Install dependencies and run
./mvnw clean install
./mvnw spring-boot:run
The backend will start on http://localhost:8080
Frontend Setup¶
cd goals-tracker-front
# Install dependencies
npm install
# Start development server
npm run dev
The frontend will start on http://localhost:5173
Verify Installation¶
-
Check Frontend: Open http://localhost:5173 in your browser
-
Check API Documentation: Open http://localhost:8080/swagger-ui.html in your browser
Troubleshooting¶
Port Already in Use¶
If you get a "port already in use" error:
- Port 8080: Change backend port in
application.propertiesor stop the conflicting service - Port 5173: Change frontend port in
vite.config.tsor stop the conflicting service - Port 5432: Change PostgreSQL port in
docker-compose.ymlor stop the conflicting service
Database Connection Issues¶
- Ensure PostgreSQL is running
- Check database credentials in
.envfiles - Verify the database exists:
goals_tracker_db
Permission Denied (Maven Wrapper)¶
chmod +x mvnw
Docker Issues¶
- Ensure Docker daemon is running
- Check Docker resources (memory, CPU)
- Try:
docker compose down -v && docker compose up --build
Next Steps¶
Once installation is complete, proceed to the Quick Start Guide to learn how to use the application.