- Docker
- Docker Compose
- Make (optional, for Makefile commands)
-
Setup your environment
cp .env-template .env # Edit .env file with your configuration -
Start the services
docker-compose up -d
-
Access the application
- Backend API: http://localhost:8080
The project includes a Makefile to simplify common operations:
- Setup environment:
make setup - Start all services:
make start - View logs:
make logs - Stop services:
make down - Restart services:
make restart - Clean up:
make clean
If you need to run migrations manually:
make migratedocker-compose exec mysql mysql -u${DB_USER} -p${DB_PASSWORD} ${DB_NAME}The .env file contains important configuration:
PORT: Application port (default: 8080)TO_EMAIL: Email address to receive contact form submissionsDB_HOST: MySQL host (default: mysql)DB_PORT: MySQL port (default: 3306)DB_NAME: Database nameDB_USER: Database userDB_PASSWORD: Database passwordDB_ROOT_PASSWORD: MySQL root password
backend/
├── cmd/ # Application entry point
│ ├── main.go
│
├── config/ # Configuration files
│ ├── config.go
│ ├── .env
│ ├── credentials.json
│ ├── token.json
│
├── internal/ # Business logic
│ ├── domain/ # Domain models
│ ├── usecase/ # Use cases
│ ├── repository/ # Data access
│ ├── handler/ # HTTP routing and request handling
│ ├── service/ # External services
│
├── infrastructure/ # Database and middleware setup
│ ├── db.go
│
├── db/ # Migration files
│ ├── migration/
│ ├── 001_create_contacts.sql