Bookly is a monorepo, full-stack Go project that demonstrates a clean and simple backend architecture, coupled with a Y2K-inspired web application using Go templates and HTMX.
This project showcases a modern approach to building web applications with Go, featuring:
- A robust backend API
- A lightweight frontend using Go templates and HTMX
- Clean architecture principles
- GORM for database operations
- JWT-based authentication
- Docker-based deployment
- User management (registration, login, profile updates)
- Account management
- Ledger entries for financial tracking
- RESTful API
- Server-side rendered web interface with HTMX for dynamic updates
cmd/
: Contains the main entry points for different executablesapp/
: Application layer, including API and web handlersdomain/
: Core business logic and interfacespersistence/
: Database related code, including migrations and repositoriesservice/
: Service layer implementing business logicdeploy/
: Deployment configurationsDockerfile.*
: Docker build files for different services
- Go 1.23+
- Docker and Docker Compose
- Taskfile
-
Clone the repository:
git clone https://github.com/omegaatt36/bookly.git cd bookly
-
Start all services using Docker Compose:
task dev
This command will:
- Set up the PostgreSQL database
- Run database migrations
- Start the API server
- Start the web server
- Start Adminer for database management
-
Access the services:
- Web interface:
http://localhost:3000
- API:
http://localhost:8080
- Adminer (database management):
http://localhost:9527
- Web interface:
-
Register a new user via command line:
curl -X POST 'http://localhost:8080/internal/auth/register' \
-H 'Content-Type: application/json' \
-H 'INTERNAL-TOKEN: secret' \
-d '{"email":"tester","password":"tester"}'
- Use
task fmt
to format the code - Use
task lint
to run linters - Use
task test
to run tests - Use
task live-api
to run the API with live reloading(powered by Air) - Use
task live-web
to run the web server with live reloading(powered by Air)
- To set up the database:
task setup-db
- To remove the database:
task remove-db
- To run migrations:
task migrate-api
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.