Druna is a backend service for managing users, events, friends, and groups. It provides a RESTful API using Go (Golang), Gin, and PostgreSQL, with support for JWT authentication and Swagger-based documentation.
- User registration and login
- JWT-based authentication
- Event creation, listing, and deletion
- Friendship management (request, list)
- Group planning support (WIP)
- Swagger API documentation
- Go (Golang)
- Gin Web Framework
- PostgreSQL
- JWT (Authorization)
- Swaggo (Swagger documentation)
git clone https://github.com/yourusername/DrunaServer.git
cd DrunaServergo mod tidyDB_HOST=localhost
DB_PORT=5432
DB_USER=yourusername
DB_PASSWORD=yourpassword
DB_NAME=druna
go run cmd/main.gogo install github.com/swaggo/swag/cmd/swag@latest
swag init -g cmd/main.go- All Swagger documentation models are defined in model/structs_doc.go.
Use the JWT access token returned from /auth/sign-in in the Authorization header for all /api/* requests:
Authorization: Bearer <access token>
Use the JWT refresh token and /auth/renew-token endpoint to get a new access token:
Authorization: Bearer <refresh token>
| Method | Path | Description |
|---|---|---|
| POST | /auth/sign-up | Register a new user |
| POST | /auth/sign-in | Login and get JWT |
| POST | /auth/renew-token | Renew JWT access token |
| POST | /api/events/add-event | Create a new event |
| POST | /api/events/list | List user events |
| DELETE | /api/events/:id | Delete an event |
| GET | /api/friends/list | List user's friends |
| POST | /api/friends/request | Send a friend request |