chore: update package licences and migration script
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
POSTGRES_URL=
|
||||
WEBSITE_URL=
|
||||
|
||||
EMAIL_FROM=
|
||||
EMAIL_URL=
|
||||
EMAIL_TOKEN=
|
||||
|
||||
NEXT_PUBLIC_BASE_URL=
|
||||
NEXT_PUBLIC_STORAGE_URL=
|
||||
NEXT_PUBLIC_AVATAR_BUCKET_NAME=
|
||||
|
||||
@@ -16,6 +16,7 @@ S3_SECRET_ACCESS_KEY=
|
||||
|
||||
BETTER_AUTH_SECRET=
|
||||
BETTER_AUTH_URL=
|
||||
BETTER_AUTH_TRUSTED_ORIGINS=
|
||||
|
||||
GOOGLE_CLIENT_ID=
|
||||
GOOGLE_CLIENT_SECRET=
|
||||
|
||||
@@ -14,14 +14,20 @@ export const env = createEnv({
|
||||
* This way you can ensure the app isn't built with invalid env vars.
|
||||
*/
|
||||
server: {
|
||||
BETTER_AUTH_SECRET: z.string(),
|
||||
BETTER_AUTH_URL: z.string(),
|
||||
BETTER_AUTH_TRUSTED_ORIGINS: z.string(),
|
||||
POSTGRES_URL: z.string().url(),
|
||||
STRIPE_SECRET_KEY: z.string().optional(),
|
||||
GOOGLE_CLIENT_ID: z.string(),
|
||||
GOOGLE_CLIENT_SECRET: z.string(),
|
||||
S3_ACCESS_KEY_ID: z.string(),
|
||||
S3_SECRET_ACCESS_KEY: z.string(),
|
||||
S3_REGION: z.string(),
|
||||
S3_ENDPOINT: z.string(),
|
||||
GOOGLE_CLIENT_ID: z.string().optional(),
|
||||
GOOGLE_CLIENT_SECRET: z.string().optional(),
|
||||
S3_ACCESS_KEY_ID: z.string().optional(),
|
||||
S3_SECRET_ACCESS_KEY: z.string().optional(),
|
||||
S3_REGION: z.string().optional(),
|
||||
S3_ENDPOINT: z.string().optional(),
|
||||
EMAIL_FROM: z.string(),
|
||||
EMAIL_URL: z.string(),
|
||||
EMAIL_TOKEN: z.string(),
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -29,12 +35,12 @@ export const env = createEnv({
|
||||
* For them to be exposed to the client, prefix them with `NEXT_PUBLIC_`.
|
||||
*/
|
||||
client: {
|
||||
NEXT_PUBLIC_KAN_ENV: z.string(),
|
||||
NEXT_PUBLIC_KAN_ENV: z.string().optional(),
|
||||
NEXT_PUBLIC_UMAMI_ID: z.string().optional(),
|
||||
NEXT_PUBLIC_BASE_URL: z.string(),
|
||||
NEXT_PUBLIC_STORAGE_URL: z.string(),
|
||||
NEXT_PUBLIC_AVATAR_BUCKET_NAME: z.string(),
|
||||
NEXT_PUBLIC_STORAGE_DOMAIN: z.string(),
|
||||
NEXT_PUBLIC_STORAGE_URL: z.string().optional(),
|
||||
NEXT_PUBLIC_AVATAR_BUCKET_NAME: z.string().optional(),
|
||||
NEXT_PUBLIC_STORAGE_DOMAIN: z.string().optional(),
|
||||
},
|
||||
/**
|
||||
* Destructure all variables from `process.env` to make sure they aren't tree-shaken away.
|
||||
|
||||
@@ -22,7 +22,7 @@ export default async function handler(
|
||||
|
||||
const session = await stripe.billingPortal.sessions.create({
|
||||
customer: user.stripeCustomerId,
|
||||
return_url: `${process.env.WEBSITE_URL}/settings`,
|
||||
return_url: `${process.env.NEXT_PUBLIC_BASE_URL}/settings`,
|
||||
});
|
||||
|
||||
return res.status(200).json({ url: session.url });
|
||||
|
||||
@@ -73,8 +73,8 @@ export default async function handler(
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
success_url: `${process.env.WEBSITE_URL}${successUrl}`,
|
||||
cancel_url: `${process.env.WEBSITE_URL}${cancelUrl}`,
|
||||
success_url: `${process.env.NEXT_PUBLIC_BASE_URL}${successUrl}`,
|
||||
cancel_url: `${process.env.NEXT_PUBLIC_BASE_URL}${cancelUrl}`,
|
||||
customer: user.stripeCustomerId ?? undefined,
|
||||
metadata: {
|
||||
workspaceSlug: slug,
|
||||
|
||||
@@ -19,7 +19,6 @@ services:
|
||||
- .env
|
||||
command: ["pnpm", "start"]
|
||||
environment:
|
||||
- WEBSITE_URL=${WEBSITE_URL}
|
||||
- EMAIL_FROM=${EMAIL_FROM}
|
||||
- EMAIL_URL=${EMAIL_URL}
|
||||
- EMAIL_TOKEN=${EMAIL_TOKEN}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"build": "turbo run build",
|
||||
"clean": "git clean -xdf node_modules",
|
||||
"clean:workspaces": "turbo run clean",
|
||||
"db:migrate": "cd packages/db && pnpm migrate",
|
||||
"db:push": "turbo -F @kan/db push",
|
||||
"db:studio": "turbo -F @kan/db studio",
|
||||
"dev": "turbo watch dev --continue",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"default": "./src/openapi.ts"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
|
||||
@@ -6,7 +6,7 @@ export const openApiDocument = generateOpenApiDocument(appRouter, {
|
||||
title: "Kan API",
|
||||
description: "OpenAPI compliant REST API",
|
||||
version: "1.0.0",
|
||||
baseUrl: `${process.env.WEBSITE_URL}/api/v1`,
|
||||
baseUrl: `${process.env.NEXT_PUBLIC_BASE_URL}/api/v1`,
|
||||
docsUrl: "docs.kan.bn",
|
||||
tags: ["Auth", "Users", "Boards", "Lists", "Cards", "Labels", "Imports"],
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
|
||||
@@ -5,17 +5,10 @@ export default {
|
||||
out: "./migrations",
|
||||
dialect: "postgresql",
|
||||
dbCredentials: {
|
||||
host: process.env.POSTGRES_HOST ?? "localhost",
|
||||
port: process.env.POSTGRES_PORT
|
||||
? parseInt(process.env.POSTGRES_PORT)
|
||||
: 5432,
|
||||
user: process.env.POSTGRES_USER,
|
||||
password: process.env.POSTGRES_PASSWORD,
|
||||
database: process.env.POSTGRES_DATABASE ?? "postgres",
|
||||
ssl: true,
|
||||
url: process.env.POSTGRES_URL ?? "",
|
||||
ssl: process.env.NODE_ENV === "production" ? true : false,
|
||||
},
|
||||
migrations: {
|
||||
prefix: "timestamp",
|
||||
},
|
||||
// tablesFilter: ["kan_*"],
|
||||
} satisfies Config;
|
||||
|
||||
@@ -25,13 +25,14 @@
|
||||
"default": "./src/repository/*.ts"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
"dev": "tsc",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint",
|
||||
"migrate": "pnpm with-env drizzle-kit migrate",
|
||||
"push": "pnpm with-env drizzle-kit push",
|
||||
"studio": "pnpm with-env drizzle-kit studio",
|
||||
"typecheck": "tsc --noEmit --emitDeclarationOnly false",
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import "dotenv/config";
|
||||
|
||||
import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
||||
import postgres from "postgres";
|
||||
|
||||
const postgresUrl = process.env.POSTGRES_URL;
|
||||
if (!postgresUrl) {
|
||||
throw new Error("POSTGRES_URL environment variable is not set");
|
||||
}
|
||||
|
||||
const migrationClient = postgres(postgresUrl, { max: 1 });
|
||||
console.log("Starting database migration...");
|
||||
|
||||
migrate(drizzle(migrationClient), {
|
||||
migrationsFolder: "./migrations",
|
||||
})
|
||||
.then(() => {
|
||||
console.log("✅ Database migration completed successfully");
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("❌ Migration failed:");
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -11,8 +11,9 @@
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"license": "MIT",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"dev": "tsc",
|
||||
"run:dev": "email dev",
|
||||
"export": "email export",
|
||||
"build": "tsc",
|
||||
|
||||
@@ -3,12 +3,11 @@ import { Button } from "@react-email/button";
|
||||
import { Container } from "@react-email/container";
|
||||
import { Head } from "@react-email/head";
|
||||
import { Heading } from "@react-email/heading";
|
||||
import { Html } from "@react-email/html";
|
||||
import { Hr } from "@react-email/hr";
|
||||
import { Html } from "@react-email/html";
|
||||
import { Link } from "@react-email/link";
|
||||
import { Preview } from "@react-email/preview";
|
||||
import { Text } from "@react-email/text";
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
export const JoinWorkspaceTemplate = ({
|
||||
@@ -91,7 +90,7 @@ export const JoinWorkspaceTemplate = ({
|
||||
/>
|
||||
<Text style={{ color: "#7e7e7e" }}>
|
||||
<Link
|
||||
href={process.env.WEBSITE_URL}
|
||||
href={process.env.NEXT_PUBLIC_BASE_URL}
|
||||
target="_blank"
|
||||
style={{ color: "#7e7e7e", textDecoration: "underline" }}
|
||||
>
|
||||
|
||||
@@ -3,12 +3,11 @@ import { Button } from "@react-email/button";
|
||||
import { Container } from "@react-email/container";
|
||||
import { Head } from "@react-email/head";
|
||||
import { Heading } from "@react-email/heading";
|
||||
import { Html } from "@react-email/html";
|
||||
import { Hr } from "@react-email/hr";
|
||||
import { Html } from "@react-email/html";
|
||||
import { Link } from "@react-email/link";
|
||||
import { Preview } from "@react-email/preview";
|
||||
import { Text } from "@react-email/text";
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
export const MagicLinkTemplate = ({
|
||||
@@ -91,7 +90,7 @@ export const MagicLinkTemplate = ({
|
||||
/>
|
||||
<Text style={{ color: "#7e7e7e" }}>
|
||||
<Link
|
||||
href={process.env.WEBSITE_URL}
|
||||
href={process.env.NEXT_PUBLIC_BASE_URL}
|
||||
target="_blank"
|
||||
style={{ color: "#7e7e7e", textDecoration: "underline" }}
|
||||
>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"default": "./src/constants/index.ts"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
},
|
||||
"globalEnv": [
|
||||
"POSTGRES_URL",
|
||||
"WEBSITE_URL",
|
||||
"GOOGLE_CLIENT_ID",
|
||||
"GOOGLE_CLIENT_SECRET",
|
||||
"EMAIL_FROM",
|
||||
|
||||
Reference in New Issue
Block a user