Skip to content

cellajs/cella

Repository files navigation


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! ✉️ [email protected]

Contents

Installation

Step 1

Clone project & open directory

git clone [email protected]:cellajs/cella.git && cd cella

Env variables

Create a .env in env folder with .env.example. Minimum requirement is DATABASE_URL variable.

Step 2

There are three ways to run Cella:

A: Directly on local machine (Recommended for active devs)

Prerequisites

  • Node: Check your Node version with node -v. Install Node 20.x using Volta.
  • pnpm: Check your pnpm version with pnpm -v. Install pnpm 8.x using Volta.
  • Postgres: Install PostgreSQL 16.x on your machine, for example using Postgres.app if you are on a Mac.

Install dependencies

pnpm install

Populate database

If starting from scratch, you will need to run a database generate + migrate.

pnpm run generate
pnpm run migrate

Check it out at http://localhost:3000:

pnpm run dev
B: From inside a VS devcontainer (Not yet stable)

Prerequisites

Run devcontainer

  • Open VSCode and click one of these buttons to run the container: Screenshot
  • Alternatively, open the project in VSCode and use ⌘+⇧+p to run the Remote-Containers: Reopen in Container command.

Start command in container terminal:

pnpm run dev

Problems?

  • Rebuilding the docker container: Just open Orbstack and delete the container and volume that has cella in the name.
  • CORS issues: Make sure to open http://localhost:3000/ and not http://127.0.0.1:3000/
C: As basic docker container (Not yet stable)

Prerequisites

Run docker

pnpm run docker

Step 3

The users seed is required to add an ADMIN user. There is also an optional seed to add more data with faker.js. In a container? Access the (backend) container to run the seeds.

pnpm run seed:users
pnpm run seed:organizations

Use Drizzle Studio to manage your local db on local.drizzle.studio

pnpm run studio

API documentation

Cella has autogenerated API docs. View on local at localhost:4000/docs

More info

  • Cella uses Biome. Please install it for a correct code style. For manual lint fixing run pnpm run check:fix for type errors 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


💙💛 Built on top of amazing OS projects! drizzle-orm, hono, tanstack-router, electric-sql & shadcn.