Built with LifeTech4Cloud — © 2025 Lê Hùng Quang Minh & Phạm Minh Đức — Original
Lifetech4Cloud is an open-source platform that combines Discord-first authentication, a coin-based VPS marketplace, rewarded ads, and an automated worker fleet for provisioning NVIDIA-powered lab machines. The backend is a production FastAPI stack with PostgreSQL + Redis, the workers are Puppeteer-driven Node services that keep NVIDIA DLI sessions alive, and the UI layer uses a Vite + React dashboard that can be iterated from Lovable.
- Discord OAuth2 login with PostgreSQL persistence, signed HttpOnly sessions, health checks, and a minimal test client for quick verification.
- Coin economy + VPS marketplace that lets end users buy Linux, Windows, or sandbox VMs while admins manage balances, products, and worker pools.
- Worker automation tier (Node.js + Puppeteer + Cloudflared) that logs into NVIDIA DLI, creates VMs, streams logs/RDP credentials, and enforces slot/timer policies entirely server-side.
- Rewarded ads stack (Monetag, Google Ad Manager/IMA, nonce-protected claims, Turnstile bot guard, adaptive throttling, Prometheus metrics) to let users earn credits before provisioning a VPS.
- Support inbox & assistant tooling featuring Kyaro AI prompts, inbox escalation, and audit trails so operators can close the loop with users.
- Open governance via the Attribution Certificate that keeps reuse possible while guaranteeing credit for the original maintainers.
| Path | Description |
|---|---|
backend/ |
FastAPI application, Alembic migrations, ads reward logic, admin/user APIs, docs, and the Lovable-generated React frontend (backend/frontend/). |
backend/generate_vps/ |
Legacy Playwright-based VM generator rewritten from Node to Python, useful for migration references or air-gapped deployments. |
worker/ |
Standalone Node.js worker service (Express + Puppeteer + cloudflared) that authenticates against NVIDIA, spawns Linux/Windows/Dummy sessions, and streams logs. |
.github/ |
GitHub workflows, issue templates, and metadata for CI/CD. |
worker/Workers_Docs.md, backend/WORKER_SYSTEM_SUMMARY.md, backend/API_USAGE_GUIDE.md |
Deep dives into worker APIs, provisioning flows, and available HTTP endpoints. |
Users <-> FastAPI backend <-> PostgreSQL/Redis
|
Worker selector ---> Worker servers (Node + Puppeteer + NVIDIA DLI)
|
Ads providers / Turnstile / Prometheus
- Backend (FastAPI) - Handles Discord OAuth2, sessions, coins ledger, rewarded ads, SSE streaming, admin dashboards, and serves static assets from
root-be/. Alembic migrations run automatically on startup. Rewarded ads support Monetag and Google IMA with nonce issuance, Turnstile verification, SSV checks, and adaptive throttling. - Worker fleet (Node.js) - Each worker exposes
/yud-ranyisi,/vm-loso,/log/:route, and/stop/:route. Workers keep aworker-tokens.json, enforce slot TTLs, and proxy SSH/RDP endpoints via cloudflared tunnels. The backend never exposes worker URLs to clients; it proxies all log and stop requests. - Frontend - A React + Vite dashboard (generated via Lovable) consumes the backend REST + SSE APIs. You can keep using Lovable for AI-assisted edits or run it locally with
npm run devinsidebackend/frontend/.
- Docker + Docker Compose (for the FastAPI stack, PostgreSQL, Redis, and worker simulator)
- Python 3.11+ with
pipif you plan to run the backend outside Docker - Node.js 20+ for the worker service
- pnpm/npm if you want to iterate on the Lovable frontend locally
cp backend/.env.example backend/.env
docker compose -f backend/docker-compose.yml up --buildThe stack exposes FastAPI on http://localhost:8000. Visit / for the OAuth test client, /docs for the OpenAPI schema, and /health for readiness. Environment variables for Discord, ads, Turnstile, Redis, and Postgres are documented in backend/README.md.
cd worker
npm install
npm run start # requires Chrome/Chromium for PuppeteerWorkers default to port 4000, log in to NVIDIA DLI via Puppeteer, and keep tunnels alive. Use npm run start:tunnel if you want the worker and cloudflared tunnel to run side-by-side during local testing.
cd backend/frontend
npm install
npm run devLovable automatically syncs commits back to this repository, but running it locally gives you full control over Tailwind, shadcn, and the Vite dev server.
- VPS lifecycle -
POST /vps/purchase-and-creatededucts coins, selects the least-loaded worker, calls/vm-loso, persists the worker route, and streams progress via/vps/sessions/{id}/events. Deleting a VPS calls/stop/:routeand releases the token slot. - Rewarded ads -
/ads/prepareissues signed nonces after Turnstile,/ads/claimvalidates provider payloads (Monetag ticket or GAM SSV), applies throttling, and credits wallets through Redis-backed idempotency locks. - Support + AI inbox - Admins can triage tickets, edit Kyaro AI prompts, and audit assistant actions using the helper scripts and docs under
backend/docs/.
- Backend - Run
pytest,ruff check, andmypy .frombackend/. Compose files ship a Postgres container so integration tests can run locally. Seebackend/API_USAGE_GUIDE.mdfor HTTP fixtures. - Worker - Use
npm run devpluscurling the/health,/vm-loso, and/log/:routeendpoints. Theworker/Workers_Docs.mdfile doubles as a contract/integration checklist. - Frontend - Standard Vite workflow:
npm run lintandnpm run test(if configured) insidebackend/frontend/. Lovable deployments can be published from the project dashboard.
- Fork and clone the repository.
- Create feature branches targeting
main. - Keep backend typing + linting green and include worker contract tests or recorded logs whenever you change provisioning logic.
- Document new APIs in
backend/docs/and update this README if you add/break major flows. - Open a pull request; GitHub Actions will run backend tests automatically.
Need support? Check the docs under backend/docs/ or open a discussion in the repository.
To comply with the LifeTech4Cloud Attribution License v1.0, include the following credit line in any redistribution, UI footer, README, or documentation.
> Built with LifeTech4Cloud — © 2025 Lê Hùng Quang Minh & Phạm Minh Đức — [Original](https://github.com/lt4c/lifetech4cloud)
<p>Built with LifeTech4Cloud — © 2025 Lê Hùng Quang Minh & Phạm Minh Đức — <a href="https://github.com/lt4c/lifetech4cloud" target="_blank" rel="noopener">Original</a></p><footer className="text-xs opacity-60">
Built with LifeTech4Cloud — © 2025 Lê Hùng Quang Minh & Phạm Minh Đức — <a href="https://github.com/lt4c/lifetech4cloud" target="_blank" rel="noopener">Original</a>
</footer>Built with LifeTech4Cloud — © 2025 Lê Hùng Quang Minh & Phạm Minh Đức — Original: https://github.com/lt4c/lifetech4cloud
This project remains under the Lifetech4Cloud Attribution Certificate v1.0. See CERTIFICATE.md for full terms.