Quick Start Guide
Get Med Agenda running locally in under 5 minutes using Docker Compose. This guide will walk you through setting up the complete application stack including the backend API, frontend, and database.This quick start is designed for development and testing. For production deployment, see the Deployment Guide.
Prerequisites
Before you begin, ensure you have the following installed on your system:Docker & Docker Compose
Docker Engine 20.10+ and Docker Compose V2+
Download Docker Desktop from docker.com for Windows and Mac, or install Docker Engine for Linux.
Installation
Clone the Repository
Clone the Med Agenda repository from GitHub:This will download the complete source code including both backend and frontend applications.
Configure Environment Variables
Create a Edit the
.env file in the backend directory with your configuration:.env file with your settings:Get a Free PostgreSQL Database
- Sign up at Neon.tech
- Create a new project
- Copy the connection string
- Update
SPRING_DATASOURCE_URLin your.envfile
Get Email Service API Key
- Sign up at Resend.com
- Create an API key
- Update
RESEND_API_KEYin your.envfile
The email service is optional for testing. The application will work without it, but appointment confirmation emails won’t be sent.
Build and Run with Docker Compose
Build and start the application using Docker Compose:This command will:
- Build the Spring Boot backend application
- Create a Docker image named
med-agenda:latest - Start the API server on port 8080
- Load environment variables from
.env
The first build may take 5-10 minutes as Maven downloads dependencies. Subsequent builds will be much faster thanks to Docker layer caching.
Run in Detached Mode
To run the containers in the background:View Logs
Start the Frontend
In a new terminal, navigate to the frontend directory and start the development server:The frontend will be available at
http://localhost:5173Make sure you have Node.js 18+ and npm installed. Check with
node --version and npm --version.First Steps
Now that Med Agenda is running, let’s set up your first users and test the system.Create an Admin Account
Create an administrator account to manage the system:Save the returned admin ID for future reference.
Register a Doctor
Add a doctor to the system:
The CRM is the Brazilian medical license number. Use any 9-digit number for testing.
Register a Patient
Create a patient account:
CPF is the Brazilian national ID. Use any 11-digit number for testing.
Schedule a Consultation
Book your first appointment:The patient will receive an email confirmation (if Resend is configured).
API Testing
Explore the REST API with these common operations:List All Consultations
Get Patient History
Search Doctors by Specialty
Create a Diagnosis
Complete API Reference
Explore all available API endpoints with detailed documentation
Stopping the Application
To stop the running containers:Ctrl+C in the terminal.
Troubleshooting
Port 8080 already in use
Port 8080 already in use
If port 8080 is already occupied, you can change it in two ways:
- Modify docker-compose.yml:
- Set in .env file:
Database connection failed
Database connection failed
Ensure your database credentials are correct in the Common issues:
.env file:- Incorrect hostname or port
- Wrong username/password
- Database doesn’t exist (create it first)
- Firewall blocking connections
Email notifications not working
Email notifications not working
Email functionality requires a valid Resend API key:
- Verify your API key at Resend Dashboard
- Ensure
RESEND_API_KEYis set in.env - Check application logs for email errors
Frontend can't connect to backend
Frontend can't connect to backend
Ensure the API URL is correctly configured in the frontend:Check Also verify CORS is enabled in the backend (it should be by default).
frontend/src/api/config.ts or similar configuration file:Docker build fails
Docker build fails
Common solutions:
- Clear Docker cache:
- Check disk space:
- Verify Java and Maven in the Dockerfile
Next Steps
Now that you have Med Agenda running, explore these resources:Features Overview
Learn about all available features
API Documentation
Complete REST API reference
User Guides
Detailed guides for patients and doctors
Production Deployment
Deploy Med Agenda to production