Skip to content

Commit

Permalink
feat: update to Next.js Boilerpalte v3.54
Browse files Browse the repository at this point in the history
  • Loading branch information
ixartz committed Jul 25, 2024
1 parent 848ae11 commit ae80843
Show file tree
Hide file tree
Showing 34 changed files with 8,998 additions and 7,554 deletions.
19 changes: 2 additions & 17 deletions .env
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# FIXME: Configure environment variables for your project

# For security reason, don't push secret key in your git repo.
# Append .local to the environment files to prevent your secret key from being commited to Git.

# Hosting
# Replace by your domain name, only for production
# NEXT_PUBLIC_APP_URL=https://example.com

# Database
# 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"
# DATABASE_URL=libsql://[RANDOM-CHARS]-[DB-NAME]-[ORG-NAME].turso.io
DATABASE_URL=file:next-js-boilerplate.db

# Clerk authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_bGVnYWwtZHVja2xpbmctODYuY2xlcmsuYWNjb3VudHMuZGV2JA

Expand All @@ -27,13 +15,10 @@ BILLING_PLAN_ENV=dev
######## [BEGIN] SENSITIVE DATA ######## For security reason, don't update the following variables (secret key) directly in this file.
######## Please create a new file named `.env.local`, all environment files ending with `.local` won't be tracked by Git.
######## After creating the file, you can add the following variables.
# Clerk authentication
CLERK_SECRET_KEY=your_clerk_secret_key

DATABASE_AUTH_TOKEN=your_database_auth_token

# LOGTAIL_SOURCE_TOKEN=

# Stripe
STRIPE_SECRET_KEY=your_stripe_secret_key

STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
######## [END] SENSITIVE DATA
33 changes: 33 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# FIXME: Configure environment variables for production

# Hosting
# Replace by your domain name
NEXT_PUBLIC_APP_URL=https://example.com

# Sentry DSN
NEXT_PUBLIC_SENTRY_DSN=

# Stripe
# If you need a real Stripe subscription payment with checkout page, customer portal, webhook, etc.
# You can check out the Next.js Boilerplate Pro: https://nextjs-boilerplate.com/pro-saas-starter-kit
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live
# Use Stripe test mode price id or production price id
BILLING_PLAN_ENV=prod

######## [BEGIN] SENSITIVE DATA ######## For security reason, don't update the following variables (secret key) directly in this file.
######## Please create a new file named `.env.production.local`, all environment files ending with `.local` won't be tracked by Git.
######## After creating the file, you can add the following variables.
# Database
# 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"
# DATABASE_URL=postgresql://postgres@localhost:5432/postgres

# Stripe
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret

# Error monitoring
# SENTRY_AUTH_TOKEN=

# Logging ingestion
# LOGTAIL_SOURCE_TOKEN=
######## [END] SENSITIVE DATA
5 changes: 4 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
github: ixartz
custom:
["https://donate.stripe.com/7sI5m5146ehfddm7tj", "https://nextlessjs.com"]
[
"https://nextjs-boilerplate.com/pro-saas-starter-kit",
"https://nextlessjs.com",
]
10 changes: 3 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
node-version: [20.x]
node-version: [20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

name: Build with ${{ matrix.node-version }}
Expand Down Expand Up @@ -45,14 +45,10 @@ jobs:
cache: "npm"
- run: npm ci

- name: Set SENTRY_AUTH_TOKEN env if secret exists
run: |
if [[ -n "${{ secrets.SENTRY_AUTH_TOKEN }}" ]]; then
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> $GITHUB_ENV
fi
- name: Build Next.js for E2E tests
run: npm run build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- if: github.event_name == 'pull_request'
name: Validate all commits from PR
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,3 @@ local

# vercel
.vercel

# Sentry Config File
.sentryclirc
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mikestead.dotenv",
"csstools.postcss",
"bradlc.vscode-tailwindcss",
"Orta.vscode-jest",
"vitest.explorer",
"humao.rest-client",
"yoavbls.pretty-ts-errors",
"ms-playwright.playwright",
Expand Down
12 changes: 5 additions & 7 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import type { Config } from 'drizzle-kit';
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'drizzle-kit';

/** @type {import('drizzle-kit').Config} */
export default {
export default defineConfig({
out: './migrations',
schema: './src/models/Schema.ts',
dialect: 'sqlite',
driver: 'turso',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL ?? '',
authToken: process.env.DATABASE_AUTH_TOKEN ?? '',
},
verbose: true,
strict: true,
} satisfies Config;
});
34 changes: 17 additions & 17 deletions migrations/0000_init_db.sql
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
CREATE TABLE `organization` (
`id` text PRIMARY KEY NOT NULL,
`stripe_customer_id` text,
`stripe_subscription_id` text,
`stripe_subscription_price_id` text,
`stripe_subscription_status` text,
`stripe_subscription_current_period_end` integer,
`created_at` integer DEFAULT (strftime('%s', 'now')),
`updated_at` integer DEFAULT (strftime('%s', 'now'))
CREATE TABLE IF NOT EXISTS "organization" (
"id" serial NOT NULL,
"stripe_customer_id" text,
"stripe_subscription_id" text,
"stripe_subscription_price_id" text,
"stripe_subscription_status" text,
"stripe_subscription_current_period_end" integer,
"updated_at" timestamp DEFAULT now() NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE `todo` (
`id` integer PRIMARY KEY NOT NULL,
`owner_id` text NOT NULL,
`title` text NOT NULL,
`message` text NOT NULL,
`created_at` integer DEFAULT (strftime('%s', 'now')),
`updated_at` integer DEFAULT (strftime('%s', 'now'))
CREATE TABLE IF NOT EXISTS "todo" (
"id" serial NOT NULL,
"owner_id" text NOT NULL,
"title" text NOT NULL,
"message" text NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `stripe_customer_id_idx` ON `organization` (`stripe_customer_id`);
CREATE UNIQUE INDEX IF NOT EXISTS "stripe_customer_id_idx" ON "organization" USING btree ("stripe_customer_id");
115 changes: 56 additions & 59 deletions migrations/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,128 +1,126 @@
{
"version": "6",
"dialect": "sqlite",
"id": "a54e8325-0562-48ea-80c1-e811c6115651",
"id": "d1cd6f13-4333-4bd1-8b3b-25f3f0128ef3",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"organization": {
"public.organization": {
"name": "organization",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
"type": "serial",
"primaryKey": false,
"notNull": true
},
"stripe_customer_id": {
"name": "stripe_customer_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": false
},
"stripe_subscription_id": {
"name": "stripe_subscription_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": false
},
"stripe_subscription_price_id": {
"name": "stripe_subscription_price_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": false
},
"stripe_subscription_status": {
"name": "stripe_subscription_status",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": false
},
"stripe_subscription_current_period_end": {
"name": "stripe_subscription_current_period_end",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "(strftime('%s', 'now'))"
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "(strftime('%s', 'now'))"
"notNull": true,
"default": "now()"
}
},
"indexes": {
"stripe_customer_id_idx": {
"name": "stripe_customer_id_idx",
"columns": ["stripe_customer_id"],
"isUnique": true
"columns": [
{
"expression": "stripe_customer_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"todo": {
"public.todo": {
"name": "todo",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": false
"type": "serial",
"primaryKey": false,
"notNull": true
},
"owner_id": {
"name": "owner_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
"notNull": true
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"autoincrement": false
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "(strftime('%s', 'now'))"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "(strftime('%s', 'now'))"
"notNull": true,
"default": "now()"
}
},
"indexes": {},
Expand All @@ -132,12 +130,11 @@
}
},
"enums": {},
"schemas": {},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
"tables": {}
}
}
6 changes: 3 additions & 3 deletions migrations/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "7",
"dialect": "sqlite",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "6",
"when": 1717543980997,
"version": "7",
"when": 1721929095371,
"tag": "0000_init_db",
"breakpoints": true
}
Expand Down
Loading

0 comments on commit ae80843

Please sign in to comment.