diff --git a/app/root.tsx b/app/root.tsx
index b2df0a4..c7c74de 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -1,10 +1,6 @@
import { rootAuthLoader } from "@clerk/remix/ssr.server";
import { ClerkApp, ClerkErrorBoundary } from "@clerk/remix";
-import type {
- LinksFunction,
- LoaderFunction,
- MetaFunction,
-} from "@remix-run/node";
+import type { LoaderFunction, MetaFunction } from "@remix-run/node";
import {
Links,
LiveReload,
@@ -13,13 +9,10 @@ import {
Scripts,
ScrollRestoration,
} from "@remix-run/react";
-import stylesheet from "~/tailwind.css";
import Footer from "./components/Footer";
import Header from "./components/Header";
-export const links: LinksFunction = () => [
- { rel: "stylesheet", href: stylesheet },
-];
+import "./tailwind.css";
export const meta: MetaFunction = () => {
return [
diff --git a/app/routes/api.webhooks.clerk.tsx b/app/routes/api.webhooks.clerk.tsx
index 084db5c..1dd60c5 100644
--- a/app/routes/api.webhooks.clerk.tsx
+++ b/app/routes/api.webhooks.clerk.tsx
@@ -5,6 +5,7 @@ import {
onUserCreatedHandler,
onUserDeletedHandler,
} from "~/services/webhookhelpers.server";
+import "dotenv/config";
export async function action({ request, params, context }: ActionFunctionArgs) {
// Get the headers
diff --git a/app/services/db.server.ts b/app/services/db.server.ts
index 55822c4..9ec87df 100644
--- a/app/services/db.server.ts
+++ b/app/services/db.server.ts
@@ -1,6 +1,7 @@
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
import * as schema from "./schema.server";
+import "dotenv/config";
const client = createClient({
url: process.env.DATABASE_URL!,
diff --git a/app/services/emitter.server.ts b/app/services/emitter.server.ts
index 6313c67..426d07f 100644
--- a/app/services/emitter.server.ts
+++ b/app/services/emitter.server.ts
@@ -1,5 +1,6 @@
import { EventEmitter } from "events";
import { publishToChannel, subscribeToChannel } from "./redis.server";
+import "dotenv/config";
let emitter: EventEmitter;
diff --git a/app/services/helpers.server.ts b/app/services/helpers.server.ts
index 5a0bd62..cb5439d 100644
--- a/app/services/helpers.server.ts
+++ b/app/services/helpers.server.ts
@@ -1,3 +1,5 @@
+import "dotenv/config";
+
export const isShit = (email: string) => {
if (!process.env.SHIT_LIST) {
return false;
diff --git a/app/services/redis.server.ts b/app/services/redis.server.ts
index 7625820..6524312 100644
--- a/app/services/redis.server.ts
+++ b/app/services/redis.server.ts
@@ -1,4 +1,5 @@
import Redis from "ioredis";
+import "dotenv/config";
let cache: Redis | null = null;
let pub: Redis | null = null;
diff --git a/app/services/webhookhelpers.server.ts b/app/services/webhookhelpers.server.ts
index 2b3571b..b4b33a1 100644
--- a/app/services/webhookhelpers.server.ts
+++ b/app/services/webhookhelpers.server.ts
@@ -1,6 +1,7 @@
import { eq } from "drizzle-orm";
import { db } from "./db.server";
import { rooms } from "./schema.server";
+import "dotenv/config";
export const onUserDeletedHandler = async (userId: string | undefined) => {
if (!userId) {
diff --git a/remix.env.d.ts b/env.d.ts
similarity index 50%
rename from remix.env.d.ts
rename to env.d.ts
index dcf8c45..78ed234 100644
--- a/remix.env.d.ts
+++ b/env.d.ts
@@ -1,2 +1,2 @@
-///
///
+///
diff --git a/package.json b/package.json
index 76a3c1c..00d57f0 100644
--- a/package.json
+++ b/package.json
@@ -5,16 +5,15 @@
"sideEffects": false,
"type": "module",
"scripts": {
- "build": "remix build",
- "dev": "remix dev --manual",
- "start": "remix-serve ./build/index.js",
+ "build": "vite build && vite build --ssr",
+ "dev": "vite dev --force",
+ "start": "remix-serve ./build/server/index.js",
"typecheck": "tsc"
},
"dependencies": {
"@clerk/remix": "^3.1.11",
"@libsql/client": "0.4.0-pre.5",
"@paralleldrive/cuid2": "^2.2.2",
- "@remix-run/css-bundle": "^2.4.0",
"@remix-run/node": "^2.4.0",
"@remix-run/react": "^2.4.0",
"@remix-run/serve": "^2.4.0",
@@ -42,7 +41,9 @@
"eslint": "^8.55.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
- "typescript": "^5.3.3"
+ "typescript": "^5.3.3",
+ "vite": "^5.0.10",
+ "vite-tsconfig-paths": "^4.2.2"
},
"engines": {
"node": ">=18.0.0"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 849413f..158424a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -14,9 +14,6 @@ dependencies:
'@paralleldrive/cuid2':
specifier: ^2.2.2
version: 2.2.2
- '@remix-run/css-bundle':
- specifier: ^2.4.0
- version: 2.4.0
'@remix-run/node':
specifier: ^2.4.0
version: 2.4.0(typescript@5.3.3)
@@ -60,7 +57,7 @@ devDependencies:
version: 0.4.11
'@remix-run/dev':
specifier: ^2.4.0
- version: 2.4.0(@remix-run/serve@2.4.0)(typescript@5.3.3)
+ version: 2.4.0(@remix-run/serve@2.4.0)(typescript@5.3.3)(vite@5.0.10)
'@remix-run/eslint-config':
specifier: ^2.4.0
version: 2.4.0(eslint@8.55.0)(react@18.2.0)(typescript@5.3.3)
@@ -97,6 +94,12 @@ devDependencies:
typescript:
specifier: ^5.3.3
version: 5.3.3
+ vite:
+ specifier: ^5.0.10
+ version: 5.0.10
+ vite-tsconfig-paths:
+ specifier: ^4.2.2
+ version: 4.2.2(typescript@5.3.3)(vite@5.0.10)
packages:
@@ -1846,12 +1849,7 @@ packages:
dev: true
optional: true
- /@remix-run/css-bundle@2.4.0:
- resolution: {integrity: sha512-kFFJ5Iek1lNjoiajiqirLGcxTvPdmbIezvKZbJwSO173pZRHr1MlTnLactrYhFmEHNBE6LMN54QXDynl93S+aQ==}
- engines: {node: '>=18.0.0'}
- dev: false
-
- /@remix-run/dev@2.4.0(@remix-run/serve@2.4.0)(typescript@5.3.3):
+ /@remix-run/dev@2.4.0(@remix-run/serve@2.4.0)(typescript@5.3.3)(vite@5.0.10):
resolution: {integrity: sha512-qQsZv+uPw8IhAdUwIIaZqnJfgJXLahYuWHFQIcS7kBhr+PdwW6SA3gvmUhnkDrqV+HJdP1bUpwXYGT+vbDQGiQ==}
engines: {node: '>=18.0.0'}
hasBin: true
@@ -1922,6 +1920,7 @@ packages:
tar-fs: 2.1.1
tsconfig-paths: 4.2.0
typescript: 5.3.3
+ vite: 5.0.10
ws: 7.5.9
transitivePeerDependencies:
- '@types/node'
@@ -2100,6 +2099,110 @@ packages:
dependencies:
web-streams-polyfill: 3.2.1
+ /@rollup/rollup-android-arm-eabi@4.9.0:
+ resolution: {integrity: sha512-+1ge/xmaJpm1KVBuIH38Z94zj9fBD+hp+/5WLaHgyY8XLq1ibxk/zj6dTXaqM2cAbYKq8jYlhHd6k05If1W5xA==}
+ cpu: [arm]
+ os: [android]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-android-arm64@4.9.0:
+ resolution: {integrity: sha512-im6hUEyQ7ZfoZdNvtwgEJvBWZYauC9KVKq1w58LG2Zfz6zMd8gRrbN+xCVoqA2hv/v6fm9lp5LFGJ3za8EQH3A==}
+ cpu: [arm64]
+ os: [android]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-darwin-arm64@4.9.0:
+ resolution: {integrity: sha512-u7aTMskN6Dmg1lCT0QJ+tINRt+ntUrvVkhbPfFz4bCwRZvjItx2nJtwJnJRlKMMaQCHRjrNqHRDYvE4mBm3DlQ==}
+ cpu: [arm64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-darwin-x64@4.9.0:
+ resolution: {integrity: sha512-8FvEl3w2ExmpcOmX5RJD0yqXcVSOqAJJUJ29Lca29Ik+3zPS1yFimr2fr5JSZ4Z5gt8/d7WqycpgkX9nocijSw==}
+ cpu: [x64]
+ os: [darwin]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-arm-gnueabihf@4.9.0:
+ resolution: {integrity: sha512-lHoKYaRwd4gge+IpqJHCY+8Vc3hhdJfU6ukFnnrJasEBUvVlydP8PuwndbWfGkdgSvZhHfSEw6urrlBj0TSSfg==}
+ cpu: [arm]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-arm64-gnu@4.9.0:
+ resolution: {integrity: sha512-JbEPfhndYeWHfOSeh4DOFvNXrj7ls9S/2omijVsao+LBPTPayT1uKcK3dHW3MwDJ7KO11t9m2cVTqXnTKpeaiw==}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-arm64-musl@4.9.0:
+ resolution: {integrity: sha512-ahqcSXLlcV2XUBM3/f/C6cRoh7NxYA/W7Yzuv4bDU1YscTFw7ay4LmD7l6OS8EMhTNvcrWGkEettL1Bhjf+B+w==}
+ cpu: [arm64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-riscv64-gnu@4.9.0:
+ resolution: {integrity: sha512-uwvOYNtLw8gVtrExKhdFsYHA/kotURUmZYlinH2VcQxNCQJeJXnkmWgw2hI9Xgzhgu7J9QvWiq9TtTVwWMDa+w==}
+ cpu: [riscv64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-x64-gnu@4.9.0:
+ resolution: {integrity: sha512-m6pkSwcZZD2LCFHZX/zW2aLIISyzWLU3hrLLzQKMI12+OLEzgruTovAxY5sCZJkipklaZqPy/2bEEBNjp+Y7xg==}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-linux-x64-musl@4.9.0:
+ resolution: {integrity: sha512-VFAC1RDRSbU3iOF98X42KaVicAfKf0m0OvIu8dbnqhTe26Kh6Ym9JrDulz7Hbk7/9zGc41JkV02g+p3BivOdAg==}
+ cpu: [x64]
+ os: [linux]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-win32-arm64-msvc@4.9.0:
+ resolution: {integrity: sha512-9jPgMvTKXARz4inw6jezMLA2ihDBvgIU9Ml01hjdVpOcMKyxFBJrn83KVQINnbeqDv0+HdO1c09hgZ8N0s820Q==}
+ cpu: [arm64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-win32-ia32-msvc@4.9.0:
+ resolution: {integrity: sha512-WE4pT2kTXQN2bAv40Uog0AsV7/s9nT9HBWXAou8+++MBCnY51QS02KYtm6dQxxosKi1VIz/wZIrTQO5UP2EW+Q==}
+ cpu: [ia32]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
+ /@rollup/rollup-win32-x64-msvc@4.9.0:
+ resolution: {integrity: sha512-aPP5Q5AqNGuT0tnuEkK/g4mnt3ZhheiXrDIiSVIHN9mcN21OyXDVbEMqmXPE7e2OplNLDkcvV+ZoGJa2ZImFgw==}
+ cpu: [x64]
+ os: [win32]
+ requiresBuild: true
+ dev: true
+ optional: true
+
/@rushstack/eslint-patch@1.6.0:
resolution: {integrity: sha512-2/U3GXA6YiPYQDLGwtGlnNgKYBSwCFIHf8Y9LUY5VATHdtbLlU0Y1R3QoBnT0aB4qv/BEiVVsj7LJXoQCgJ2vA==}
dev: true
@@ -4723,6 +4826,10 @@ packages:
slash: 3.0.0
dev: true
+ /globrex@0.1.2:
+ resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
+ dev: true
+
/gopd@1.0.1:
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
dependencies:
@@ -7188,6 +7295,27 @@ packages:
fsevents: 2.3.3
dev: true
+ /rollup@4.9.0:
+ resolution: {integrity: sha512-bUHW/9N21z64gw8s6tP4c88P382Bq/L5uZDowHlHx6s/QWpjJXivIAbEw6LZthgSvlEizZBfLC4OAvWe7aoF7A==}
+ engines: {node: '>=18.0.0', npm: '>=8.0.0'}
+ hasBin: true
+ optionalDependencies:
+ '@rollup/rollup-android-arm-eabi': 4.9.0
+ '@rollup/rollup-android-arm64': 4.9.0
+ '@rollup/rollup-darwin-arm64': 4.9.0
+ '@rollup/rollup-darwin-x64': 4.9.0
+ '@rollup/rollup-linux-arm-gnueabihf': 4.9.0
+ '@rollup/rollup-linux-arm64-gnu': 4.9.0
+ '@rollup/rollup-linux-arm64-musl': 4.9.0
+ '@rollup/rollup-linux-riscv64-gnu': 4.9.0
+ '@rollup/rollup-linux-x64-gnu': 4.9.0
+ '@rollup/rollup-linux-x64-musl': 4.9.0
+ '@rollup/rollup-win32-arm64-msvc': 4.9.0
+ '@rollup/rollup-win32-ia32-msvc': 4.9.0
+ '@rollup/rollup-win32-x64-msvc': 4.9.0
+ fsevents: 2.3.3
+ dev: true
+
/run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
dependencies:
@@ -7786,6 +7914,19 @@ packages:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
dev: true
+ /tsconfck@2.1.2(typescript@5.3.3):
+ resolution: {integrity: sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==}
+ engines: {node: ^14.13.1 || ^16 || >=18}
+ hasBin: true
+ peerDependencies:
+ typescript: ^4.3.5 || ^5.0.0
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ typescript: 5.3.3
+ dev: true
+
/tsconfig-paths@3.15.0:
resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}
dependencies:
@@ -8135,6 +8276,23 @@ packages:
- terser
dev: true
+ /vite-tsconfig-paths@4.2.2(typescript@5.3.3)(vite@5.0.10):
+ resolution: {integrity: sha512-dq0FjyxHHDnp0uS3P12WEOX2W7NeuLzX9AWP38D7Zw2CTbFErapwQVlCiT5DMJcVWKQ1MMdTe92PZl/rBQ7qcw==}
+ peerDependencies:
+ vite: '*'
+ peerDependenciesMeta:
+ vite:
+ optional: true
+ dependencies:
+ debug: 4.3.4
+ globrex: 0.1.2
+ tsconfck: 2.1.2(typescript@5.3.3)
+ vite: 5.0.10
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
/vite@4.5.1:
resolution: {integrity: sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==}
engines: {node: ^14.18.0 || >=16.0.0}
@@ -8170,6 +8328,41 @@ packages:
fsevents: 2.3.3
dev: true
+ /vite@5.0.10:
+ resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+ hasBin: true
+ peerDependencies:
+ '@types/node': ^18.0.0 || >=20.0.0
+ less: '*'
+ lightningcss: ^1.21.0
+ sass: '*'
+ stylus: '*'
+ sugarss: '*'
+ terser: ^5.4.0
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+ dependencies:
+ esbuild: 0.19.9
+ postcss: 8.4.32
+ rollup: 4.9.0
+ optionalDependencies:
+ fsevents: 2.3.3
+ dev: true
+
/wcwidth@1.0.1:
resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
dependencies:
diff --git a/postcss.config.js b/postcss.config.js
new file mode 100644
index 0000000..2aa7205
--- /dev/null
+++ b/postcss.config.js
@@ -0,0 +1,6 @@
+export default {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+};
diff --git a/remix.config.js b/remix.config.js
deleted file mode 100644
index eec5a28..0000000
--- a/remix.config.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/** @type {import('@remix-run/dev').AppConfig} */
-export default {
- ignoredRouteFiles: ["**/.*"],
-};
diff --git a/tsconfig.json b/tsconfig.json
index b7cbef1..ce8de68 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,5 +1,5 @@
{
- "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
+ "include": ["env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"isolatedModules": true,
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..26a188e
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,15 @@
+import { unstable_vitePlugin as remix } from "@remix-run/dev";
+import { installGlobals } from "@remix-run/node";
+import { defineConfig } from "vite";
+import tsconfigPaths from "vite-tsconfig-paths";
+
+installGlobals();
+
+export default defineConfig({
+ plugins: [
+ remix({
+ ignoredRouteFiles: ["**/.*"],
+ }),
+ tsconfigPaths(),
+ ],
+});