Codync
무료 오픈소스 1:1 대안, Grok Bot과 Muse 대신
저장소 정보는 아직 수집하지 않았습니다.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
Template Vue Nodejs uWebsoketJs
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗📖 Documentation: https://blazheiko.github.io/vibe-template/ (Ukrainian, backend-focused;
source in documentation/, run locally with pnpm docs:dev).
A full-stack TypeScript monorepo template: a Vue 3 frontend, a high-performance uWebSockets.js backend, and a shared package for contracts (schemas, enums, guards, responses) reused on both sides of the wire.
The repository is organized as a pnpm workspace with type-safe end-to-end contracts shared between the frontend and backend.
This template is built for quickly bootstrapping production-ready SPA applications. Instead of wiring up the same foundation on every new project, you start from a working full-stack app that already ships the features most products need on day one:
Because the plumbing is already done, you can focus on your product's actual features from the first commit.
frontend package entirely,
turn off static serving (SERVE_STATIC=false) and session/CSRF handling, and
run just the backend with api-playground for convenient manual API testingBeyond the technology list, the template ships working user-facing flows you can build on (or strip out):
auth/oauth/:provider/redirect and
/callback)| Area | Included |
|---|---|
| API | uWebSockets.js, route validation, WebSocket |
| DB | PostgreSQL, Drizzle migrations (+ seed hook) |
| Auth/security | cookies, CSRF, CORS, throttling, CSP |
| Frontend | Vue 3, Pinia, i18n, PWA, Playwright |
| Observability | Sentry, Pino |
| Integrations | S3/MinIO, mail, push notifications, AI providers |
^24.22.2 (Node 24 LTS; see .nvmrc; the Docker image uses Node 24)>=9 (pinned to 9.15.0 via packageManager)| Service | Required? | Used for |
|---|---|---|
| PostgreSQL + pgvector | Required | Primary database (Drizzle ORM) |
| Redis | Required for auth/realtime | Sessions, WebSocket coordination, presence |
| S3 / MinIO | Required for storage flows | File upload / object storage |
| SMTP | Optional | Transactional / auth email |
| Sentry | Optional | Error & performance monitoring |
| AI providers (OpenAI / Mistral / xAI) | Optional | AI features |
| Telegram | Optional | Bot notifications |
To boot the database layer you need PostgreSQL; Redis is required as soon as you exercise full auth/realtime behavior (sessions, WebSocket, presence). The remaining services are optional and unlock the corresponding feature areas as you enable them.
pgvector is required, even if you never enable AI. The support knowledge base stores OpenAI embeddings in a
vector(1536)column and finds relevant articles by cosine distance (<=>) in SQL, so the schema itself depends on the extension:db:createrunsCREATE EXTENSION IF NOT EXISTS vector, and the initial migration fails withtype "vector" does not existwithout it. The stockpostgresDocker image does not include it; usepgvector/pgvector:pg16(or install pgvector for your PostgreSQL). Details: Database → pgvector.
Which optional service / env each feature needs:
| Feature | Requires |
|---|---|
| Email verification / password reset | SMTP_* settings (SMTP_ENABLED=true) |
| Phone auth | AUTH_PHONE_ENABLED=true and an SMS provider |
| Push notifications | VAPID_* keys |
| Avatar uploads / KB screenshots | S3 or MinIO (S3_*) |
| Support AI | OpenAI / xAI (and other configured providers) |
| Presence / sessions / throttling | Redis |
| Error monitoring | SENTRY_DSN |
.
├── packages/
│ ├── frontend/ # Vue 3 + Vite app (PWA, i18n, Pinia, Playwright e2e)
│ ├── backend/ # uWebSockets.js HTTP/WebSocket server (Drizzle, Redis, S3, mail, AI)
│ ├── shared/ # Shared schemas, enums, guards, responses, utils (workspace:*)
│ └── api-playground/ # Vue dev tool for exercising the backend API/WebSocket
├── documentation/ # VitePress docs site, published to GitHub Pages
├── Dockerfile # Multi-stage build: shared → frontend → backend → production image
├── init.sh # One-shot install + typecheck + lint + test + build
├── feature_list.json # Source of truth for feature ownership/status (see AGENTS.md)
└── pnpm-workspace.yaml
The backend follows a layered architecture: repository → transformer → service → controller → route, with shared schemas defining the request/response
contracts. See AGENTS.md for the full conventions.
The frontend and backend speak over HTTP + WebSocket and share a single contract package, so request/response shapes are type-checked on both sides:
flowchart LR
Frontend[Vue 3 SPA / PWA] -->|HTTP + WebSocket| Backend[uWebSockets.js backend]
Frontend --> Shared[shared schemas/responses]
Backend --> Shared
Backend --> Postgres[(PostgreSQL)]
Backend --> Redis[(Redis)]
Backend --> S3[S3 / MinIO]
Backend --> SMTP[SMTP]
Backend --> AI[AI providers]
Backend --> Sentry[Sentry]
# 1. Install all workspace dependencies
pnpm install
# 2. Configure the backend environment
cp packages/backend/.env.example packages/backend/.env
# then edit packages/backend/.env (PGSQL_*, APP_KEY, S3_*, etc.)
# 3. Build shared, then run backend + frontend dev servers in parallel
pnpm dev
.env for local developmentpackages/backend/.env.example lists every available setting. To get the app
running locally you really only need a few of them:
APP_KEY=at-least-32-characters-local-secret
FRONTEND_URL=http://localhost:5173
LANDING_URL=http://localhost:5173
# PostgreSQL
DB_CONNECTION=pg
PGSQL_HOST=127.0.0.1
PGSQL_PORT=5432
PGSQL_USER=postgres
PGSQL_PASSWORD=password
PGSQL_DB_NAME=vibe_template
# Redis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_PREFIX=uwebsocket:
Everything else (S3/MinIO, SMTP, Sentry, AI, Telegram, CSRF/CORS hardening) is opt-in — enable it when you start using the corresponding feature.
A typical human-friendly loop:
pnpm install
pnpm build:shared # shared contracts must be built before backend/frontend
pnpm dev # run backend + frontend together
pnpm typecheck
pnpm lint
pnpm test
Code style is defined by the root .prettierrc.json (4 spaces, single quotes, no
semicolons, width 100); pnpm format:check must pass. The one-off mass formatting
commit is listed in .git-blame-ignore-revs, so git blame skips it after:
git config blame.ignoreRevsFile .git-blame-ignore-revs
Before opening a PR, run the full verification chain with ./init.sh
(install → typecheck → lint → test → build) to confirm a clean checkout:
./init.sh
| Service | Default URL |
|---|---|
| Backend | http://localhost:3000 |
| Frontend | http://localhost:5173 |
| API playground | http://localhost:5174 |
| Drizzle Studio | launched via pnpm db:studio (from packages/backend) |
Run from the repository root:
| Command | Description |
|---|---|
pnpm dev | Build shared + backend, then run backend and frontend dev servers in parallel |
pnpm dev:backend / pnpm dev:frontend | Run a single package in dev mode |
pnpm build | Build every package recursively |
pnpm build:shared | Build only the shared package |
pnpm start | Start the built backend (node dist/index.js) |
pnpm typecheck | TypeScript checks across all packages |
pnpm lint / pnpm lint:fix | Lint (and auto-fix) the whole repo with ESLint |
pnpm format / pnpm format:check | Write / check Prettier formatting |
pnpm test | Run all package test suites |
pnpm clean | Clean build artifacts and node_modules |
pnpm docs:dev / pnpm docs:preview | Run the VitePress documentation site in dev mode / preview the built site |
pnpm docs:build / pnpm docs:verify | Build the documentation site / check the build (links, anchors, key pages) |
pnpm prod:local | Production-like local run: the backend serves the built SPA (scripts/prod-local.sh) |
Frontend e2e tests use Playwright:
pnpm --filter frontend test:e2e
The api-playground package is a Vue dev tool for exercising the backend's
HTTP and WebSocket endpoints by hand. Run it alongside the backend with:
pnpm dev:manual_test # builds shared, then runs backend + API playground in parallel
The playground is then available at http://localhost:5174.
The backend uses Drizzle ORM against PostgreSQL.
Useful package-level scripts (run from packages/backend):
pnpm db:create # create the database
pnpm db:generate # generate migrations from schema
pnpm db:migrate # apply migrations
pnpm db:seed # seed default LLM prompts (add --demo for demo accounts)
pnpm db:seed:prod # same, from the built dist/
pnpm db:studio # open Drizzle Studio
pnpm db:seedis safe to re-run: it inserts the three support LLM prompts (the same texts the services fall back to) and never overwrites prompts edited in the admin panel. With--demoit also creates an admin and, optionally, a regular user fromSEED_ADMIN_*/SEED_USER_*; existing users are never modified. Run it before starting the backend, which caches prompts at startup. Logic and tests live inpackages/backend/src/db/seed/; see the database docs.
All backend configuration is environment-driven. Use
packages/backend/.env.example as the reference — it documents settings for the
app, CORS/CSRF, proxy trust, phone/email auth, database, S3 storage, mail,
Telegram, Sentry, Redis, and AI providers. The frontend reads VITE_* variables
(see packages/frontend/.env.example).
Do not commit secrets. Treat auth, storage, mail, AI, and database settings as environment-specific.
A Content-Security-Policy is pre-defined in
packages/backend/src/config/csp.ts as a directives map, so you tune the policy
in one place instead of hand-writing a header string:
enabled / reportOnly — master switch and a report-only mode for safe
rollout (observe violations before enforcing).directives — default-src, script-src, style-src, img-src,
font-src, connect-src, frame-ancestors, object-src, base-uri, …connect-src is environment-aware: stricter (wss:/https:) in production,
relaxed (ws:/http:) locally so dev tooling and the WebSocket connection
work out of the box.The policy is meant to be emitted on HTML responses from the static server
(packages/backend/src/vendor/start/static-server.ts). The header-emitting code
there is currently shipped commented-out (opt-in) — uncomment buildCspValue /
setCspHeader to start sending the header, and roll it out with reportOnly: true first. Remember to add your real CDN/S3 and API origins to img-src /
connect-src before enforcing.
When you fork this template into a real product, work through:
.env files (backend and frontend)pnpm --filter backend db:create && pnpm --filter backend db:migrate)./init.sh to confirm a clean install → typecheck → lint → test → buildThe multi-stage Dockerfile builds shared, then frontend, then backend,
and copies the compiled frontend into the backend's public/ directory. The
container runs as the unprivileged user app, has a HEALTHCHECK on
/api/ping, and starts only the server (node dist/index.js). Migrations are a
separate one-shot run of the same image before each rollout:
docker build -t vibe-template .
docker run --rm --env-file production.env vibe-template pnpm db:create:prod
docker run --rm --env-file production.env vibe-template pnpm db:migrate
docker run -d -p 3000:3000 --env-file production.env vibe-template
db:create:prod runs the compiled dist/db/create-database.js, because the image has only production dependencies (no tsx). .dockerignore keeps local .env files out of the build. Details: Deployment.
Before deploying, make sure you have:
APP_KEYAPP_IS_PRODUCTION=trueTRUST_PROXY only behind a trusted reverse proxy / load balancer
(and set TRUSTED_PROXY_CIDRS accordingly)AUTH_SMS_PROVIDER_ALLOW_FAKE=false)CORS_ALLOWED_ORIGINS for your real frontend origin(s)CSRF_ENFORCE=true — after first validating in report-only modeconfig/csp.ts (add your CDN/S3 + API origins) and
enabled the header in the static server — roll out with reportOnly: trueThis template is set up for coordinated multi-developer (and AI agent) work.
feature_list.json on main is the single source of truth for who owns which
feature; per-feature progress.md and session-handoff.md live on feature
branches. Read AGENTS.md for the full startup workflow, Definition of
Done, coding style, and testing guidelines before contributing.
| Symptom | Things to check |
|---|---|
pnpm install fails | Node ^24.22.2 and pnpm 9.15.0 (node -v, pnpm -v; corepack enable) |
| Backend won't start | APP_KEY and PGSQL_* are set in packages/backend/.env, and PostgreSQL is reachable |
| E2E tests fail | Make sure frontend and backend are running (pnpm dev) before pnpm --filter frontend test:e2e |
| Drizzle / migration errors | Verify the database settings in packages/backend/.env (PGSQL_*) and that the DB exists (pnpm db:create) |
Each package keeps its own README with package-specific details:
packages/backend/README.mdpackages/frontend/README.mdpackages/api-playground/README.mdAGENTS.md — contributor workflow & conventionsOpen source and free to use — released under the MIT License. You are free to use, copy, modify, and distribute this template for any purpose, including commercially.