Skip to content

Commit 78708cb

Browse files
authored
Merge pull request #3 from astrowq/dev/cursor
Update dependencies and add AGENTS.md for Python 3.13 compatibility
2 parents ad0752e + 2a213cc commit 78708cb

File tree

6 files changed

+99
-3
lines changed

6 files changed

+99
-3
lines changed

.cursor/rules/aperture-project.mdc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description: Aperture project context, stack, and code conventions
3+
alwaysApply: true
4+
---
5+
6+
# Aperture — Project Rules
7+
8+
**What it is:** Open-source AI visibility infrastructure. Tracks how brands appear in ChatGPT, Perplexity, and other LLM-powered search. Self-hosted, BYOK. FastAPI backend + React/TypeScript frontend.
9+
10+
**Layout:**
11+
- `backend/app/` — FastAPI app: `main.py`, `database.py`, `models.py`, `schemas.py`, `routers/`, `services/` (including `services/llm/` for providers)
12+
- `backend/tests/` — pytest; add tests here for new backend functionality
13+
- `frontend/src/` — React app: `App.tsx`, `api/`, `components/`, `pages/`, `types/`
14+
15+
**Backend (Python):** PEP 8, type hints throughout, docstrings for public functions. Small, focused functions. New LLM provider: add `backend/app/services/llm/<provider>_service.py`, wire in `audit_service.py` and `routers/audits.py`, then frontend in `Audits.tsx` and `Settings.tsx`.
16+
17+
**Frontend (TypeScript/React):** Strict mode, functional components + hooks only, Tailwind for styling, no inline styles. Keep components focused.
18+
19+
**Commits:** Conventional — `feat:`, `fix:`, `docs:`, `test:`, `refactor:`, `chore:`.
20+
21+
**Run:** `docker compose up -d` (UI :3000, API :8000). Dev: backend `uvicorn app.main:app --reload`, frontend `npm run dev`. Tests: `cd backend && pytest tests/ -v`. Build check: `cd frontend && npm run build`.

.github/workflows/backend-ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Backend CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'backend/**'
8+
- '.github/workflows/backend-ci.yml'
9+
pull_request:
10+
branches: [main, master]
11+
paths:
12+
- 'backend/**'
13+
- '.github/workflows/backend-ci.yml'
14+
15+
defaults:
16+
run:
17+
working-directory: backend
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.13'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install -r requirements.txt
34+
35+
- name: Run tests
36+
run: pytest tests/ -v

AGENTS.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# AGENTS.md — Context for AI Assistants
2+
3+
**Aperture** is open-source AI visibility infrastructure: it tracks how brands appear (or don’t) across ChatGPT, Perplexity, and other LLM-powered search engines. Self-hosted, bring your own API keys.
4+
5+
## Stack
6+
7+
| Layer | Tech |
8+
|--------|------|
9+
| Backend | Python 3, FastAPI, SQLAlchemy, Pydantic |
10+
| Frontend | TypeScript, React, Vite, Tailwind CSS |
11+
| Run | Docker Compose (optional); can run backend/frontend locally |
12+
13+
## Where to Look
14+
15+
- **API & app entry:** `backend/app/main.py`
16+
- **DB models & schemas:** `backend/app/models.py`, `backend/app/schemas.py`
17+
- **API routes:** `backend/app/routers/` (brands, queries, audits, results, settings)
18+
- **Business logic:** `backend/app/services/``audit_service.py`, `analysis.py`, `services/llm/*.py` for each provider
19+
- **Tests:** `backend/tests/` (pytest)
20+
- **Frontend:** `frontend/src/``App.tsx`, `pages/`, `components/`, `api/`, `types/`
21+
22+
## Run & Test
23+
24+
- **Full stack:** `docker compose up -d` → UI http://localhost:3000, API http://localhost:8000
25+
- **Backend dev:** `cd backend && pip install -r requirements.txt && uvicorn app.main:app --reload`
26+
- **Frontend dev:** `cd frontend && npm install && npm run dev`
27+
- **Backend tests:** `cd backend && pytest tests/ -v`
28+
- **Frontend build:** `cd frontend && npm run build`
29+
30+
## Conventions
31+
32+
See [CONTRIBUTING.md](CONTRIBUTING.md) for code style (PEP 8, type hints, docstrings; TS strict, functional components, Tailwind). See [DOCS.md](DOCS.md) for architecture and configuration.

DOCS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ Then use your custom model name in audit runs.
157157

158158
### Backend
159159

160+
**Python:** 3.10–3.13. If you hit `Failed building wheel for pydantic-core` on 3.13, use 3.11 or 3.12 for the venv (e.g. `pyenv install 3.12 && pyenv local 3.12`), or upgrade to the latest `requirements.txt` which uses Pydantic 2.10+ with 3.13-compatible wheels.
161+
160162
```bash
161163
cd backend
162164
python -m venv .venv

backend/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.pytest.ini_options]
2+
pythonpath = ["."]
3+
testpaths = ["tests"]

backend/requirements.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
fastapi==0.111.0
22
uvicorn[standard]==0.30.1
3-
sqlalchemy==2.0.30
3+
# 2.0.31+ required for Python 3.13 (langhelpers/symbol/IntFlag fixes)
4+
sqlalchemy>=2.0.31,<2.1
45
alembic==1.13.1
5-
pydantic==2.7.1
6-
pydantic-settings==2.3.0
6+
# Pydantic 2.10+ pulls pydantic-core with Python 3.13 wheels (2.7.x requires building from source on 3.13)
7+
pydantic>=2.10.0,<3
8+
pydantic-settings>=2.6.0,<3
79
httpx==0.27.0
810
openai==1.30.5
911
python-multipart==0.0.9

0 commit comments

Comments
 (0)