# Inventory Management

Laravel API + Nuxt (Vue) client for inventory management.

## Stack

| Layer | Tech |
| --- | --- |
| API | Laravel 13 (`/api`) |
| Client | Nuxt 4 / Vue 3 (`/client`) |
| Styling | Tailwind CSS |
| Database | PostgreSQL |
| Auth | Laravel Sanctum (API-ready) |
| Tests | Pest |

## Prerequisites

- PHP 8.3+
- Composer
- Node.js 22+ (24 recommended for Nuxt 4)
- PostgreSQL 14+

## Database

Create a PostgreSQL database (already configured for local use):

```bash
createdb inventory_management
```

Default connection in `api/.env`:

```
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=inventory_management
DB_USERNAME=chirag
DB_PASSWORD=
```

## Setup

### API

```bash
cd api
cp .env.example .env   # if needed
composer install
php artisan key:generate
php artisan migrate
php artisan serve
```

API runs at [http://localhost:8000](http://localhost:8000)  
Health check: [http://localhost:8000/api/health](http://localhost:8000/api/health)

### Client

```bash
cd client
cp .env.example .env   # if needed
npm install
npm run dev
```

Client runs at [http://localhost:3000](http://localhost:3000)

## Project structure

```
.
├── api/                 # Laravel API
│   ├── app/
│   │   ├── Http/Controllers/Api/
│   │   └── Models/
│   ├── routes/api.php
│   └── database/migrations/
└── client/              # Nuxt / Vue frontend
    ├── app/
    │   ├── components/forms/
    │   ├── composables/
    │   ├── layouts/
    │   └── pages/
    └── nuxt.config.js
```

## Notes

- Inventory domain models/features are not implemented yet — scaffolding only.
- Frontend is JavaScript (composition API / `<script setup>`), Tailwind for styling.
- Client talks to the API via `useApi()` (`NUXT_PUBLIC_API_BASE`).
