Skip to content

Repository files navigation

BridgeStack

API backend bridging OpenStacks data layers.

CIPart of OpenStacksLicense: MITPython 3.11+FastAPICode style: Ruff

The API layer for OpenStacks — connecting database to frontend.


Quick Start

git clone https://github.com/Varnasr/BridgeStack.git
cd BridgeStack
pip install -r requirements.txt
uvicorn app.main:app --reload

Open http://localhost:8000/docs for interactive API docs.

With Docker

docker compose up --build

With Make

make dev # install with dev tools
make run # start the server
make test# run tests with coverage
make check # lint + test

Architecture

RootStack (SQLite) → BridgeStack (FastAPI) → ViewStack / EquityStack / FieldStack

BridgeStack serves as the middleware connecting RootStack data to all consumer Stacks:

StackRoleConnection
RootStackSQLite schemas & seed dataData source
BridgeStack (this repo)REST API (FastAPI)You are here
ViewStackFrontend dashboardsConsumes API
EquityStackPython analysis workflowsConsumes API
FieldStackR fieldwork toolsConsumes API
InsightStackMEL toolsConsumes API
SignalStackCurated contentConsumes API

API Endpoints

All endpoints are prefixed with /api/v1. Full reference: docs/api-reference.md

DomainEndpointsFilters
Geographystates, districtsregion, state_id, tier
Sectorssectors
Indicatorsindicators, valuessector_id, source, state_id, year
Policiesschemes, budgets, coveragesector_id, status, level, fiscal_year
Toolstoolsstack, language, tool_type, difficulty
Health/, /health

Documentation

Full documentation is in the docs/ directory:

Configuration

Environment variables (prefix BRIDGE_):

VariableDefaultDescription
BRIDGE_DATABASE_URLsqlite:///./rootstack.dbDatabase connection string
BRIDGE_DEBUGfalseEnable debug mode
BRIDGE_CORS_ORIGINS["*"]Allowed CORS origins
BRIDGE_LOG_LEVELINFOLogging level

See .env.example for a starter configuration.

Development

# Install dev dependencies
pip install -e ".[dev]"# Run tests
pytest --cov=app
# Lint & format
ruff check .
ruff format .

Project Structure

BridgeStack/
├── app/
│ ├── main.py # FastAPI app entry point
│ ├── core/
│ │ ├── config.py # Settings (env-configurable)
│ │ └── database.py # SQLAlchemy setup
│ ├── models/ # SQLAlchemy ORM models
│ ├── schemas/ # Pydantic response schemas
│ └── routes/ # API route handlers
├── tests/ # Pytest test suite
├── docs/ # Project documentation
├── pyproject.toml # Project metadata & tool config
├── requirements.txt # Python dependencies
├── Makefile # Development commands
├── Dockerfile # Container image
└── docker-compose.yml # Local orchestration

Contributing

See CONTRIBUTING.md for guidelines. Areas where contributions are welcome:

  • Additional query endpoints and aggregations
  • Pagination and rate limiting
  • Response caching
  • PostgreSQL adapter
  • WebSocket support for real-time data

Please read our Code of Conduct before participating.

License

MIT — free to use, modify, and share. See LICENSE.


Created by Varna Sri Raman — Development Economist & Social Researcher

Part of the OpenStacks ecosystem by ImpactMojo.

About

[Early-stage] API backend bridging OpenStacks data layers

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages