2025-06-05 07:51:14 +00:00
2025-06-05 07:51:14 +00:00
2025-06-05 07:51:14 +00:00
2025-06-05 07:42:54 +00:00
2025-06-05 07:49:27 +00:00

General Communication Service

A FastAPI-based general purpose communication service with SQLite integration.

Features

  • FastAPI-based REST API
  • SQLite database integration
  • Alembic migrations
  • CORS enabled with all origins allowed
  • Health check endpoint
  • API documentation at default paths

Project Structure

/
├── app/
│   ├── api/
│   │   ├── routes/
│   │   │   ├── health.py
│   │   │   └── api.py
│   ├── core/
│   ├── db/
│   │   └── session.py
│   ├── models/
│   │   └── base.py
│   └── schemas/
├── migrations/
│   ├── versions/
│   ├── env.py
│   └── script.py.mako
├── storage/
│   └── db/
├── alembic.ini
├── main.py
├── requirements.txt
└── README.md

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt

Running the Application

uvicorn main:app --reload

The application will be available at http://localhost:8000

API Documentation

Database Migrations

Generate a new migration:

alembic revision --autogenerate -m "description"

Apply migrations:

alembic upgrade head

API Endpoints

Messages API

  • GET /api/v1/messages

    • Retrieves a list of all messages
    • Supports pagination and filtering
  • GET /api/v1/messages/{message_id}

    • Retrieves a specific message by ID
  • POST /api/v1/messages

    • Creates a new message
    • Requires message content and recipient information
  • PUT /api/v1/messages/{message_id}/read

    • Marks a message as read
  • DELETE /api/v1/messages/{message_id}

    • Deletes a specific message

Environment Variables

None required for basic setup, as SQLite database path is configured internally.

Database Configuration

SQLite database is configured to be stored at:

/app/storage/db/db.sqlite
Description
Project: General Communication Service
Readme 48 KiB
Languages
Python 95.8%
Mako 4.2%