Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ v1 Public template
forked from midday-ai/v1

An open-source starter kit based on Midday. Ported to Drizzle and Better Auth

License

Notifications You must be signed in to change notification settings

DivinPrince/v1

 
 

Repository files navigation

hero

Create v1

An open-source starter kit based on Midday.

Website · Issues · What's included · Prerequisites · Getting Started · How to use

Everything you need to build a production ready SaaS, it's a opinionated stack based on learnings from building Midday using the latest Next.js framework, it's a monorepo with a focus on code reuse and best practices that will grow with your business.

What's included

Next.js - Framework
Turborepo - Build system
Biome - Linter, formatter
TailwindCSS - Styling
Shadcn - UI components
TypeScript - Type safety
Better Auth - Authentication
Drizzle ORM - Type-safe ORM
Upstash - Cache and rate limiting
React Email - Email templates
Resend - Email delivery
i18n - Internationalization
Sentry - Error handling/monitoring
Dub - Sharable links
Trigger.dev - Background jobs
OpenPanel - Analytics
Polar - Billing (coming soon)
react-safe-action - Validated Server Actions
nuqs - Type-safe search params state manager
next-themes - Theme manager

Directory Structure

.
├── apps                         # App workspace
│    ├── api                     # API routes and server-side logic
│    ├── app                     # App - your product
│    ├── web                     # Marketing site
│    └── ...
├── packages                     # Shared packages between apps
│    ├── analytics               # OpenPanel analytics
│    ├── auth                    # Better Auth configuration
│    ├── db                      # Drizzle ORM schema and queries
│    ├── email                   # React email library
│    ├── jobs                    # Trigger.dev background jobs
│    ├── kv                      # Upstash rate-limited key-value storage
│    ├── logger                  # Logger library
│    └── ui                      # Shared UI components (Shadcn)
├── tooling                      # are the shared configuration that are used by the apps and packages
│    └── typescript              # Shared TypeScript configuration
├── .cursorrules                 # Cursor rules specific to this project
├── biome.json                   # Biome configuration
├── turbo.json                   # Turbo configuration
├── LICENSE
└── README.md

Prerequisites

Bun
Docker
PostgreSQL
Upstash
Dub
Trigger.dev
Resend
Better Auth
Sentry
OpenPanel

Getting Started

Clone this repo locally with the following command:

bunx degit midday-ai/v1 v1
  1. Install dependencies using bun:
bun i
  1. Copy .env.example to .env and update the variables.
# Copy .env.example to .env for each app
cp apps/api/.env.example apps/api/.env
cp apps/app/.env.example apps/app/.env
cp apps/web/.env.example apps/web/.env
  1. Start the development server from either bun or turbo:
bun dev // starts everything in development mode (web, app, api, email)
bun dev:web // starts the web app in development mode
bun dev:app // starts the app in development mode
bun dev:api // starts the api in development mode
bun dev:email // starts the email app in development mode

// Database
bun db:push // push schema changes to database
bun db:studio // open Drizzle Studio to manage your database
bun db:seed // run seed data

How to use

This boilerplate is inspired by our work on Midday, and it's designed to serve as a reference for real-world apps. Feel free to dive into the code and see how we've tackled various features. Whether you're looking to understand authentication flows, database interactions, or UI components, you'll find practical, battle-tested implementations throughout the codebase. It's not just a starting point; it's a learning resource that can help you build your own applications.

With this, you have a great starting point for your own project.

Deploy to Vercel

Deploy with Vercel

Recognition

Featured on Hacker News

About

An open-source starter kit based on Midday. Ported to Drizzle and Better Auth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.1%
  • JavaScript 1.6%
  • CSS 1.3%