https://github.com/okupter/kitforstartups Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} okupter / kitforstartups Public * Notifications * Fork 6 * Star 270 The Open Source SvelteKit SaaS boilerplate. License MIT license 270 stars 6 forks Activity Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights okupter/kitforstartups This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 2 branches 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/o] Use Git or checkout with SVN using the web URL. [gh repo clone okupte] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @JustinyAhin JustinyAhin Create LICENSE ... ea5b5ba Sep 25, 2023 Create LICENSE ea5b5ba Git stats * 98 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time docker Use postgres-js in place of node-postgres September 12, 2023 09:56 src increase profile picture db column max length September 25, 2023 19:09 static Initial commit September 2, 2023 08:58 .env.example Use postgres-js in place of node-postgres September 12, 2023 09:56 .eslintignore Initial commit September 2, 2023 08:58 .eslintrc.cjs Initial commit September 2, 2023 08:58 .gitignore moving files around September 6, 2023 15:08 .npmrc Initial commit September 2, 2023 08:58 .prettierignore Initial commit September 2, 2023 08:58 .prettierrc Initial commit September 2, 2023 08:58 LICENSE Create LICENSE September 25, 2023 21:37 README.md Update README.md September 15, 2023 13:24 package.json Add Toast component September 14, 2023 12:28 pnpm-lock.yaml Add Toast component September 14, 2023 12:28 postcss.config.cjs move files around September 6, 2023 09:19 svelte.config.js Add Toast component September 14, 2023 12:28 tailwind.config.cjs move files around September 6, 2023 09:19 tsconfig.json Initial commit September 2, 2023 08:58 vercel.json Create vercel.json September 5, 2023 08:56 vite.config.ts Initial commit September 2, 2023 08:58 View code KitForStartups [?][?] Tech Stack Getting Started Prerequisites Installation Changing the database [?] Roadmap README.md KitForStartups The Open Source SvelteKit SaaS boilerplate. KitForStartups is a starter kit for building and shipping fast, secure, and scalable full stack SaaS applications with SvelteKit and TypeScript. If you already found yourself in a situation where you were: * Trying to set up various authentication systems (email/password, social logins, OAuth, etc.) * Scratching your head over how to structure your app * Spending too much time setting up payments for your SvelteKit app either with Stripe or Lemon Squeezy * Fighting against your email provider for sending emails from your app, and testing them reliably on your local machine * Doing all the above again and again for every new project Then KitForStartups is for you ! [?][?] Tech Stack * SvelteKit * TypeScript * Drizzle ORM * Drizzle Kit * Tailwind CSS * MySQL * SQLite * PostgreSQL * Stripe (coming soon) * Lemon Squeezy (coming soon) * Resend * Mailgun (coming soon) Getting Started The default configuration for the project uses MySQL as a database. Prerequisites * Node.js 18+ * MySQL 8.1+ * pnpm * Docker Compose (optional) Installation 1. Setup * Clone or fork the repository: git clone https://github.com/okupter/kitforstartups my-project 2. Install dependencies cd my-project pnpm install 3. Setup the environment variables Duplicate the .env.example file and rename it to .env. Then, fill in the values for the environment variables. cp .env.example .env 4. Setup the database For easy local development, there is a ./docker/mysql.yml file that you can use to spin up a MySQL database in a Docker container. If you don't want to use Docker, you can install MySQL locally and skip this step. docker-compose -f docker/mysql.yml up -d Remember to update the MYSQL_* environment variables in the .env file with your database credentials. 5. Run the migrations We use Drizzle Kit for automatic SQL migrations and prototyping. To run the migrations for MySQL, run the following command: pnpm generate-migrations:mysql This will generate the SQL migrations, as well as migrations metadata files in the ./src/lib/drizzle/mysql/migrations/data directory. You can now run the following command to push the migrations to the database: pnpm migrate:mysql In early stage of development or when you're at the prototyping stage, you can use directly update the database schema and run the following command to directly push the schema changes to the database: pnpm push:mysql 6. Setup MailHog for local email testing We use MailHog to send and test emails locally. The boilerplate is configured to automatically send emails to MailHog when running in development mode. Check ./src/lib/emails/send.ts for more details about the implementation. We also provide a Docker Compose file to quickly spin up a MailHog container. docker-compose -f docker/mailhog.yml up -d The MailHog server will be available at http://localhost:8025. 7. Run the app pnpm dev Changing the database Right now, there is no CLI or configuration file to change the database. You will have to do some search and replace in the codebase to change the database. The default database is MySQL. If you want to use PostgreSQL, you will have to: * Change occurences of $lib/lucia/mysql to $lib/lucia/postgres in the ./src directory * Change occurences of $lib/drizzle/mysql/models to $lib/drizzle/ postgres/models in the ./src directory This should be enough to get you started with PostgreSQL. PS: This won't be necessary in the future, as we plan to add a central configuration file for the app and a CLI to generate a starter project with the database of your choice. [?] Roadmap KitForStartups is still in the early stages of development. Here is a list of features that we plan to add in the very near future: * [*] PostgreSQL support * [*] Proper error handling on the client with toast notifications * [ ] A central configuration file for the app * [ ] Magic link authentication * [*] Authorization logic with load functions and hooks * [ ] Stripe integration * [ ] Lemon Squeezy integration * [ ] Mailgun integration * [ ] CLI for generating a starter project About The Open Source SvelteKit SaaS boilerplate. Resources Readme License MIT license Activity Stars 270 stars Watchers 9 watching Forks 6 forks Report repository Contributors 2 * @JustinyAhin JustinyAhin Justin Ahinon * @Bloeckchengrafik Bloeckchengrafik Christian Bergschneider Languages * TypeScript 76.5% * Svelte 18.7% * JavaScript 2.5% * CSS 1.8% * HTML 0.5% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.