ndom91 / sveltekasten

Home Page:https://sveltekasten.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“¬ Briefkasten v2

GitHub issues GitHub Demo

  
🚧 Experimental Svelte rewrite of Briefkasten 🚧

Note

This is the temporary repository for Briefkasten V2. I will move this code to the original ndom91/briefkasten repository as we get closer to GA release. However, if you'd like to help out, don't hesitate to file issues here, etc. For more info, check out this discussion post.

πŸš€ Getting Started

This is setup as a monorepo with (1) apps/web being a SvelteKit web application and (2) apps/backend being a Hono-based API. There are npm scripts in the root package.json to control most things.

  1. Clone the repository
$ git clone git@github.com:ndom91/sveltekasten.git && cd sveltekasten
  1. Install dependencies
$ pnpm install

This will install the dependencies for both apps.

  1. Both web and backend need separate .env files. Copy both /apps/{web,backend}/.env.example files to .env, and open them with your favorite text editor to fill in your environment variables.
$ cd apps/web && cp .env.example .env
$ cd apps/backend && cp .env.example .env

In these environment variable files, make sure to at least fill in the DATABASE_URL, AUTH_SECRET, JWT_SECRET, WORKER_URL and one Auth.js authentication provider, so for example AUTH_GITHUB_ID, AUTH_GITHUB_SECRET. The rest of the environment variables depend on the services / features you want to use.

  1. Start the server!
// First time only; apply the schema to your database
$ pnpm db:push

// dev
$ pnpm dev

// prod
$ pnpm build
$ pnpm start

πŸ‹ Docker

You can run the entire stack yourself via Docker, there are multiple variants depending on if you want to self-host everything or want to rely on some cloud services.

  • docker-compose.yml - Containers for the frontend and backend components of the application
  • docker-compose.storage.yml - Additional postgres and minio containers for a database and object storage. You can skip this container if you want to use a hosted database provider and an S3-compatible object storage provider, for example.
  1. Run web and backend in the background
docker compose up -d
  1. Run web and backend and additional database and object storage containers
docker compose -f docker-compose.yml -f docker-compose.storage.yml up -d
  1. Run web and backend containers with local code mounted in for development
docker compose -f docker-compose.local-dev.yml up -d

πŸ‘· Contributing

This project is open to all contributions. Please stick to the repo settings and I'll be happy to take a look at your issue / PR!

Note that this repository will be nuked relatively soon and all code will be moved to the main ndom91/briefkasten repository

πŸ“ License

MIT

About

https://sveltekasten.vercel.app

License:MIT License


Languages

Language:TypeScript 76.0%Language:Svelte 22.2%Language:JavaScript 1.3%Language:CSS 0.3%Language:Dockerfile 0.1%Language:Nix 0.1%Language:HTML 0.1%