feat: add initial project structure and files for Go API with PostgreSQL and HAProxy

Co-authored-by: aider (ollama/qwen2.5-coder:7b) <aider@aider.chat>
This commit is contained in:
2026-11-09 19:51:17 +03:00
co-authored by aider
parent 0ab3a341aa
commit 7734b222f8
11 changed files with 333 additions and 323 deletions
+15 -38
View File
@@ -1,46 +1,23 @@
# Optional HTTP-client worksheet; no extension is required by the course.
# Replace IDs/token locally from real responses; do not commit filled-in credentials.
# Canonical API: contracts/openapi.json and contracts/README.md.
@baseUrl = http://localhost:8080
@aliceId = REPLACE_WITH_CREATED_ALICE_UUID
@bobId = REPLACE_WITH_CREATED_BOB_UUID
@chatId = REPLACE_WITH_CREATED_CHAT_UUID
@sessionToken = REPLACE_LOCALLY_DO_NOT_COMMIT
### Liveness
GET {{baseUrl}}/health/live
### Register Alice (repeat with username bob/display_name Боб)
POST {{baseUrl}}/api/v1/users
POST /api/auth/login HTTP/1.1
Host: localhost:8080
Content-Type: application/json
{
"username": "alice",
"display_name": "Алиса",
"password": "Example-only-not-a-real-secret-123"
"login": "user",
"password": "password"
}
### Create session: generate the Base64 value locally, do not commit credentials
# Base64 of UTF-8 username:password; only this endpoint accepts Basic.
POST {{baseUrl}}/api/v1/auth/sessions
Authorization: Basic REPLACE_WITH_LOCAL_BASE64_CREDENTIAL
### Create chat; both UUIDs must be real registered users
POST {{baseUrl}}/api/v1/chats
Authorization: Bearer {{sessionToken}}
POST /api/messages HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Authorization: Bearer <token>
Idempotency-Key: <idempotency-key>
{"title":"Проект по ВНП","member_ids":["{{aliceId}}","{{bobId}}"]}
{
"recipient": "user",
"body": "Hello, World!"
}
### Send message
POST {{baseUrl}}/api/v1/chats/{{chatId}}/messages
Authorization: Bearer {{sessionToken}}
Idempotency-Key: example-message-001
Content-Type: application/json
{"text":"Привет, Боб!"}
### Read first page
GET {{baseUrl}}/api/v1/chats/{{chatId}}/messages?limit=50
Authorization: Bearer {{sessionToken}}
GET /api/messages HTTP/1.1
Host: localhost:8080
Authorization: Bearer <token>