fix(manadeck): resolve backend startup and auth configuration issues

- Add missing env vars to generate-env script (DATABASE_URL, MANA_SERVICE_URL, APP_ID)
- Fix auth endpoints to use correct mana-core-auth paths (/api/v1/auth/login)
- Fix api.controller.ts to use getBalance() and completedAt field names
- Add SSR/optimizeDeps config for shared packages in vite.config.ts
- Remove outdated tailwind.config.js (conflicts with Tailwind CSS 4)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-28 21:31:46 +01:00
parent e3eae2cb2c
commit f1e27f3beb
6 changed files with 39 additions and 27 deletions

View file

@ -106,6 +106,8 @@ MANACORE_SUPABASE_ANON_KEY=your-supabase-anon-key
# ============================================
MANADECK_BACKEND_PORT=3004
MANADECK_DATABASE_URL=postgresql://manacore:devpassword@localhost:5432/manadeck
MANADECK_APP_ID=cea4bfc6-a4de-4e17-91e2-54275940156e
MANADECK_SUPABASE_URL=https://your-manadeck-project.supabase.co
MANADECK_SUPABASE_ANON_KEY=your-supabase-anon-key

View file

@ -51,7 +51,7 @@ export class ApiController {
// Include credit balance in profile
let creditBalance = 0;
try {
const balance = await this.creditClient.getCreditBalance(user.sub);
const balance = await this.creditClient.getBalance(user.sub);
creditBalance = balance.balance || 0;
} catch (error) {
this.logger.warn(`Failed to fetch credit balance for user ${user.sub}:`, error);
@ -69,7 +69,7 @@ export class ApiController {
this.logger.log(`Getting credit balance for user: ${user.sub}`);
try {
const balance = await this.creditClient.getCreditBalance(user.sub);
const balance = await this.creditClient.getBalance(user.sub);
return {
userId: user.sub,

View file

@ -9,7 +9,7 @@
* - utils/jwt.ts
*/
import { PUBLIC_API_URL } from '$env/static/public';
import { PUBLIC_API_URL, PUBLIC_MANA_CORE_AUTH_URL } from '$env/static/public';
import {
createAuthService,
createTokenManager,
@ -127,22 +127,22 @@ setNetworkAdapter(webNetworkAdapter);
// Create auth service instance
export const authService = createAuthService({
baseUrl: PUBLIC_API_URL,
baseUrl: PUBLIC_MANA_CORE_AUTH_URL,
storageKeys: {
APP_TOKEN: STORAGE_KEYS.APP_TOKEN,
REFRESH_TOKEN: STORAGE_KEYS.REFRESH_TOKEN,
USER_EMAIL: STORAGE_KEYS.USER_EMAIL,
},
endpoints: {
signIn: '/v1/auth/signin',
signUp: '/v1/auth/signup',
signOut: '/v1/auth/logout',
refresh: '/v1/auth/refresh',
validate: '/v1/auth/validate',
forgotPassword: '/v1/auth/forgot-password',
googleSignIn: '/v1/auth/google-signin',
appleSignIn: '/v1/auth/apple-signin',
credits: '/v1/auth/credits',
signIn: '/api/v1/auth/login',
signUp: '/api/v1/auth/register',
signOut: '/api/v1/auth/logout',
refresh: '/api/v1/auth/refresh',
validate: '/api/v1/auth/validate',
forgotPassword: '/api/v1/auth/forgot-password',
googleSignIn: '/api/v1/auth/google-signin',
appleSignIn: '/api/v1/auth/apple-signin',
credits: '/api/v1/credits/balance',
},
});

View file

@ -1,12 +0,0 @@
import preset from '@manacore/shared-tailwind/preset';
/** @type {import('tailwindcss').Config} */
export default {
presets: [preset],
content: [
'./src/**/*.{html,js,svelte,ts}',
'../../../packages/shared-ui/src/**/*.{html,js,svelte,ts}',
'../../../packages/shared-auth-ui/src/**/*.{html,js,svelte,ts}',
],
plugins: [require('@tailwindcss/typography')],
};

View file

@ -3,4 +3,24 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
ssr: {
noExternal: [
'@manacore/shared-theme',
'@manacore/shared-auth-ui',
'@manacore/shared-branding',
'@manacore/shared-ui',
'@manacore/shared-theme-ui',
'@manacore/shared-i18n',
],
},
optimizeDeps: {
exclude: [
'@manacore/shared-theme',
'@manacore/shared-auth-ui',
'@manacore/shared-branding',
'@manacore/shared-ui',
'@manacore/shared-theme-ui',
'@manacore/shared-i18n',
],
},
});

View file

@ -198,8 +198,10 @@ const APP_CONFIGS = [
vars: {
NODE_ENV: () => 'development',
PORT: (env) => env.MANADECK_BACKEND_PORT || '3004',
SUPABASE_URL: (env) => env.MANADECK_SUPABASE_URL,
SUPABASE_ANON_KEY: (env) => env.MANADECK_SUPABASE_ANON_KEY,
DATABASE_URL: (env) => env.MANADECK_DATABASE_URL,
MANA_SERVICE_URL: (env) => env.MANA_CORE_AUTH_URL,
APP_ID: (env) => env.MANADECK_APP_ID,
GOOGLE_GENAI_API_KEY: (env) => env.GOOGLE_GENAI_API_KEY,
},
},