diff --git a/.github/workflows/client-ci.yml b/.github/workflows/client-ci.yml
new file mode 100644
index 0000000..21ccf59
--- /dev/null
+++ b/.github/workflows/client-ci.yml
@@ -0,0 +1,39 @@
+name: mChat Server CI
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - .github/workflows/client-ci.yml
+ - client/*
+
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: 9
+ - name: Use Node.js 20
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: 'pnpm'
+
+ - name: Install deps
+ run: pnpm i --filter client
+
+ - name: Lint
+ run: pnpm --filter client lint
+
+ - name: Build
+ run: pnpm --filter client build
+
+
+
\ No newline at end of file
diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml
new file mode 100644
index 0000000..957fb60
--- /dev/null
+++ b/.github/workflows/server-ci.yml
@@ -0,0 +1,36 @@
+name: mChat Server CI
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - .github/workflows/server-ci.yml
+ - server/*
+
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: 9
+ - name: Use Node.js 20
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm i --filter server
+
+ - name: Build
+ run: pnpm --filter server build
+
+
+
\ No newline at end of file
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100644
index 0000000..9ef2ef0
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+pnpm run commitlint ${1}
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 0000000..9c96ce9
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+pnpm build
diff --git a/README.md b/README.md
index 080d98c..c5dc27c 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@
- Spin up entire stack (redis, mongo, client, server)
```bash
-docker compose -f docker-compose.prod.yml up
+docker compose -f docker-compose.prod.yml up --build
```
- Go to [http://localhost:3000](http://localhost:3000)
diff --git a/client/.eslintrc.cjs b/client/.eslintrc.cjs
index d6c9537..4172035 100644
--- a/client/.eslintrc.cjs
+++ b/client/.eslintrc.cjs
@@ -5,6 +5,7 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
+ 'plugin:@tanstack/eslint-plugin-query/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
diff --git a/client/package.json b/client/package.json
index b5301ee..c69f9b6 100644
--- a/client/package.json
+++ b/client/package.json
@@ -10,8 +10,10 @@
"preview": "vite preview"
},
"dependencies": {
+ "@tanstack/react-query": "^5.48.0",
"clsx": "^2.1.1",
"cva": "npm:class-variance-authority@^0.7.0",
+ "immer": "^10.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.13",
@@ -20,6 +22,7 @@
"tailwind-merge": "^2.3.0"
},
"devDependencies": {
+ "@tanstack/eslint-plugin-query": "^5.47.0",
"@types/node": "^20.14.5",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
diff --git a/client/src/App.tsx b/client/src/App.tsx
index cbd0819..143b0bd 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -1,7 +1,6 @@
import { Outlet } from 'react-router-dom'
import { Toaster } from './components/Toaster'
import { useAuthRedirect } from './hooks/useAuthRedirect'
-import { QueryCacheProvider } from './providers/QueryCacheProvider'
import { UserProvider } from './providers/UserProvider'
const AuthRedirect = () => {
@@ -13,9 +12,7 @@ function App() {
return (