Silos/backend
2026-10-23 02:09:59 +05:30
..
app feat: add personal workspace creation for legacy users and invitation landing page 2026-10-23 02:09:59 +05:30
.env.example first commit 2026-10-08 02:44:15 +05:30
README.md first commit 2026-10-08 02:44:15 +05:30
requirements.txt feat: implement comments and activity panel in workspace 2026-10-22 21:18:10 +05:30

Silos Backend

FastAPI backend with PostgreSQL/SQLite (users/auth) and MongoDB (workspace documents).

Setup

1. Start databases

From the project root:

docker compose up mongo -d

Optional (PostgreSQL instead of SQLite):

docker compose up mongo postgres -d

Then confirm the API: GET http://localhost:8000/api/v1/health should report "mongodb": "connected".

MongoDB is required for Silo pages, Sketch whiteboards, Stead spaces, and Shed docs. SQLite is the default for user authentication (DATABASE_URL in .env).

2. Configure environment

cd backend
copy .env.example .env

3. Create virtual environment & install dependencies

python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

4. Run the API

uvicorn app.main:app --reload --port 8000

API docs: http://localhost:8000/docs

API Endpoints

Method Endpoint Description
GET /api/v1/health Health check
POST /api/v1/auth/register Create new user
POST /api/v1/auth/login Login & get JWT tokens
GET /api/v1/auth/me Get current user (requires auth)
PATCH /api/v1/auth/me Update user profile
POST /api/v1/auth/forgot-password Request password reset
POST /api/v1/auth/reset-password Reset password with token
GET /api/v1/documents List documents (optional ?type= or ?stead_id=)
GET /api/v1/documents/search?q= Search documents by title, type, author, body
GET /api/v1/documents/{id} Get a document
POST /api/v1/documents Create a document
PATCH /api/v1/documents/{id} Update title/content
POST /api/v1/documents/{id}/share Invite a user by email/username
DELETE /api/v1/documents/{id}/share/{user_id} Remove a member
DELETE /api/v1/documents/{id} Delete a document
WS /api/v1/ws/collab/{id} Live collab for Shed meeting notes

Project Structure

backend/
├── app/
│   ├── main.py           # FastAPI app entry
│   ├── config.py         # Settings from .env
│   ├── database.py       # PostgreSQL (SQLAlchemy)
│   ├── mongo.py          # MongoDB connection
│   ├── models/           # SQLAlchemy models
│   ├── schemas/          # Pydantic schemas
│   ├── routers/          # API routes
│   ├── services/         # Business logic
│   └── utils/            # Security helpers
├── requirements.txt
└── .env.example