QRaven is an event platform backend built with Go. It supports authentication, event management, ticket issuance, and payment initialization/status updates, with richer notifications planned as the next major capability.
- API server with Gin, middleware stack, metrics endpoint, and Swagger UI wiring.
- JWT-based auth for register/login and role-based authorization (User, Organizer, Admin).
- Event lifecycle endpoints (create, list, get, update, delete).
- Ticket creation/listing with capacity updates and persistence.
- Payment initialization, retrieval, and status update endpoints wired to ticket status lifecycle.
- PostgreSQL + Redis connections, startup migrations, and scheduled cleanup job for expired tokens.
- Notification service includes token cleanup and push helper, but no full end-user notification workflow yet.
- Legacy Swagger artifacts still exist under
static/andcmd/api/docs/, but runtime now serves canonical docs fromdocs/.
QRaven is intended to become a production-ready event operations backend with:
- Reliable event publishing and discovery.
- End-to-end ticketing with payment confirmation.
- Notification workflows (booking updates, reminders, organizer alerts).
- Stable API documentation and stronger test coverage for all core domains.
- Make
docs/swagger.yamlanddocs/swagger.jsonthe canonical API contract and align generated/static docs. - Add a committed local infrastructure definition (
compose.yaml) somake docker-runis fully plug-and-play. - Standardize configuration loading (single source of truth for
app/environment behavior).
- Expose payment endpoints and connect payment status to ticket lifecycle.
- Wire notification service into ticket/payment events.
- Add API-level tests for event and ticket domains (auth tests already exist).
- Improve observability and operational docs (runbooks, failure modes, metrics usage).
- Expand security checks and role-policy validation coverage.
- Add CI automation for tests, linting, and Swagger consistency checks.
cmd/api/main.go: application bootstrap (config, DB/Redis, migrations, cron, server start).pkg/router/*: route registration by domain (auth,event,ticket,payment).pkg/controller/*: HTTP handlers and request/response orchestration.services/*: business logic layer.internal/models/*: data models and migration definitions.pkg/repository/storage/*: PostgreSQL/Redis data-access abstraction.pkg/middleware/*: authz, metrics, CORS, and security middleware.
Base path: /api/v1
- Auth
POST /auth/registerPOST /auth/login
- Events
POST /events/(Organizer)GET /events/(User, Organizer, Admin)GET /events/:id(User, Organizer, Admin)PUT /events/:id(Organizer)DELETE /events/:id(Organizer)
- Tickets
POST /tickets/:eventId(User, Organizer, Admin)GET /tickets/(User, Organizer, Admin)
- Payments
POST /payments/initialize(User, Organizer, Admin)GET /payments/:id(User, Organizer, Admin)PATCH /payments/:id/status(User, Organizer, Admin)
Also available:
GET /metrics(Prometheus)GET /swagger/*any(Swagger UI)
- Go 1.22.5+
- Docker + Docker Compose
The Makefile expects a Compose project:
make docker-runcompose.yaml is committed with PostgreSQL + Redis defaults and works directly with make docker-run.
The app uses Viper with environment fallback. Use environment variables (recommended) or an app.env file if your local workflow depends on it.
Minimum variables to run:
APP_NAME=QRaven
APP_MODE=debug
APP_URL=http://localhost:8080
SERVER_PORT=8080
SERVER_SECRET=replace-with-a-strong-secret
SERVER_ACCESSTOKENEXPIREDURATION=24
REQUEST_PER_SECOND=5
TRUSTED_PROXIES=[]
EXEMPT_FROM_THROTTLE=[]
DB_HOST=127.0.0.1
DB_PORT=5432
DB_CONNECTION=postgres
USERNAME=postgres
PASSWORD=postgres
DB_NAME=qraven
SSLMODE=disable
TIMEZONE=Africa/Lagos
MIGRATE=true
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_DB=0Optional (only if using image upload / payment code paths):
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
PAYSTACK_SECRET_KEY=make runmake buildmake testCanonical docs live in:
docs/swagger.yamldocs/swagger.json
Swagger UI serves the canonical spec from docs/swagger.yaml at runtime.
Regenerate after route/handler changes:
make swagger- Notification user workflows are not yet wired to ticket/payment business events.
- Legacy Swagger outputs in
static/andcmd/api/docs/should be removed in a cleanup PR after consumers are fully moved. - Test suite is currently strongest in auth; event/ticket/payment/notification test coverage is still thin.
- Wire notification service to ticket/payment lifecycle events.
- Add event/ticket/payment integration tests and failure-path coverage.
- Remove legacy Swagger artifacts under
static/andcmd/api/docs/. - Harden role-policy checks and negative-path coverage.
This repository includes:
Dockerfilerender.yaml
In Render, create a new Blueprint and point it to this repository. Render will use render.yaml.
render.yaml includes defaults and placeholders. You must set secrets and external service values:
SERVER_SECRETDB_HOST,DB_PORT,USERNAME,PASSWORD,DB_NAMEREDIS_HOST,REDIS_PORTPAYSTACK_SECRET_KEY(if payment initialization is enabled)
For external Postgres/Redis, keep DB_CONNECTION=postgres, set SSLMODE=require, and ensure network access from Render.
MIGRATE=false is the default in render.yaml. Enable it intentionally when you want boot-time migrations.
Render health check path is /api/v1/.
