DevChama is a local‑first, event‑sourced learning & collaboration platform for small developer investment groups ("chamas"). Members propose learning tracks, stake funds on sprints, submit work, peer‑review, earn points, and distribute pooled rewards.
- React 19 + TypeScript
- Livestore (local-first sync & SQLite event materialization)
- Vite + Bun
- Cloudflare Worker sync backend (
@livestore/sync-cf) - PWA (service worker + manifest + installable icons)
- Event Sourcing: Domain events (v1.*) are committed and materialized into SQLite tables.
- Local-first: Works offline; sync applies when connectivity returns.
- Voting: Sprint proposals require majority approval of 5-member chama.
- Scoring: Approvals (+10) / rejections (−5) influence leaderboard & rewards.
- Rewards: Top 3 eligible contributors split 50% / 30% / 20% of reward pool.
| Event | Purpose |
|---|---|
| v1.UserCreated / v1.UserUpdated | Manage user identity & wallet balance |
| v1.ChamaCreated / v1.ChamaUpdated | Manage chama membership & fund balance |
| v1.TrackCreated | Learning track definition |
| v1.SprintCreated / v1.SprintUpdated | Sprint lifecycle (proposed → active → completed/rejected) |
| v1.SubmissionCreated | Code / PR submission |
| v1.ReviewCreated | Peer review decision |
| v1.SprintVoteCast | Governance voting (approve / reject) |
| v1.LeaderboardUpdated | Leaderboard row materialization |
| v1.RewardAssigned | Reward distribution record |
# Clone & install
bun install
# (Optional) Run local sync worker (Cloudflare):
# wrangler dev (if configured)
# Start app (includes registering service worker)
export VITE_LIVESTORE_SYNC_URL='http://localhost:8787'
bun run devVisit: http://localhost:5173 (default Vite port)
bun run testUses Vitest; tests live in tests/ (scoring, submissions, reviews).
bun run buildOutputs production bundle to dist/.
public/manifest.jsonpublic/sw.js(versioned precache + runtime strategies, offline fallback)- Icons:
icon-192.svg,icon-512.svg
GitHub Actions workflow: .github/workflows/ci.yml runs install, build, and tests on pushes & PRs.
- Install Bun (https://bun.sh)
- Copy
.env.example(if present) →.env, setVITE_LIVESTORE_SYNC_URL - Start local sync worker (or point to deployed URL)
- Run
bun run dev - Register or create a chama, propose a sprint after 5 members join.
- Member proposes sprint (status = proposed)
- Members cast
v1.SprintVoteCastevents - When approvals >= majority (ceil(members/2)) and members == 5:
- Chama fund decremented by stake
- Sprint becomes active
- Rejection majority marks sprint rejected
On sprint completion (FinalizeSprint):
- Leaderboard recalculated
- Top 3 with >0 points receive rewards (50/30/20)
v1.RewardAssignedevents recorded
- Core shell & icons precached
- Runtime caching for static assets (stale-while-revalidate)
- Navigation fallback to
/when offline
- Add end-to-end tests (Playwright)
- Configurable voting thresholds
- Wallet transaction ledger table
- Enhanced access control & auth
Proprietary / Internal (adjust as needed)