APAC Backend is a RESTful API built with Go, providing authentication, user management, AI-powered trip planning (Gemini), and integration with PostgreSQL, Redis, Supabase, and Google OAuth.
- Authentication: Register, login, OTP verification, Google OAuth, refresh token, logout.
- User Management: User profile, edit profile (including photo upload to Supabase), user preferences.
- Trip Planner: Generate travel itineraries using Gemini AI, save and manage trip history.
- Integrations: PostgreSQL (main database), Redis (OTP & state), Supabase (media storage), Google OAuth, Email (Gmail SMTP).
- Middleware: JWT authentication.
- Monitoring:
/metricsendpoint for application monitoring.
.
├── cmd/
│ └── api/
│ └── main.go
├── internal/
│ ├── app/
│ ├── bootstrap/
│ ├── domain/
│ ├── infra/
│ └── middleware/
├── resource/
│ └── schema.json
├── Dockerfile
├── compose.yaml
├── Makefile
├── go.mod
├── .env
└── init.sql
- Copy the
.envfile and fill in the required variables (see.envfor reference). - Make sure to provide credentials for the database, Redis, Supabase, Google OAuth, and Email.
make runor manually:
docker compose up --buildPOST /api/v1/auth/register- Register a new userPOST /api/v1/auth/verify-otp- Verify OTPPOST /api/v1/auth/login- User loginGET /api/v1/auth/google- Google OAuth loginGET /api/v1/user/profile- Get user profile (JWT required)PATCH /api/v1/user/profile- Edit user profile (JWT required)POST /api/v1/user/preferences- Update user preferences (JWT required)POST /api/v1/gemini- Generate trip itinerary with AI (JWT required)GET /api/v1/trips/- List user trips (JWT required)GET /api/v1/trips/:id- Trip details (JWT required)DELETE /api/v1/trips/:id- Delete trip (JWT required)GET /metrics- Application monitoring
- Install Go (see
go.modfor version). - Start PostgreSQL and Redis (you can use Docker).
- Run the application:
go run ./cmd/api
Notes:
- The AI itinerary schema is defined in resource/schema.json.