Skip to content

josheche/monolith-industries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Monolith Industries

MONOLITH INDUSTRIES

Highly-opinionated, enterprise-grade Next.js infrastructure for one person.

Deploy with Vercel

Get Started Β· What's Included Β· Customization


What's Included

Layer Stack Status
Auth Supabase Auth, magic link/OTP, signup + login pages, useOtpFlow hook Ready
Database Supabase Postgres, Drizzle ORM, empty schema Ready
Background Jobs pg-boss worker scaffold Ready
Error Monitoring Sentry client/server/edge, session replay, /monitoring tunnel Ready
Analytics Vercel Analytics + Speed Insights Ready
Design System Tailwind v4 + shadcn/ui, zinc + indigo tokens Ready
Tooling ESLint, Prettier, Husky, lint-staged, madge Ready
E2E Tests Playwright auth flows against real local Supabase Ready

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Vercel          β”‚     β”‚  Railway (optional)   β”‚
β”‚  Next.js App     β”‚     β”‚  Worker (pg-boss)     β”‚
β”‚                  β”‚     β”‚  Background jobs      β”‚
β”‚  Dashboard (CSR) β”‚     β”‚                       β”‚
β”‚  API Routes      β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
         β”‚                          β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚  Supabase Cloud       β”‚
         β”‚  - Postgres (Drizzle) β”‚
         β”‚  - Auth (magic link)  β”‚
         β”‚  - Storage (media)    β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

Prerequisites: Node.js 24 LTS (.nvmrc included), Docker Desktop

git clone https://github.com/josheche/monolith-industries.git
cd monolith-industries
npm install
cp .env.example .env.local

npx supabase start          # start local Postgres, Auth, Storage, Mailpit
npx supabase status          # copy URLs + keys into .env.local

npm run dev                  # http://localhost:3000
npm run worker               # optional: background job worker
Service URL
App http://localhost:3000
Supabase Studio http://127.0.0.1:54323
Mailpit (emails) http://127.0.0.1:54324
Supabase API http://127.0.0.1:54321

Environment Variables

Core (.env.local for dev, Vercel for production):

NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
DATABASE_URL=

Sentry (Vercel only):

NEXT_PUBLIC_SENTRY_DSN=
SENTRY_ORG=
SENTRY_PROJECT=
SENTRY_AUTH_TOKEN=

Scripts

npm run dev            # Next.js dev server (Turbopack)
npm run worker         # pg-boss background worker
npm run build          # production build
npm run lint           # ESLint
npm run format         # Prettier
npm test               # Vitest
npm run check:circular # madge circular dep check
npx playwright test    # E2E auth flow tests

Database

Schema starts empty at src/db/schema.ts. Add your tables:

npx drizzle-kit generate   # create migration
npx drizzle-kit migrate    # apply migration

E2E Tests

cp .env.test.example .env.test   # fill from `npx supabase status`
npx playwright test              # requires local Supabase + dev server

Tooling

Every commit runs through:

git commit β†’ Husky pre-commit
  β”œβ”€β”€ lint-staged (eslint --fix + prettier --write)
  └── madge --circular

Prettier: no semi, single quotes, trailing commas, 100 char width ESLint: flat config, Next.js Core Web Vitals + TypeScript TypeScript: strict mode, @/* path alias

Customization

  1. Brand β€” replace "Monolith Industries" in page.tsx, auth pages, dashboard layout
  2. Accent color β€” swap indigo values in globals.css (:root and .dark)
  3. Fonts β€” change in layout.tsx via next/font
  4. Domain tables β€” add to src/db/schema.ts, generate + migrate
  5. API routes β€” add under src/app/api/
  6. Background jobs β€” add in src/worker/jobs/, register in src/worker/index.ts

Deployment

Vercel β€” auto-deploys on push to main Railway (worker, optional) β€” start command: npm run worker Supabase β€” create cloud project, run migrations, configure SMTP (Resend)


Next.js 16 Β· TypeScript Β· Tailwind v4 Β· shadcn/ui Β· Drizzle Β· Supabase Β· pg-boss Β· Sentry Β· Vercel Analytics Β· Vitest Β· Playwright

Releases

No releases published

Packages

 
 
 

Contributors