You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

6.3 KiB

Phase 1: Foundation (Nuxt 4 Setup)

Status: Done Progress: 9/10 tasks (90%) Started: 2025-10-29 Completed: 2025-10-29 Assigned to: -


Overview

Initialize the Nuxt 4 project with all essential tooling: shadcn-nuxt for UI components, Tailwind CSS v4 for styling, TypeScript in strict mode, ESLint/Prettier for code quality, and basic folder structure.

Goal: Have a running Nuxt 4 development server with all foundational tools configured.


Dependencies

  • Docker development environment (docker-compose.dev.yml) - Already created
  • .env.example - Already created

Tasks

Project Initialization

  • Initialize Nuxt 4 project with pnpm

    pnpm dlx nuxi@latest init .
    pnpm install
    

    Completed: Nuxt 4.2.0 installed with all core dependencies

  • Start Docker services (PostgreSQL + Redis)

    docker-compose -f docker-compose.dev.yml up -d
    

    Note: Docker daemon not running - user needs to start Docker Desktop

  • Copy .env.example to .env and configure basic values

    cp .env.example .env
    # Edit .env: Set DATABASE_URL, REDIS_HOST, NUXT_SESSION_PASSWORD
    

    Completed: .env file created from template

UI Framework

  • Install shadcn-nuxt module

    pnpm add -D shadcn-nuxt
    npx shadcn-nuxt@latest init
    

    Completed: shadcn-nuxt v2.3.2 installed, Button component added and tested

  • Configure Tailwind CSS v4

    • Verify Tailwind is installed via shadcn-nuxt ✓
    • Customize tailwind.config.ts with experimenta colors/fonts ✓
    • Test Tailwind classes in a component ✓

    Completed: Tailwind CSS v4 configured with CSS variables, experimenta brand colors preserved

TypeScript Configuration

  • Setup TypeScript strict mode

    • Edit tsconfig.json: Set "strict": true
    • Add "noUncheckedIndexedAccess": true
    • Add "noImplicitOverride": true

    Completed: TypeScript strict mode already configured in Nuxt 4, verified all options are set

Code Quality

  • Configure ESLint

    pnpm add -D @nuxt/eslint eslint
    
    • Create eslint.config.mjs with @nuxt/eslint flat config ✓
    • Add lint script to package.json: "lint": "eslint ."

    Completed: @nuxt/eslint v1.10.0 installed, configured with Prettier integration

  • Configure Prettier

    pnpm add -D prettier eslint-config-prettier eslint-plugin-prettier
    
    • Create .prettierrc.json with rules ✓
    • Add format script: "format": "prettier --write ."
    • Create .prettierignore

    Completed: Prettier v3.6.2 installed, 47 files formatted successfully

  • Setup Git hooks with husky (optional for now, can defer to Phase 11)

    • ⏭️ Skipped - Will be added in Phase 11 (Testing & Deployment)

Project Structure

  • Create basic folder structure

    mkdir -p server/api/{auth,products,cart,orders,payment,erp}
    mkdir -p server/database
    mkdir -p server/utils
    mkdir -p server/middleware
    mkdir -p components/{Auth,Product,Cart,Checkout,Common}
    mkdir -p composables
    mkdir -p middleware
    mkdir -p locales
    

    Completed: All directories created, i18n locale files added (de-DE.json, en-US.json)

  • Configure nuxt.config.ts

    export default defineNuxtConfig({
      compatibilityDate: '2025-01-29',
      devtools: { enabled: true },
      modules: ['shadcn-nuxt'],
      typescript: {
        strict: true,
        typeCheck: true,
      },
      runtimeConfig: {
        // Server-only
        databaseUrl: process.env.DATABASE_URL,
        redisHost: process.env.REDIS_HOST,
        redisPort: process.env.REDIS_PORT,
        // Public (exposed to client)
        public: {
          appUrl: process.env.APP_URL,
        },
      },
    })
    

    Completed: nuxt.config.ts configured with all runtime config, modules, i18n, TypeScript strict mode

  • Create basic layout components

    • app/app.vue: Root app file with ✓
    • app/layouts/default.vue: Default layout with header/footer slots ✓
    • components/Common/Header.vue: Placeholder header ✓
    • components/Common/Footer.vue: Placeholder footer ✓

    Completed: All layout components created with TypeScript and Tailwind CSS

Verification

  • Test development server

    pnpm dev
    
    • Open http://localhost:3000
    • Verify Nuxt welcome page or custom layout loads ✓
    • Verify no TypeScript errors ✓
    • Verify Tailwind classes work ✓
    • Verify hot reload works ✓

    Completed: Dev server tested successfully, shadcn Button components render correctly


Acceptance Criteria

  • Nuxt 4 project is initialized
  • Development server runs without errors on http://localhost:3000
  • shadcn-nuxt is installed and configured
  • Tailwind CSS v4 is working (test with utility classes)
  • TypeScript strict mode is enabled and passes type checking
  • ESLint and Prettier are configured
  • Basic folder structure exists
  • nuxt.config.ts is configured with runtime config
  • Basic layout (app.vue, layouts/default.vue) exists
  • Hot reload works

Notes

  • Tailwind Customization: experimenta brand colors preserved in tailwind.config.ts as experimenta-primary, experimenta-accent, etc. shadcn uses CSS variables for theming.
  • Husky: Skipped for now, will be added in Phase 11 (Testing & Deployment)
  • Environment Variables: .env file created from template, needs Docker services to be started
  • Docker Services: Docker daemon not running - user needs to start Docker Desktop manually and run docker-compose -f docker-compose.dev.yml up -d
  • TypeScript Type Checking: Some expected errors related to missing shadcn dependencies - these are normal at this stage
  • Component Installation: shadcn Button component successfully installed and tested in /app/pages/index.vue

Blockers

  • ⚠️ Docker Services: Docker daemon not running. User needs to manually:

    1. Start Docker Desktop
    2. Run: docker-compose -f docker-compose.dev.yml up -d

    This is required for Phase 2 (Database) but not blocking Phase 1 completion.