cellajs / cella

TypeScript template to build local-first SaaS with hono + pg + drizzle + electric-sql + react + shadcn.

Home Page:https://cellajs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Cella

Single stack TypeScript template to build local-first SaaS.

Website · prerelease version · MIT license



Prerelease

❗ 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! ✉️ info@cellajs.com

Contents

Installation

Prerequisites

  • Node: Check node with node -v. Install Node 20.x or 22.x. (ie. Volta).
  • Docker: Install Orbstack or Docker

Step 1

git clone git@github.com:cellajs/cella.git && cd cella

Create a .env in /env folder. Recommended defaults are in .env.example. Then install:

pnpm install

Make sure docker runs in the background with a postgres db in it.

pnpm run docker

Step 2

Page-related resources are handled by a conventional API. Content-related resources are use a local-first strategy with 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 electric

pnpm run electrify

Check it out at localhost:3000 after

pnpm run dev

Step 3

The user seed is required to add an ADMIN user

pnpm run seed

Manage your local db on local.drizzle.studio

pnpm run studio

API documentation

Autogenerated OpenAPI docs. Docs refresh on changes at localhost:4000/docs

More info

  • Please install Biome for code style. Fix with pnpm run check:fix and type check with pnpm run check:types
  • EADDRINUSE errors? Try sudo lsof -i :1080 -i :3000 -i :4000 and then kill -9 *PID* with a space-separated list of PID
  • pnpm cache issues? Try pnpm store prune
  • turbo cache issues? Try adding --force to the command
  • docker cache issues? Try docker builder prune --force


💙💛 Big thank you too drizzle-orm, hono, tanstack-router, electric-sql & shadcn.

About

TypeScript template to build local-first SaaS with hono + pg + drizzle + electric-sql + react + shadcn.

https://cellajs.com

License:MIT License


Languages

Language:TypeScript 90.6%Language:JavaScript 8.6%Language:CSS 0.6%Language:HTML 0.2%