# Getting Started

## Prerequisites

- Node.js >= 20.0.0
- PNPM >= 8.0.0
- Docker & Docker Compose
- Git
- Neon account (https://neon.tech) - for database

## Initial Setup

1. **Clone the repository**
   ```bash
   git clone <repository-url>
   cd Base
   ```

2. **Setup Neon Database**
   ```bash
   # Run setup script
   ./scripts/db/setup-neon.sh
   
   # Or manually:
   # 1. Create Neon project at https://neon.tech
   # 2. Create branches: main (dev), staging, production
   # 3. Get connection strings
   # 4. Update deployments/local/.env.local
   ```
   
   See [Neon Setup Guide](../../infra/databases/neon/README.md) for details.

3. **Initialize the project**
   ```bash
   ./scripts/setup/init-project.sh
   ```

4. **Start infrastructure** (Redis, Traefik - no PostgreSQL needed)
   ```bash
   cd deployments/local
   docker-compose up -d
   cd ../..
   ```

5. **Run database migrations**
   ```bash
   ./scripts/db/migrate.sh iam-service dev
   ```

6. **Seed the database**
   ```bash
   ./scripts/db/seed.sh iam-service
   ```

7. **Start all services**
   ```bash
   ./scripts/dev/start-all.sh
   ```

## Access Points

- **API Gateway**: http://localhost/api/v1
- **Auth Service**: http://localhost:5001
- **Web Admin**: http://admin.localhost or http://localhost:3000
- **Web Client**: http://localhost or http://localhost:3001
- **Traefik Dashboard**: http://localhost:8080

## Database

This project uses **Neon PostgreSQL** for all environments:
- **Development**: Neon main branch
- **Staging**: Neon staging branch
- **Production**: Neon production branch

No local PostgreSQL needed! See [Neon Setup](../../infra/databases/neon/README.md) for details.

## Next Steps

- Read [Development Guide](development.md)
- Check [API Documentation](../api/openapi/)
- Review [Architecture Overview](../architecture/system-design.md)
