{"id":44419159,"url":"https://github.com/ayscript/recto-backend","last_synced_at":"2026-02-12T09:09:12.349Z","repository":{"id":335925096,"uuid":"1147518328","full_name":"ayscript/recto-backend","owner":"ayscript","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-01T21:46:56.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-02T06:19:40.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://recto-backend.onrender.com/docs","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-01T21:38:29.000Z","updated_at":"2026-02-01T21:56:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ayscript/recto-backend","commit_stats":null,"previous_names":["ayscript/recto-backend"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ayscript/recto-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Frecto-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Frecto-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Frecto-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Frecto-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayscript","download_url":"https://codeload.github.com/ayscript/recto-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayscript%2Frecto-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29362234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-12T09:09:11.676Z","updated_at":"2026-02-12T09:09:12.341Z","avatar_url":"https://github.com/ayscript.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recto AI Backend\n\nThis repository contains a small FastAPI backend and an agent module used to provide a chat-based AI interface. It integrates with Supabase for authentication and persistence and relies on environment variables for credentials.\n\n**Status:** prototype / development\n\n**Key features**\n- REST API with authentication (Supabase)\n- Chat endpoint that forwards messages to an agent (`agent/chatbot.py`)\n- Endpoints for signup/login and retrieving user profile and sessions\n\n**Requirements**\n- Python 3.14 or newer (see `pyproject.toml`)\n- See `pyproject.toml` for declared dependencies (FastAPI, uvicorn, supabase, langchain, etc.)\n\nProject structure (important files)\n- `main.py` — FastAPI app and HTTP routes (/health, /chat, /history, /sessions, /signup, /login, /get_profile)\n- `auth.py` — HTTP Bearer dependency that validates tokens with Supabase\n- `database.py` — Supabase client initialization (reads `SUPABASE_URL` and `SUPABASE_ANON_KEY` from env)\n- `agent/` — contains the agent and chatbot logic (`agent/chatbot.py`)\n- `pyproject.toml` — project metadata and dependencies\n\nEnvironment variables\n- `SUPABASE_URL` — Supabase project URL\n- `SUPABASE_ANON_KEY` — Supabase anon/public key used in `database.py`\n- Add any other keys required by `agent/chatbot.py` (LLM API keys, etc.) to a `.env` file at the project root. The code calls `load_dotenv()` so `.env` will be loaded if present.\n\nQuick start (Windows)\n1. Create a virtual environment and activate it:\n\n```powershell\npython -m venv .venv\n.\\.venv\\Scripts\\activate\n```\n\n2. Install dependencies\n\nOption A — install editable package (recommended when using `pyproject.toml`):\n\n```bash\nuv sync\n```\n\nOption B — manually install the main dependencies shown in `pyproject.toml`:\n\n```bash\nuv add install fastapi uvicorn supabase-python python-dotenv pydantic\n```\n\n3. Create a `.env` file with at least the Supabase variables:\n\n```\nSUPABASE_URL=\u003cyour-supabase-url\u003e\nSUPABASE_ANON_KEY=\u003cyour-anon-key\u003e\nGOOGLE_API_KEY=\u003cyour-gemini-api-key\u003e\nSUPABASE_DB_URL\n```\n\n4. Run the app (development):\n\n```bash\nuvicorn main:app --reload --host 127.0.0.1 --port 8000\n```\n\nAPI usage examples\n- Health check:\n\n```bash\ncurl http://127.0.0.1:8000/health\n```\n\n- Chat (example request body):\n\n```bash\ncurl -X POST http://127.0.0.1:8000/chat \\\n\t-H \"Authorization: Bearer \u003cTOKEN\u003e\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-d '{\"session_id\":\"session-123\",\"message\":\"Hello\"}'\n```\n\n- Signup / Login endpoints accept JSON bodies per the Pydantic schemas in `main.py`.\n\nNotes \u0026 next steps\n- Ensure `agent/chatbot.py` has the LLM/API keys it requires configured in the environment.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayscript%2Frecto-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayscript%2Frecto-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayscript%2Frecto-backend/lists"}