Skip to content

Commit 5217c2d

Browse files
committed
Boilerplate
0 parents  commit 5217c2d

File tree

156 files changed

+47788
-0
lines changed

Some content is hidden

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

156 files changed

+47788
-0
lines changed

.env

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# FIXME: Configure environment variables for your project
2+
3+
# Clerk authentication
4+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_b3Blbi1zdGlua2J1Zy04LmNsZXJrLmFjY291bnRzLmRldiQ
5+
6+
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
7+
8+
# Stripe
9+
# If you need a real Stripe subscription payment with checkout page, customer portal, webhook, etc.
10+
# You can check out the Next.js Boilerplate Pro at: https://nextjs-boilerplate.com/pro-saas-starter-kit
11+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51PNk4fKOp3DEwzQle6Cx1j3IW1Lze5nFKZ4JBX0gLpNQ3hjFbMiT25gw7LEr369ge7JIsVA2qRhdKQm1NAmVehXl00FQxwRfh1
12+
# Use Stripe test mode price id or production price id
13+
BILLING_PLAN_ENV=dev
14+
15+
######## [BEGIN] SENSITIVE DATA ######## For security reason, don't update the following variables (secret key) directly in this file.
16+
######## Please create a new file named `.env.local`, all environment files ending with `.local` won't be tracked by Git.
17+
######## After creating the file, you can add the following variables.
18+
# Clerk authentication
19+
CLERK_SECRET_KEY=your_clerk_secret_key
20+
21+
# Stripe
22+
STRIPE_SECRET_KEY=your_stripe_secret_key
23+
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
24+
######## [END] SENSITIVE DATA

.env.production

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# FIXME: Configure environment variables for production
2+
3+
# Hosting
4+
# Replace by your domain name
5+
# NEXT_PUBLIC_APP_URL=https://example.com
6+
7+
# Sentry DSN
8+
NEXT_PUBLIC_SENTRY_DSN=
9+
10+
# Stripe
11+
# If you need a real Stripe subscription payment with checkout page, customer portal, webhook, etc.
12+
# You can check out the Next.js Boilerplate Pro: https://nextjs-boilerplate.com/pro-saas-starter-kit
13+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live
14+
# Use Stripe test mode price id or production price id
15+
BILLING_PLAN_ENV=prod
16+
17+
######## [BEGIN] SENSITIVE DATA ######## For security reason, don't update the following variables (secret key) directly in this file.
18+
######## Please create a new file named `.env.production.local`, all environment files ending with `.local` won't be tracked by Git.
19+
######## After creating the file, you can add the following variables.
20+
# Database
21+
# Using an incorrect DATABASE_URL value, Next.js build will timeout and you will get the following error: "because it took more than 60 seconds"
22+
# DATABASE_URL=postgresql://postgres@localhost:5432/postgres
23+
24+
# Stripe
25+
STRIPE_SECRET_KEY=your_stripe_secret_key
26+
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
27+
28+
# Error monitoring
29+
# SENTRY_AUTH_TOKEN=
30+
31+
# Logging ingestion
32+
# LOGTAIL_SOURCE_TOKEN=
33+
######## [END] SENSITIVE DATA

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github: ixartz
2+
custom:
3+
- 'https://nextjs-boilerplate.com/pro-saas-starter-kit'
4+
- 'https://nextlessjs.com'

.github/workflows/CI.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
node-version: [20.x, 22.6] # Need to use 22.6 due to Next.js build errors: https://github.com/vercel/next.js/issues/69263
14+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
15+
16+
name: Build with ${{ matrix.node-version }}
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: npm
26+
- run: npm ci
27+
- run: npm run build
28+
29+
test:
30+
strategy:
31+
matrix:
32+
node-version: [20.x]
33+
34+
name: Run all tests
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
with:
40+
fetch-depth: 0 # Retrieve Git history, needed to verify commits
41+
- name: Use Node.js ${{ matrix.node-version }}
42+
uses: actions/setup-node@v3
43+
with:
44+
node-version: ${{ matrix.node-version }}
45+
cache: npm
46+
- run: npm ci
47+
48+
- name: Build Next.js for E2E tests
49+
run: npm run build
50+
env:
51+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
52+
53+
- if: github.event_name == 'pull_request'
54+
name: Validate all commits from PR
55+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
56+
57+
- name: Linter
58+
run: npm run lint
59+
60+
- name: Type checking
61+
run: npm run check-types
62+
63+
- name: Run unit tests
64+
run: npm run test -- --coverage
65+
66+
- name: Upload coverage reports to Codecov
67+
uses: codecov/codecov-action@v4
68+
env:
69+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
70+
71+
- name: Install Playwright (used for Storybook and E2E tests)
72+
run: npx playwright install --with-deps
73+
74+
- name: Run storybook tests
75+
run: npm run test-storybook:ci
76+
77+
- name: Run E2E tests
78+
run: npx percy exec -- npm run test:e2e
79+
env:
80+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
81+
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
82+
83+
- uses: actions/upload-artifact@v4
84+
if: always()
85+
with:
86+
name: test-results
87+
path: test-results/
88+
retention-days: 7
89+
90+
synchronize-with-crowdin:
91+
name: GitHub PR synchronize with Crowdin
92+
runs-on: ubuntu-latest
93+
94+
needs: [build, test]
95+
if: github.event_name == 'pull_request'
96+
97+
steps:
98+
- uses: actions/checkout@v4
99+
with:
100+
ref: ${{ github.event.pull_request.head.sha }} # Crowdin Actions needs to push commits to the PR branch, checkout HEAD commit instead of merge commit
101+
fetch-depth: 0
102+
103+
- name: crowdin action
104+
uses: crowdin/github-action@v2
105+
with:
106+
upload_sources: true
107+
upload_translations: true
108+
download_translations: true
109+
create_pull_request: false
110+
localization_branch_name: ${{ github.head_ref || github.ref_name }} # explanation here: https://stackoverflow.com/a/71158878
111+
commit_message: 'chore: new Crowdin translations by GitHub Action'
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
115+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/checkly.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Checkly
2+
3+
on: [deployment_status]
4+
5+
env:
6+
CHECKLY_API_KEY: ${{ secrets.CHECKLY_API_KEY }}
7+
CHECKLY_ACCOUNT_ID: ${{ secrets.CHECKLY_ACCOUNT_ID }}
8+
CHECKLY_TEST_ENVIRONMENT: ${{ github.event.deployment_status.environment }}
9+
10+
jobs:
11+
test-e2e:
12+
strategy:
13+
matrix:
14+
node-version: [20.x]
15+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
16+
17+
# Only run when the deployment was successful
18+
if: github.event.deployment_status.state == 'success'
19+
20+
name: Test E2E on Checkly
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: '${{ github.event.deployment_status.deployment.ref }}'
28+
fetch-depth: 0
29+
30+
- name: Set branch name # workaround to detect branch name in "deployment_status" actions
31+
run: echo "CHECKLY_TEST_REPO_BRANCH=$(git show -s --pretty=%D HEAD | tr -s ',' '\n' | sed 's/^ //' | grep -e 'origin/' | head -1 | sed 's/\origin\///g')" >> $GITHUB_ENV
32+
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: npm
37+
38+
- name: Restore or cache node_modules
39+
id: cache-node-modules
40+
uses: actions/cache@v4
41+
with:
42+
path: node_modules
43+
key: node-modules-${{ hashFiles('package-lock.json') }}
44+
45+
- name: Install dependencies
46+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
47+
run: npm ci
48+
49+
- name: Run checks # run the checks passing in the ENVIRONMENT_URL and recording a test session.
50+
id: run-checks
51+
run: npx checkly test --reporter=github --record
52+
env:
53+
VERCEL_BYPASS_TOKEN: ${{ secrets.VERCEL_BYPASS_TOKEN }}
54+
ENVIRONMENT_URL: ${{ github.event.deployment_status.environment_url }}
55+
56+
- name: Create summary # export the markdown report to the job summary.
57+
id: create-summary
58+
run: cat checkly-github-report.md > $GITHUB_STEP_SUMMARY
59+
60+
- name: Deploy checks # if the test run was successful and we are on Production, deploy the checks
61+
id: deploy-checks
62+
if: steps.run-checks.outcome == 'success' && github.event.deployment_status.environment == 'Production'
63+
run: npx checkly deploy --force

.github/workflows/crowdin.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Crowdin Action
2+
3+
on:
4+
push:
5+
branches: [main] # Run on push to the main branch
6+
schedule:
7+
- cron: '0 5 * * *' # Run every day at 5am
8+
workflow_dispatch: # Run manually
9+
10+
jobs:
11+
synchronize-with-crowdin:
12+
name: Synchronize with Crowdin
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: crowdin action
19+
uses: crowdin/github-action@v2
20+
with:
21+
upload_sources: true
22+
upload_translations: true
23+
download_translations: true
24+
localization_branch_name: l10n_crowdin_translations
25+
create_pull_request: true
26+
pull_request_title: New Crowdin Translations
27+
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
28+
pull_request_base_branch_name: main
29+
commit_message: 'chore: new Crowdin translations by GitHub Action'
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
33+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
workflow_run:
5+
workflows: [CI]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
11+
jobs:
12+
release:
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
17+
name: Create a new release
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: write # to be able to publish a GitHub release
22+
issues: write # to be able to comment on released issues
23+
pull-requests: write # to be able to comment on released pull requests
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: npm
34+
- run: HUSKY=0 npm ci
35+
36+
- name: Release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: npx semantic-release

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# Database
9+
*.db
10+
11+
# testing
12+
/coverage
13+
14+
# storybook
15+
storybook-static
16+
*storybook.log
17+
18+
# playwright
19+
/test-results/
20+
/playwright-report/
21+
/playwright/.cache/
22+
23+
# next.js
24+
/.next
25+
/out
26+
27+
# cache
28+
.swc/
29+
30+
# production
31+
/build
32+
33+
# misc
34+
.DS_Store
35+
*.pem
36+
Thumbs.db
37+
38+
# debug
39+
npm-debug.log*
40+
pnpm-debug.log*
41+
yarn-debug.log*
42+
yarn-error.log*
43+
44+
# local env files
45+
.env*.local
46+
47+
# local folder
48+
local
49+
50+
# vercel
51+
.vercel

.husky/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
cd "$(dirname "$0")/.." && npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
# Disable concurent to run `check-types` after ESLint in lint-staged
3+
cd "$(dirname "$0")/.." && npx --no lint-staged --concurrent false

0 commit comments

Comments
 (0)