This is backend go gin project for GadaSpace (oromo culture, story, heroes).
# GadaSpace Backend (Gin + PostgreSQL)
Simple but robust REST APIs for login/signup and screen-driven content (home, explore, article details, quiz, library, profile) with full CRUD for key entities.
## Run
1) Start PostgreSQL:
```bash
docker compose up -d
```
2) Set environment variables and run (PowerShell):
```bash
$env:DB_DSN='host=localhost user=postgres password=postgres dbname=gadaspace port=5432 sslmode=disable TimeZone=UTC'
$env:JWT_SECRET='change-this-secret'
$env:PORT='8080'
go mod tidy
go run .
```
CMD variant:
```bash
set "DB_DSN=host=localhost user=postgres password=postgres dbname=gadaspace port=5432 sslmode=disable TimeZone=UTC"
set "JWT_SECRET=change-this-secret"
set "PORT=8080"
go mod tidy
go run .
```
3) Stop PostgreSQL:
```bash
docker compose down
```
4) Full reset (delete DB data volume):
```bash
docker compose down -v
```
Server starts on `
localhost`.
## Env Vars
- `PORT` default `8080`
- `DB_DSN` default `host=localhost user=postgres password=postgres dbname=gadaspace port=5432 sslmode=disable TimeZone=UTC`
- `JWT_SECRET` default `change-this-secret`
## Seeded Login
- Email: `abebe@gadaspace.app`
- Password: `Pass@123`
## Main APIs
### Auth
- `POST /api/v1/auth/signup`
- `POST /api/v1/auth/login`
- `GET /api/v1/auth/me` (Bearer token)
### Screen APIs
- `GET /api/v1/home`
- `GET /api/v1/explore?q=gadaa`
- `GET /api/v1/articles/:id`
- `GET /api/v1/quiz` or `GET /api/v1/quiz/:id`
- `GET /api/v1/library` (Bearer token)
- `GET /api/v1/profile` (Bearer token)
### Library Actions
- `POST /api/v1/library` (Bearer token) body: `{ "article_id": 1 }`
- `PATCH /api/v1/library/:id/progress` (Bearer token) body: `{ "progress_pct": 65 }`
- `DELETE /api/v1/library/:id` (Bearer token)
### CRUD APIs
- Categories: `GET/POST/PUT/DELETE /api/v1/categories`
- Articles: `GET/POST/PUT/DELETE /api/v1/articles`
- Topics: `GET/POST/PUT/DELETE /api/v1/topics`
- Quizzes: `GET/POST/PUT/DELETE /api/v1/quizzes`
## Request Body Samples …