Back to work

AI Backend · 2026In progress

DocuChat

DocuChat is a backend API for asking questions about your own documents. Users sign up, add documents and hold conversations through a layered Express service with token authentication, role-based permissions and interactive API docs. It is still being built, and there is no frontend yet.

docuchat-api: example requests

$curl -X POST localhost:3000/api/v1/auth/login \

-H "Content-Type: application/json" \

-d '{"email":"user@example.com","password":"********"}'

{ "accessToken": "eyJ...", "refreshToken": "...", "user": { ... } }

$curl -X POST localhost:3000/api/v1/documents \

-H "Authorization: Bearer $TOKEN" \

-d '{"title":"Q3 Report","content":"..."}'

201 { "success": true, "data": { "status": "pending", ... } }

$curl -X POST localhost:3000/api/v1/conversations/$ID/messages \

-H "Authorization: Bearer $TOKEN" \

-d '{"content":"Summarise the key findings"}'

201 { "success": true, "data": { ... } }

The problem

Answering questions about a document means managing who can see it, tracking it as it is processed and keeping the conversation history that goes with it.

The solution

DocuChat separates the API into routes, services and a database layer, so authentication, permissions, documents and conversations each have a clear place and can be tested on their own.

My contribution

  • Designed and built the API with a routes, services and database layered structure.
  • Implemented registration, login and refresh-token rotation with JWT.
  • Added role-based permissions that control access to each endpoint.
  • Built document and conversation endpoints with validation, pagination and search.
  • Documented the API with Swagger and wrote unit and integration tests.

Key features

  • JWT authentication with refresh tokens
  • Role-based permissions
  • Document management with status tracking
  • Conversations and messages
  • Request validation
  • Interactive Swagger API docs
  • Unit and integration tests