Files
my2/nuxt.config.ts
Bastian Masanek b372e2cf78 Implement shopping cart functionality with UI components and API integration
- Added CartItem, CartSummary, CartEmpty, CartSidebar, and CartSheet components for managing cart display and interactions.
- Integrated useCart and useCartUI composables for cart state management and UI control.
- Implemented API endpoints for cart operations, including fetching, adding, updating, and removing items.
- Enhanced user experience with loading states and notifications using vue-sonner for cart actions.
- Configured session management for guest and authenticated users, ensuring cart persistence across sessions.

This commit completes the shopping cart feature, enabling users to add items, view their cart, and proceed to checkout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-11-03 12:43:13 +01:00

116 lines
3.5 KiB
TypeScript

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-01-29',
devtools: {
enabled: ['true', '1'].includes(process.env.NUXT_DEVTOOLS_ENABLED || ''),
},
// App configuration
app: {
head: {
// Roboto font is now loaded locally from /public/fonts/roboto/
// See @font-face declarations in assets/css/tailwind.css
link: [
{
rel: 'preload',
as: 'font',
type: 'font/woff2',
href: '/fonts/roboto/Roboto-VariableFont-latin.woff2',
crossorigin: 'anonymous',
},
],
},
},
// Modules
modules: ['nuxt-auth-utils', '@nuxtjs/tailwindcss', 'shadcn-nuxt', '@nuxt/eslint'],
// i18n configuration (temporarily disabled for debugging)
// i18n: {
// locales: [
// { code: 'de', language: 'de-DE', file: 'de-DE.json', name: 'Deutsch' },
// { code: 'en', language: 'en-US', file: 'en-US.json', name: 'English' },
// ],
// defaultLocale: 'de',
// lazy: true,
// langDir: 'locales',
// strategy: 'prefix_except_default',
// vueI18n: './i18n.config.ts',
// },
// shadcn-nuxt configuration
shadcn: {
prefix: '',
componentDir: './app/components/ui',
},
// Runtime configuration
runtimeConfig: {
// Server-only config
databaseUrl: process.env.DATABASE_URL,
redisHost: process.env.REDIS_HOST || 'localhost',
redisPort: process.env.REDIS_PORT || '6379',
internalAuthEnabled: ['true', '1'].includes(process.env.INTERNAL_AUTH_ENABLED || '') || false,
internalAuthUsername: process.env.INTERNAL_AUTH_USERNAME || '',
internalAuthPassword: process.env.INTERNAL_AUTH_PASSWORD || '',
// Cidaas OAuth2 Configuration
cidaas: {
clientId: process.env.CIDAAS_CLIENT_ID,
clientSecret: process.env.CIDAAS_CLIENT_SECRET,
issuer: process.env.CIDAAS_ISSUER,
authorizeUrl: process.env.CIDAAS_AUTHORIZE_URL,
tokenUrl: process.env.CIDAAS_TOKEN_URL,
userinfoUrl: process.env.CIDAAS_USERINFO_URL,
jwksUrl: process.env.CIDAAS_JWKS_URL,
redirectUri: process.env.CIDAAS_REDIRECT_URI,
postLogoutRedirectUri: process.env.CIDAAS_POST_LOGOUT_REDIRECT_URI || process.env.APP_URL || 'http://localhost:3000',
},
// Session configuration
// Note: nuxt-auth-utils automatically reads NUXT_SESSION_PASSWORD from process.env
session: {
maxAge: 60 * 60 * 24 * 30, // 30 days in seconds
name: 'experimenta-session',
},
// Shopping Cart configuration
cart: {
sessionCookieName: process.env.CART_SESSION_COOKIE_NAME || 'cart-session',
expiryDays: Number.parseInt(process.env.CART_EXPIRY_DAYS || '30', 10),
},
// Test credentials (for automated testing only)
// ⚠️ ONLY use in development/staging - NEVER in production
testUser: {
email: process.env.TEST_USER_EMAIL || '',
password: process.env.TEST_USER_PASSWORD || '',
},
// Public (exposed to client)
public: {
appUrl: process.env.APP_URL || 'http://localhost:3000',
},
},
// TypeScript configuration
typescript: {
strict: true,
typeCheck: false, // Disabled for now, will enable in later phases with vue-tsc
},
// Security headers for auth routes
nitro: {
routeRules: {
'/api/auth/**': {
headers: {
'X-Frame-Options': 'DENY',
'X-Content-Type-Options': 'nosniff',
'Referrer-Policy': 'strict-origin-when-cross-origin',
},
},
},
},
})