Docgate is a gated-content stack for products like dajuan.fseasy.top. It lets you keep your site and docs mostly static while adding sign-in, email verification, prepaid-code redemption, and Stripe-based paid access.
It is built for a simple model: Nginx stays at the edge, static content stays static, and a small React + FastAPI layer handles auth, purchase, and permission sync.
- Protect static docs or course pages behind authentication.
- Support both prepaid-code activation and self-serve Stripe checkout.
- Keep public pages, app pages, and protected docs loosely coupled.
- Stay deployable on a small Linux VPS without Docker.
This repository powers the gated content flow for:
https://dajuan.fseasy.top
Prepaid code flow
Admin -> generate code -> user signs in -> user redeems code -> backend marks user paid -> docs become available
Stripe flow
User -> open purchase page -> create checkout session -> Stripe webhook updates DB -> after-pay sync updates roles -> docs become available
confgen/: unified config generator for frontend env, backend env, and Nginx config.frontend/: React SPA for auth UI, dashboard, purchase flow, and admin tools.backend/: FastAPI service for user state, prepaid codes, Stripe, and internal auth checks.deploy/: Linux deployment scripts for non-Docker installs.
Browser
|
v
Nginx
|-- /app/... ------------------> React SPA
|-- /api/... ------------------> FastAPI backend
|-- /docs/... -> auth_request -> FastAPI internal auth check
| |-- verify local JWT
| |-- check email verification
| `-- check paid role
`-- / --------------------------> public static site
- Fast docs auth path: protected docs use local JWT verification instead of calling SuperTokens core on every request.
- Nginx
auth_requestis the gatekeeper, so protected docs can stay static. - Nginx auth caching reduces repeated backend auth work.
confgenkeeps frontend, backend, and Nginx config aligned.- The stack is tuned for low-resource VPS deployment.
For day-to-day development, the main entry is:
./run_dev_all.shThat script starts:
- the frontend dev server
- the backend dev server
Before that, you still need environment files generated by confgen and a working local Nginx setup if you want to test the full gated-doc flow.
On Linux, the intended deployment path is simple: prepare the machine once, then deploy/update with the second script.
cd deploy && \
./env_init.sh && \
./project_init_and_update.sh --mode deving/servingSee deploy/README.md for the details.