A secure, containerized REST API for genomic data, built with Go, Gin, and PostgreSQL.
- RESTful CRUD endpoints for genomes, samples, sequence files, variant files, and users
- JWT authentication
- PostgreSQL integration
- Docker & Docker Compose support
- Automatic DB schema and sample data initialization
- Live code reload in development (via Docker volume mount)
- Swagger UI documentation (
/swagger/index.html)
- Docker & Docker Compose
- (Optional) Go for local development
- Copy
.env.exampleto.envand update credentials, or create a.envfile in the project root. - Build and run with Docker Compose:
docker compose --env-file .env up --build
- The API will be available at
http://localhost:8080 - Swagger UI available at
http://localhost:8080/swagger/index.html
-
POST /api/login— obtain JWT token -
GET /api/genomes— list genomes -
POST /api/genomes— create genome -
GET /api/genomes/:id— get genome by ID -
PUT /api/genomes/:id— update genome -
DELETE /api/genomes/:id— delete genome -
GET /api/samples— list samples -
POST /api/samples— create sample -
GET /api/samples/:id— get sample by ID -
PUT /api/samples/:id— update sample -
DELETE /api/samples/:id— delete sample -
GET /api/sequence— list sequence files -
POST /api/sequence— create sequence file -
GET /api/sequence/:id— get sequence file by ID -
PUT /api/sequence/:id— update sequence file -
DELETE /api/sequence/:id— delete sequence file -
GET /api/variants— list variant files -
POST /api/variants— create variant file -
GET /api/samples/:id/variants— get variants for a sample -
DELETE /api/variants/:id— delete variant file -
GET /api/users— list users -
POST /api/users— create user -
GET /api/users/:id— get user by ID -
PUT /api/users/:id— update user -
DELETE /api/users/:id— delete user
- Schema and sample data are initialized from
genomic_schema.dmbl.sqlon first run. - To reset the DB, run:
docker compose down -v docker compose --env-file .env up --build
- Code changes are reflected live in the running container (no rebuild needed).
- Run locally with:
go run main.go
- To update Swagger docs after changing handler annotations:
swag init
See INSTRUCTIONS.md for more details and commands.