Single stack TypeScript template to build local-first SaaS.
Website
·
prerelease version
·
MIT license
❗ Please be aware this is a prerelease. It does not meet production requirements yet and large breaking changes still occur regularly. Want to contribute? Let's connect! ✉️ [email protected]
- Node: Check node with
node -v. Install Node 20.x or 22.x with (recommended) Volta. - Docker: Install Orbstack or Docker
git clone [email protected]:cellajs/cella.git && cd cellaCreate a .env in /env folder. Minimum is DATABASE_URL, ELECTRIC_SYNC_URL, ELECTRIC_PRIVATE_KEY_ES256. Recommended defaults are in .env.example. Then install:
pnpm installMake sure docker runs in the background with a postgres db in it, or skip this and use supabase instead.
pnpm run dockerOr, use Supabase as a database. Add the SUPABASE_DATABASE_URL to .env file. Then run:
pnpm run docker:supabaseCella adopted a local-first strategy, whereby page-related resources are handled normally by an API, whereas content-related resources are fully handled local-first using ElectricSQL.
Therefore, generate and migrate commands will execute both for normal schemas and for electric schemas in /backend.
pnpm run generate
pnpm run migrate Generate local-first sync layer in /frontend with ElectricSQL
pnpm run electrifyCheck it out at localhost:3000
pnpm run devThe user seed is required to add an ADMIN user. Check /backend/seed to add more data with faker.js.
pnpm run seed:user
pnpm run seed:organizationsUse Drizzle Studio to manage your local db on local.drizzle.studio
pnpm run studioCella uses Scalar for autogenerated OpenAPI docs. They are update automatically on local at localhost:4000/docs
- Cella uses Biome. Please install it for a correct code style. For manual lint fixing run
pnpm run check:fixfor type errorspnpm run check:types - EADDRINUSE errors? Try
sudo lsof -i :1080 -i :3000 -i :4000and thenkill -9 *PID*with a space-separated list ofPID - pnpm cache issues? Try
pnpm store prune - turbo cache issues? Try adding
--forceto the command - docker cache issues? Try
docker builder prune --force
💙💛 Big thank you too drizzle-orm, hono, tanstack-router, electric-sql & shadcn.