Skip to content

[Docs] Add comprehensive API/backend documentation #37

@webmaxru

Description

@webmaxru

Summary

Create comprehensive documentation for the Express REST API backend to help developers understand the codebase structure, setup, and usage.

Documentation Scope

The following areas should be documented:

1. API Overview

  • Architecture overview (Express + SQLite + repository pattern)
  • Directory structure explanation (api/src/)
  • Configuration and environment variables

2. Database Documentation

  • SQLite schema and migrations (api/sql/migrations/)
  • Seed data structure (api/sql/seed/)
  • Database configuration (api/src/db/)

3. Data Models

  • Document all models in api/src/models/:
    • Branch, Delivery, Headquarters, Order, OrderDetail
    • OrderDetailDelivery, Product, Supplier

4. API Endpoints

  • Document all REST endpoints from api/src/routes/:
    • Branch, Delivery, Headquarters, Order, OrderDetail
    • OrderDetailDelivery, Product, Supplier
  • Request/response formats
  • Error handling patterns

5. Repository Layer

  • Document repository pattern implementation
  • CRUD operations for each entity

6. Development Guide

  • Local setup instructions
  • Running tests
  • Building and deployment

Acceptance Criteria

  • README.md updated with quick start guide
  • API endpoint documentation (consider OpenAPI/Swagger expansion)
  • Database schema documentation
  • Code examples for common operations
  • Error handling documentation

Additional Context

Current Swagger documentation exists at api/api-swagger.json - this can be expanded and integrated into the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions