# Database Seeding {#database-seeding}


Seed the database with initial and demo data.


## Overview {#overview}


Gauzy seeds data automatically on first startup. The seeding system supports:

- **Default data** — required for the system to function (roles, permissions, languages)
- **Demo data** — example organization, employees, and activities for testing


## Seed Architecture {#seed-architecture}






```mermaid
graph TB
    Start[API Startup] --> Check{First Run?}
    Check -->|Yes| Default[Seed Default Data]
    Check -->|No| Skip[Skip Seeding]
    Default --> Demo{Demo Mode?}
    Demo -->|Yes| DemoData[Seed Demo Data]
    Demo -->|No| Ready[API Ready]
    DemoData --> Ready
```






## Configuration {#configuration}


```env
# Enable demo data seeding
DEMO=true

# Seed on startup
IS_SEED=true
```


## Default Seed Data {#default-seed-data}


| Entity          | Data                         |
| --------------- | ---------------------------- |
| Languages       | 30+ languages                |
| Countries       | All countries                |
| Currencies      | Major currencies             |
| Roles           | SUPER_ADMIN, ADMIN, EMPLOYEE |
| Permissions     | All permission definitions   |
| Feature Toggles | Default feature settings     |


## Demo Seed Data {#demo-seed-data}


| Entity       | Data                  |
| ------------ | --------------------- |
| Tenant       | "Ever Technologies"   |
| Organization | Demo organization     |
| Admin User   | admin@ever.co / admin |
| Employees    | 10+ demo employees    |
| Projects     | Sample projects       |
| Tasks        | Sample tasks          |
| Time Logs    | Demo time entries     |


## Custom Seeding {#custom-seeding}


```typescript
// Create a custom seeder
export class CustomSeeder {
  async run(dataSource: DataSource): Promise<void> {
    const repo = dataSource.getRepository(MyEntity);
    await repo.save([{ name: "Item 1" }, { name: "Item 2" }]);
  }
}
```


## Running Seeds Manually {#running-seeds-manually}


```bash
# Run all seeds
yarn seed:all

# Run only default seeds
yarn seed:default

# Run only demo seeds
yarn seed:demo
```


## Related Pages {#related-pages}


- [Database Schema](https://sourcey-gauzy.pages.dev/database/schema-overview/index.md) — schema
- [Getting Started](https://sourcey-gauzy.pages.dev/tutorials/getting-started-tutorial/index.md) — setup tutorial
- [Test Fixtures](https://sourcey-gauzy.pages.dev/testing/test-fixtures/index.md) — test data
