fix: Docker build and runtime fixes

- Fix duplicate 'signature' variable in webhooks.ts
- Add Prisma binary target for Alpine Linux
- Fix tsconfig path alias (@/* -> ./src/*)
- Add missing next-themes dependency
- Add build args for NEXT_PUBLIC_* env vars
- Fix SSR issues with zustand and providers
- Add providers-wrapper with dynamic ssr:false import
- Add SSL certs and public dir for nginx
- Update Dockerfiles for proper Prisma engine handling
This commit is contained in:
2026-04-15 14:16:27 -04:00
parent a1572d327f
commit 2388873e7a
17 changed files with 3414 additions and 150 deletions
+10 -20
View File
@@ -1,5 +1,4 @@
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
export interface User {
id: string;
@@ -21,22 +20,13 @@ interface AppState {
logout: () => void;
}
export const useStore = create<AppState>()(
persist(
(set) => ({
user: null,
token: null,
isAuthenticated: false,
setUser: (user) => set({ user, isAuthenticated: !!user }),
setToken: (token) => set({ token }),
logout: () => {
localStorage.removeItem('token');
set({ user: null, token: null, isAuthenticated: false });
},
}),
{
name: 'coop-credits-storage',
partialize: (state) => ({ user: state.user, token: state.token }),
}
)
);
export const useStore = create<AppState>()((set) => ({
user: null,
token: null,
isAuthenticated: false,
setUser: (user) => set({ user, isAuthenticated: !!user }),
setToken: (token) => set({ token }),
logout: () => {
set({ user: null, token: null, isAuthenticated: false });
},
}));