Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanNabukhotnyi committed Nov 25, 2024
1 parent 37b2e6d commit bdafc8b
Show file tree
Hide file tree
Showing 1,171 changed files with 73,454 additions and 2 deletions.
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
vite.config.ts.*
node_modules
dist
dev-dist
out
dist-ssr
*.local

# Editor directories and files
.idea
.DS_Store
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.turbo
.env
.env.*
!.env.example
!.env.local

# Cache
*.tsbuildinfo
.sentryclirc
.million
.db

# Other
.netlify
.wrangler
backend/files
frontend/stats.html
frontend/src/generated
*.zip

## Cella
cella.diverged.txt
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-import-method=clone-or-copy
public-hoist-pattern[]=pdfjs-dist
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 cellajs
Copyright (c) 2024 CellaJS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<div align="center">

<img src="./info/screenshot-dark.png#gh-dark-mode-only" />
<img src="./info/screenshot.png#gh-light-mode-only" />

<br />

<!--
* _ _
* ░▒▓█████▓▒░ ___ ___| | | __ _
* ░▒▓█ █▓▒░ / __/ _ \ | |/ _` |
* ░▒▓█ █▓▒░ | (_| __/ | | (_| |
* ░▒▓█████▓▒░ \___\___|_|_|\__,_|
*
-->


<p>
<h1><b>Cella</b></h1>
<p>
<b>Single stack TypeScript template to build SaaS with sync & offline capabilities.</b>
<br />
<br />
<a href="https://cellajs.com">Website</a>
·
Prerelease
·
MIT license
</p>
<br />
</p>

</div>

> [!CAUTION]
> Please be aware this is a prerelease. It does NOT meet production requirements yet and large breaking changes still occur regularly. An alpha version will be released once we have solid tests for at least authentication & authorization. Want to contribute or discuss cella for one of your projects? Let's connect! ✉️ <info@cellajs.com>
#### Contents
- [Installation](#installation)
- [Architecture](/info/ARCHITECTURE.md)
- [Roadmap](/info/ROADMAP.md)
- [Deployment](/info/DEPLOYMENT.md)

## Requirements
- Make sure you have node installed with `node -v`. Install Node 20.x or 22.x. (ie. [Volta](https://docs.volta.sh/guide/)).
- Ideally you work with [git over ssh](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).

<br>

## Create your own app
Want to use cella to build your next web app? We made it simple using a short create CLI:

```bash
pnpm create @cellajs/cella@latest
```

Follow the steps in create CLI and then run your app:

```bash
pnpm quick
```

You now have an implementation-ready web app. 🤯! But ... without any unique functionality 🤓. Read the [Quickstart](/info/QUICKSTART.md) so you can build something unique quickly.


## Installation
For those that want to participate in development:

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

### A. Quick setup

```bash
pnpm install && pnpm quick
```

### B. Full setup
For a full setup - with Postgres instead of pglite - you need Docker. Install [Orbstack](https://orbstack.dev/) or [Docker](https://docs.docker.com/get-docker/).

```bash
pnpm install
pnpm docker
```

Start all servers:

```bash
pnpm dev
```

Lastly, [seed](/backend/scripts/README.md) your db (with `dev` running) to sign in as [admin user](/backend/scripts/README.md).

```bash
pnpm seed
```

Check it out at [localhost:3003](http://localhost:3003)! Generated API docs can be found at [localhost:4004/docs](http://localhost:4004/docs). Manage your local db with [local.drizzle.studio](http:local.drizzle.studio).


<br />
<br />

💙💛 Big thank you to [drizzle](https://github.com/drizzle-team/drizzle-orm), [hono](https://github.com/honojs/hono), [tanstack-router](https://github.com/tanstack/router) & [electric](https://github.com/electric-sql/electric).
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

## Reporting a Vulnerability

If you have a security issue to report, please contact us at [security@cellajs.com](mailto:security@cellajs.com).
57 changes: 57 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# DON'T EVER EXPOSE - NOT EVEN TEMPORARILY - PRODUCTION KEYS OR SECRETS IN .ENV FILE.
# FOR PRODUCTION, SET ENVIRONMENT VARIABLES MANUALLY IN THE HOSTING SERVICE.

# Node environment (required)
NODE_ENV=development

# Enable a WASM Postgres running on nodejs (required)
PGLITE=false

# Database (required)
DATABASE_URL=postgres://postgres:postgres@0.0.0.0:5432/postgres

# Secret for email unsubscribe token (required)
UNSUBSCRIBE_TOKEN_SECRET=some_secret_token

# Secret for argon2id password (required)
ARGON_SECRET=argon_two_secret

# Remote system access IP (required) (for multiple IPs, separate by comma)
REMOTE_SYSTEM_ACCESS_IP=*

# Sendgrid (optional)
SENDGRID_API_KEY=
SEND_ALL_TO_EMAIL=

# For Novu integration (optional)
NOVU_API_KEY=
NOVU_SUB_ID=
NOVU_SLACK_WEBHOOK=

# Backend port (optional)
PORT=4004

# Logtail/Better Stack (optional)
LOGTAIL_TOKEN=

# OAuth strategies (optional)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
MICROSOFT_TENANT_ID=
MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=

# TUS secret (optional)
TUS_UPLOAD_API_SECRET=

# Imado AWS credentials (all optional):
# 1. AWS S3 upload
AWS_S3_UPLOAD_ACCESS_KEY_ID=
AWS_S3_UPLOAD_SECRET_ACCESS_KEY=

# 2. AWS Cloudfront CDN
AWS_CLOUDFRONT_KEY_ID=
AWS_CLOUDFRONT_PRIVATE_KEY=

16 changes: 16 additions & 0 deletions backend/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from 'drizzle-kit';
import { dbConfig } from '#/db/db';
import { env } from './env';

const extendConfig = env.PGLITE ? { driver: 'pglite' } : {};

export default defineConfig({
schema: './src/db/schema/*',
out: './drizzle',
dialect: 'postgresql',
casing: dbConfig.casing,
...extendConfig,
dbCredentials: {
url: env.PGLITE ? './.db' : env.DATABASE_URL,
},
});
Loading

0 comments on commit bdafc8b

Please sign in to comment.