A full-stack todo application built with Go (Gin) backend and React frontend.
- Backend: RESTful API built with Go and Gin framework
- Frontend: Modern React UI with Vite build tool
- Database: PostgreSQL with migrations
- Development: Hot reload with Air (Go) and Vite (React)
- API Documentation: Swagger/OpenAPI integration
- Containerization: Docker Compose for easy development setup
odot/
├── cmd/ # Application entry points
│ ├── server/ # Main server application
│ └── docs/ # Generated API documentation
├── internal/ # Private application code
│ ├── api/ # HTTP handlers and routes
│ ├── config/ # Configuration management
│ ├── db/ # Database connection and queries
│ ├── logger/ # Logging utilities
│ ├── models/ # Data models
│ └── types/ # Type definitions
├── sql/ # Database related files
│ ├── migrations/ # Database migration files
│ └── queries/ # SQL queries for SQLC
├── ui/ # React frontend
│ ├── src/ # React source code
│ ├── public/ # Static assets
│ └── dist/ # Built frontend assets
├── docker/ # Docker configuration files
└── init-scripts/ # Database initialization scripts
- Go 1.24.1 or later
- Node.js 18+ and npm
- Docker and Docker Compose
- PostgreSQL (if running locally)
-
Clone the repository
git clone <repository-url> cd odot
-
Start the development environment
make dev
This will start:
- PostgreSQL database on port 5432
- Go API server on port 8080 with hot reload
- React development server accessible through the API
-
Access the application
- Frontend: http://localhost:5173
- API: http://localhost:8080
- Swagger Docs: http://localhost:8080/swagger/index.html
- Health Check: http://localhost:8080/health
-
Database Setup
# Start PostgreSQL docker run -d \ --name odot-postgres \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \ -e POSTGRES_DB=postgres \ -p 5432:5432 \ postgres:14-alpine -
Backend Setup
# Install Go dependencies go mod download # Run database migrations make migrate # Generate SQL code make sql-gen # Generate API documentation make docs-gen # Start the server make build ./bin/server
-
Frontend Setup
cd ui npm install npm run dev
The development environment uses separate frontend and backend servers for optimal developer experience:
- Frontend: React + Vite dev server on
http://localhost:5173 - Backend: Go API server on
http://localhost:8080 - Database: PostgreSQL on
localhost:5432
make dev- Start full development environment with Docker Composemake build- Build the Go applicationmake test- Run all testsmake clean- Clean up containers and build artifactsmake db- Connect to the PostgreSQL databasemake logs- View all container logsmake api-logs- View API server logs onlymake db-logs- View database logs onlymake sql-gen- Generate Go code from SQL queriesmake migrate- Run database migrationsmake docs-gen- Generate API documentation
Connect to Database:
make dbRun Migrations:
make migrateGenerate SQL Code:
make sql-genThe application uses environment variables for configuration:
PORT- Server port (default: 8080)DATABASE_URL- PostgreSQL connection stringENVIRONMENT- Application environment (development/production)LOG_LEVEL- Logging level (debug/info/warn/error)
This project is currently in early development. The basic infrastructure is set up, but todo-specific features are yet to be implemented.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
For questions and support, please open an issue in the repository.