Skip to main content
Get your ADMA URL Shortener development environment running in 3 simple steps using Docker Compose.

Prerequisites

Before you begin, ensure you have:
  • Docker Desktop (or Docker Engine + Docker Compose)
  • Git
  • 4GB+ RAM available
This guide uses Docker Compose to run PostgreSQL, the Spring Boot backend, and the React frontend together. No manual setup required!

Steps

1

Clone the repository

Clone the ADMA source repository to your local machine:
git clone <repository-url>
cd adma-sa2-sa3
2

Start the stack

Build and launch all services with a single command:
docker compose up --build
This will:
  • Start PostgreSQL 16 on port 5432
  • Build and start the Spring Boot backend on port 8080
  • Build and start the React frontend (Nginx) on port 80
Use -d flag to run in background: docker compose up -d --build
Wait for the logs to show all services are healthy (typically 1-2 minutes for first build).
3

Access the application

Open your browser and navigate to:You should see the URL shortener interface and be able to create short links immediately!

Verify Installation

Test the API directly with curl:
curl http://localhost:8080/api/stats

Common Commands

View logs in real-time
docker compose logs -f backend
Check service status
docker compose ps
Stop all services
docker compose down
Reset database (delete all data)
docker compose down -v
docker compose up -d --build
The -v flag in docker compose down -v will permanently delete all database data stored in the PostgreSQL volume.

What’s Running?

The Docker Compose stack creates three services:
ServicePortDescription
frontend80React SPA served by Nginx
backend8080Spring Boot 3.4.2 REST API
postgres5432PostgreSQL 16 database

Default Credentials

These are development defaults from docker-compose.yml. Never use these in production!
  • PostgreSQL User: postgres
  • PostgreSQL Password: changeme
  • Database Name: urlshortener
  • JWT Secret: changeme-this-must-be-at-least-32-chars-long!!

Next Steps

Local Development

Learn about environment variables, debugging, and hot reload

API Reference

Explore all available endpoints and authentication

Troubleshooting

If port 80 is already taken, edit docker-compose.yml and change the frontend port mapping:
frontend:
  ports:
    - "3000:80"  # Access at http://localhost:3000 instead
Ensure PostgreSQL is healthy before the backend starts. Check logs:
docker compose logs postgres
If needed, restart services:
docker compose restart postgres backend
The frontend is trying to reach the backend at http://localhost:8080. Verify:
  1. Backend is running: docker compose ps
  2. Backend is accessible: curl http://localhost:8080/api/stats
  3. CORS is configured correctly (default allows localhost origins)

Build docs developers (and LLMs) love