Skip to content

LahkLeKey/K3H4

Repository files navigation

image

K3H4 Monorepo

Bun/TypeScript workspace with a React/Three.js frontend and a Fastify + Prisma API backend. Docker compose is available for local stack spins.

Structure

  • apps/www.k3h4.io – Bun + React + R3F frontend

    • image
  • apps/api.k3h4.io – Fastify API with Prisma/Postgres

  • scripts/ – shared scripts and tooling

  • sidecars/ollama – Ollama-based LLM sidecar for api.k3h4.io (Docker Compose + Fly)

Requirements

  • Bun (for both apps)
  • Docker + Docker Compose (for local Postgres and API via compose)
  • Node-compatible toolchain (for editor/TS)

Environment

  • Frontend: apps/www.k3h4.io/.env with API_URL, GITHUB_CLIENT_ID, LINKEDIN_CLIENT_ID
  • Backend: apps/api.k3h4.io/.env with DATABASE_URL, GITHUB_CLIENT_ID/SECRET, LINKEDIN_CLIENT_ID/SECRET, JWT_SECRET, CORS_ORIGIN

Quick Start

  1. Install deps
bun install
  1. Run via Docker Compose (API + DB)
docker compose up --build
  1. Start frontend (from repo root)
cd apps/www.k3h4.io
bun run dev

API docs available at ${API_URL}/docs.

LLM sidecar

  • docker compose up --build now also brings up sidecars/ollama. The Fastify server hits OLLAMA_URL=http://ollama:11434, so the stacking works locally without extra networking.
  • Docker Compose now binds the host-side ./sidecars/ollama/data directory so the mount exists automatically and caches the models that the entrypoint pulls from sidecars/ollama/preload-models.txt.
  • Production deploys the sidecar as its own Fly app (api-k3h4-io-ollama) using the configuration in sidecars/ollama/fly.toml, which currently targets a shared-cpu-1x slice with 2 GB of RAM.
  • Point the API app at http://api-k3h4-io-ollama.internal:11434 (e.g. via fly secrets set OLLAMA_URL=...) to reach the sidecar over Fly’s internal network.

Useful Tasks (VS Code)

  • compose:up / compose:down – bring stack up/down
  • bun:dev (frontend) – run web dev server

Notes

  • OAuth callbacks expected at http://localhost:5173/auth/callback/{provider}.
  • API exposes /auth/{provider}/url and /auth/{provider}/callback for GitHub/LinkedIn.
  • Prisma schema is under apps/api.k3h4.io/prisma/; migrations tracked there.

About

My Dev Site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages