Skip to content

Commit 93b0291

Browse files
authored
feat: Starter Kit v3 for 2026 (#501)
* feat: use swap over to pnpm * feat: move old starter kit to app directory prepare for v3 * feat: add pnpm-workspace for monorepo setup * feat: add tooling packages * feat: add root package.json * feat: setup turbo generator * feat: remove old starter-kit package * feat: use latest pnpm * feat: run pnpm update * fix: prettier monorepo config * feat: add initial db package * feat: add initial ui and validator packages * feat: setup initial (non-working) web app * docs: update README * feat: inline trpc setup instead of a separate package * feat: update vscode settings.json * feat: update app defaults * fix: make eslint work * feat: setup oui and tailwind config * feat: add version check modal * feat: split public and authed routes * feat: add landing page * feat(api): add email login procedure * feat: add initial login page * fix: hoist prisma and pg modules fixes error messages like: ``` Package @prisma/client can't be external The request @prisma/client/runtime/client matches serverExternalPackages (or the default list). ``` * feat: add init migration * feat: finish auth flow * fix: correct splitLink streaming condition * feat: add redirects depending on auth state * feat: conditionally direct to admin or signin page on landing page * feat: add logout procedure * feat: tablet styling for login form * feat: migrate to prisma config file * test: setup test suite for web app * test: add user.service tests * fix: auth service issues that tests highlighted * feat: reset migrations * feat: update meRouter * feat(db): make account table singular * feat: global error handling * feat: add vercel-specific build pipeline * feat(turbo): add missing POSTMAN_API_KEY * fix: lint * fix(ci): chromatic workflow * fix(ci): update conditional to run * feat: add storybook * feat: add tooling/storybook package * feat: update storybook setup * fix: a11y issues on landing page and add story * fix(ci): add proper permissions to chromatic workflow * feat: update error handling * feat: add error handling for callerFactory * refactor: extract explicit authMiddleware * feat: add more docs for why httpBatchStreamLink is used * feat: add error handling on the trpc route handler itself too * feat: update to next16 and enable react compiler * feat: update storybook to v10 * feat(test): add test specific env instead of using local env for tests * fix: add babel-plugin-react-compiler and remove unnecessary use* calls * feat: try to figure out why vercel cannot find generated file * feat: update to vitest v4 * refactor: use _page common syntax for exported page for stories * feat: add defaultValues for email login form * feat: add msw and update vitest/browser too * feat(storybook): add sign-in page stories * ci: add more types to PR CI.yml * feat: update prisma and move to pnpm workspace * docs: update README to links to v2 * feat: update packages * feat: update starter kit to use node 24 LTS * feat: format fix * fix(storybook): flesh out mock link a little more * fix(turbo): never cache generate * feat: improve a11y of otp prefix
1 parent 3c22a8e commit 93b0291

File tree

314 files changed

+17831
-48613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+17831
-48613
lines changed

.env.example

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,15 @@
1-
# Since the ".env" file is gitignored, you can use the ".env.example" file to
2-
# build a new ".env" file when you clone the repo. Keep this file up-to-date
3-
# when you add new variables to `.env`.
1+
# Since .env is gitignored, you can use .env.example to build a new `.env` file when you clone the repo.
2+
# Keep this file up-to-date when you add new variables to \`.env\`.
43

5-
# This file will be committed to version control, so make sure not to have any
6-
# secrets in it. If you are cloning this repo, create a copy of this file named
7-
# ".env" and populate it with your secrets.
4+
# This file will be committed to version control, so make sure not to have any secrets in it.
5+
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets.
86

9-
# When adding additional environment variables, the schema in "/src/env.mjs"
10-
# should be updated accordingly.
7+
# The database URL is used to connect to your Supabase database.
8+
DATABASE_URL="postgresql://root:root@localhost:54321/app"
119

12-
# Database settings
13-
# =================
14-
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
15-
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
16-
DATABASE_URL=postgres://root:root@localhost:5432/app
10+
# You can generate a secret via 'pnpx uuid' on the command line. This should be at least 32 characters long.
11+
SESSION_SECRET='please-generate-a-secret-and-put-it-here'
1712

18-
# Auth settings
19-
# =============
20-
# Expiry time for OTP in seconds. Default is 600 seconds (10 minutes).
21-
OTP_EXPIRY=600
22-
# Secret to hash sessions. Can use https://1password.com/password-generator/ to generate a strong secret.
23-
SESSION_SECRET=random_session_secret_that_is_at_least_32_characters
24-
25-
# Mail settings
26-
# =============
27-
POSTMAN_API_KEY=
28-
# If using Sendgrid instead, the API token and "From" address must be set together.
29-
SENDGRID_API_KEY=
30-
SENDGRID_FROM_ADDRESS=
31-
32-
# Image upload settings
33-
# =====================
34-
# R2 API Keys for S3-compatible image upload
35-
# If set to true, enables image upload
36-
NEXT_PUBLIC_ENABLE_STORAGE=
37-
R2_ACCOUNT_ID=
38-
R2_BUCKET_NAME=
39-
R2_AVATARS_DIRECTORY=avatars
40-
R2_IMAGES_DIRECTORY=images
41-
R2_ACCESS_KEY_ID=
42-
R2_SECRET_ACCESS_KEY=
43-
R2_PUBLIC_HOSTNAME=
44-
45-
# SGID settings
46-
# =============
47-
# If set to true, enables SGID login
48-
NEXT_PUBLIC_ENABLE_SGID=
49-
SGID_CLIENT_ID=
50-
SGID_CLIENT_SECRET=
51-
SGID_REDIRECT_URI=
52-
SGID_PRIVATE_KEY=
53-
54-
# Other settings
55-
# ================
56-
# NEXT_PUBLIC_APP_NAME= # Uncomment to set application name
57-
# NEXT_PUBLIC_APP_URL= # Uncomment to set application URL
13+
# Change this to your app name. This is used when the application needs to refer to itself,
14+
# e.g. in emails or on the landing page.
15+
NEXT_PUBLIC_APP_NAME='Starter Kit'

.env.test

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 89 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/chromatic.yml

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# .github/workflows/chromatic.yml
2-
3-
# Workflow name
41
name: 'Chromatic'
52

63
# Event for the workflow
@@ -11,39 +8,50 @@ on:
118
pull_request:
129
types: [opened, reopened, synchronize]
1310

11+
permissions:
12+
contents: read
13+
pull-requests: read
14+
1415
# List of jobs
1516
jobs:
16-
chromatic-deployment:
17-
permissions:
18-
contents: read
19-
checks: write
20-
# Operating System
17+
# JOB to run change detection and run specific chromatic jobs only on changes
18+
changes:
2119
runs-on: ubuntu-latest
22-
env:
23-
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
24-
if: ${{ !endsWith(github.actor , 'bot') && !endsWith(github.actor, '[bot]')}}
25-
# Job steps
20+
# Set job outputs to values from filter step
21+
outputs:
22+
web: ${{ steps.filter.outputs.web }}
2623
steps:
27-
- uses: actions/checkout@v4
28-
if: env.CHROMATIC_PROJECT_TOKEN != ''
24+
- uses: actions/checkout@v5
25+
# For pull requests it's not necessary to checkout the code
26+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
27+
id: filter
2928
with:
30-
fetch-depth: 0 # Required so Chromatic can compare commits
31-
- uses: ./.github/actions/setup
32-
if: env.CHROMATIC_PROJECT_TOKEN != ''
33-
- name: Load .env file
34-
if: env.CHROMATIC_PROJECT_TOKEN != ''
35-
# xom9ikk/dotenv@v2, using commit hash to pin as tags may be updated in supply chain attack
36-
uses: xom9ikk/dotenv@eff1dce037c4c0143cc4180a810511024c2560c0
29+
filters: |
30+
web:
31+
- 'apps/web/**'
32+
web:
33+
needs: [changes]
34+
# Only run if the user is not a bot and has changes
35+
if: ${{ !endsWith(github.actor , 'bot') && !endsWith(github.actor, '[bot]') && needs.changes.outputs.web == 'true' }}
36+
runs-on: ubuntu-latest
37+
env:
38+
CHROMATIC_WEB_PROJECT_TOKEN: ${{ secrets.CHROMATIC_WEB_PROJECT_TOKEN }}
39+
steps:
40+
- uses: actions/checkout@v5
41+
if: env.CHROMATIC_WEB_PROJECT_TOKEN != ''
3742
with:
38-
mode: test
43+
fetch-depth: 0 # Required for v5
44+
- name: Setup
45+
if: env.CHROMATIC_WEB_PROJECT_TOKEN != ''
46+
uses: ./tooling/github/setup
3947
- name: Publish to Chromatic
40-
if: env.CHROMATIC_PROJECT_TOKEN != ''
41-
# chromaui/action@latest, using commit hash to pin to silence codeQL
42-
uses: chromaui/action@012a0241a4df3f0f831c99f02e2085c9641a25ba
48+
if: env.CHROMATIC_WEB_PROJECT_TOKEN != ''
49+
uses: chromaui/action@latest
4350
with:
44-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
51+
workingDir: apps/web
52+
storybookBaseDir: apps/web
53+
projectToken: ${{ env.CHROMATIC_WEB_PROJECT_TOKEN }}
4554
onlyChanged: true
4655
exitOnceUploaded: true
4756
autoAcceptChanges: main
48-
# Skip running Chromatic on dependabot PRs
49-
skip: dependabot/**
57+
skip: dependabot/** # Skip running Chromatic on dependabot PRs

0 commit comments

Comments
 (0)