A lightweight Go-based calendar backend + admin UI using Gin and SQLite.
This repository implements an event calendar service with endpoints for creating, updating, deleting, and getting events, including common event operations. It serves a static frontend dashboard from cmd/index.html and assets under db/static.
- REST-like routes for event operations
- SQLite persistence via
pkg/postgres(and alternate handlers inpkg/sqlite) - Clean domain structure under
internal/event(controllers, services, repositories) - Admin UI with FullCalendar and AdminLTE assets
cmd/main.go— Application entrypoint and HTTP route definitionsinternal/calendar/userinterface/controllers— HTTP handlersinternal/calendar/app/services— Business logic service layerinternal/calendar/infra/Repositories— Database repository implementationspkg/postgres— DB handler and connection logicdb/static— Static assets for calendar UI
- Go 1.23+
- Linux/macOS/Windows
cd $DEV/calendar
go mod tidy
go build -o calendar ./cmd
go run ./calendarOpen http://localhost:5600 in your browser.
The app runs on port 5600 by default.
POST /api/v1/event/create- Create an eventPOST /api/v1/event/delete- Delete an eventPOST /api/v1/event/update- Update an eventPOST /api/v1/events- Get eventsPOST /api/v1/event/common/create- Create common eventPOST /api/v1/event/common/delete- Delete common eventGET /- Serve main UI (index.html)
{
"name": "Team Meeting",
"description": "Weekly sync",
"start_date": "2026-03-15T10:00:00Z",
"end_date": "2026-03-15T11:00:00Z",
"user_id": "1"
}The server initializes ./db.db via pkg/postgres.NewDBHandler("./db.db"). If missing, the app creates it.
The root path renders cmd/index.html using Go templates and static files are served at /static from /opt/calendar/static (via server.Static("/static", "/opt/calendar/static")).
Note: For local development, ensure this path exists or update the static path in
cmd/main.go.
go run ./cmd— Start servergo test ./...— Run all tests (if any are added)
- Fork the repository.
- Create a feature branch.
- Add tests and documentation.
- Open a pull request.