Current production topology:
- Frontend: GitHub Pages static export at
https://oyi77.is-a.dev/1proxy/. - Backend: Local FastAPI service exposed through Cloudflare Tunnel at
https://1proxy-api.aitradepulse.com. - Database: Local SQLite by default, or Supabase Postgres through
DATABASE_URL.
Do not commit real tokens, OAuth secrets, Supabase service-role keys, or Cloudflare tokens. Store them only in local .env files or provider secret managers.
graph LR
GH[GitHub main branch] --> GA[GitHub Actions]
GA --> GP[GitHub Pages frontend]
LOCAL[Local FastAPI backend] --> CF[Cloudflare Tunnel]
LOCAL --> DB[(SQLite or Supabase Postgres)]
GP -->|NEXT_PUBLIC_API_URL| CF
The frontend is deployed by .github/workflows/deploy-frontend.yml.
Required build-time environment:
| Variable | Value |
|---|---|
NEXT_PUBLIC_BASE_PATH |
/1proxy |
NEXT_PUBLIC_API_URL |
https://1proxy-api.aitradepulse.com |
Manual verification build:
cd 1proxy-frontend
NEXT_PUBLIC_BASE_PATH=/1proxy \
NEXT_PUBLIC_API_URL=https://1proxy-api.aitradepulse.com \
npm run build:cleanRun the backend locally on port 8000, then route 1proxy-api.aitradepulse.com to port 8000 through ~/.cloudflare-router.
Set these backend variables:
| Variable | Purpose | Example |
|---|---|---|
DATABASE_URL |
SQLite or Supabase Postgres async connection | sqlite+aiosqlite:///./data/1proxy.db |
SECRET_KEY |
JWT signing key | output of openssl rand -hex 32 |
API_URL |
Public backend URL | https://1proxy-api.aitradepulse.com |
FRONTEND_URL |
Public frontend origin/path | https://oyi77.is-a.dev/1proxy |
FRONTEND_BASE_PATH |
Frontend subpath for redirects | /1proxy |
GITHUB_CLIENT_ID |
GitHub OAuth app client ID | provider value |
GITHUB_CLIENT_SECRET |
GitHub OAuth app client secret | provider secret |
GOOGLE_CLIENT_ID |
Google OAuth client ID | provider value |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | provider secret |
GITHUB_REPO_OWNER |
Admin access repository owner | oyi77 |
GITHUB_REPO_NAME |
Admin access repository name | 1proxy |
Optional:
| Variable | Purpose |
|---|---|
REDIS_URL |
Redis URL if a Railway Redis service is attached |
Set API_URL explicitly for OAuth callbacks.
Use the Supabase connection string, not the Supabase anon JWT or service-role JWT, for SQLAlchemy/Alembic.
Recommended production pattern:
- In Supabase, copy a Postgres connection string for the project.
- Convert it to SQLAlchemy async format if needed:
postgres://...->postgresql+asyncpg://...postgresql://...->postgresql+asyncpg://...
- Store it as Railway
DATABASE_URL. - Run
alembic upgrade headbefore starting Uvicorn.
Keep Supabase service-role JWTs out of the frontend and out of the repository. The current app does not need Supabase REST keys; it uses Postgres via SQLAlchemy.
Configure provider callbacks to the backend domain:
| Provider | Callback URL |
|---|---|
| GitHub | https://1proxy-api.aitradepulse.com/auth/github/callback |
https://1proxy-api.aitradepulse.com/auth/google/callback |
After successful login, backend redirects to FRONTEND_URL plus FRONTEND_BASE_PATH-aware routes.
cp .env.example .env
cp 1proxy-backend/.env.example 1proxy-backend/.env
cd 1proxy-backend
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reloadcd 1proxy-frontend
npm install
npm run devRotate credentials immediately if they are posted in chat, logs, screenshots, issues, or commits:
- Railway account/project token.
- Supabase service-role JWT and database password.
- GitHub OAuth client secret.
- Google OAuth client secret.
- Backend
SECRET_KEYif exposed.
Then update Railway variables and redeploy.