Singularity

Singularity

A production-ready, modular Python backend framework built with FastAPI, Celery, SQLAlchemy, and Redis. Designed for scalability, maintainability, and developer experience.

Convention-based FastAPI microservices framework. Build scalable APIs with auto-discovered services, hooks, caching, inter-service RPC, and background tasks — pip install singularity-fm and go.

Why Singularity?

Singularity gives you a fully wired backend skeleton so you can focus on business logic instead of plumbing. Every module -- services, tasks, scripts, RPC, webhooks -- follows the same conventions and is automatically discovered at startup.


Architecture

Singularity follows a modular monolith pattern. The application core consists of a FastAPI app, a Service Manager that handles auto-discovery and dependency injection, an RPC registry for inter-service communication, and a task runner for background work. External infrastructure (PostgreSQL, Redis, Celery workers) is accessed through well-defined boundaries.


Quick Start

Get a running development server in five commands:

mkdir my-project && cd my-project
uv init && uv add singularity-fm
uv run singularity new
uv run singularity dev

(singularity new scaffolds into the current directory — Singularity must already be installed, so the project folder and Python env are expected to exist.)

The API will be available at http://localhost:8000 and the interactive Swagger docs at http://localhost:8000/docs.

From here, scaffold your first service:

singularity generate service users

Read the Installation guide for detailed setup instructions, or jump to Project Structure to understand how the codebase is organized.