GithubHelp home page GithubHelp logo

fineshop / cella Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cellajs/cella

0.0 0.0 0.0 10.03 MB

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

Home Page: https://cellajs.com

License: MIT License

JavaScript 7.96% TypeScript 90.38% CSS 1.40% HTML 0.14% Dockerfile 0.11%

cella's Introduction


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

Prerequisites

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

Step 1

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

Create a .env in /env folder with .env.example. Minimum is DATABASE_URL and ELECTRIC_SYNC_URL (recommended to use existing defaults). Then install:

pnpm install

Make sure docker runs in the background with a postgres db in it, or skip this and use supabase instead.

pnpm run docker

Or, use Supabase as a database. Add the SUPABASE_DATABASE_URL to .env file. Then run:

pnpm run docker:supabase

Step 2

Cella 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 electrify

Check it out at localhost:3000

pnpm run dev

Step 3

The user seed is required to add an ADMIN user. There is also an optional seed to add more data with faker.js.

pnpm run seed:user
pnpm run seed:data

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

pnpm run studio

API documentation

Cella uses Scalar for autogenerated OpenAPI docs. They are update automatically 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


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

cella's People

Contributors

flipvh avatar romannabukhotnyi avatar gino1991 avatar aashish-upadhyay-101 avatar kevingrajeda avatar lemonardod avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.