> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Ishaq74/concordia/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Complete guide to installing and setting up Concordia locally

This guide will walk you through installing Concordia on your local development environment.

## Prerequisites

Before you begin, ensure you have the following installed:

<CardGroup cols={2}>
  <Card title="Node.js" icon="node-js">
    Version 18.x or higher
  </Card>

  <Card title="PostgreSQL" icon="database">
    Version 14.x or higher for local development
  </Card>

  <Card title="Package Manager" icon="box">
    pnpm (recommended), npm, or yarn
  </Card>

  <Card title="Git" icon="git">
    For cloning the repository
  </Card>
</CardGroup>

## Installation Steps

<Steps>
  <Step title="Clone the Repository">
    Clone the Concordia repository to your local machine:

    ```bash theme={null}
    git clone https://github.com/your-org/concordia.git
    cd concordia
    ```
  </Step>

  <Step title="Install Dependencies">
    Install the project dependencies using your preferred package manager:

    <CodeGroup>
      ```bash pnpm theme={null}
      pnpm install
      ```

      ```bash npm theme={null}
      npm install
      ```

      ```bash yarn theme={null}
      yarn install
      ```
    </CodeGroup>

    <Note>
      pnpm is recommended for faster installation and better disk space efficiency.
    </Note>
  </Step>

  <Step title="Set Up Environment Variables">
    Create a `.env` file in the root directory by copying the example file:

    ```bash theme={null}
    cp .env.example .env
    ```

    Configure the essential variables (see [Environment Variables](/deployment/environment-variables) for details):

    ```bash theme={null}
    DATABASE_URL_LOCAL=postgresql://username:password@localhost:5432/concordia
    BETTER_AUTH_SECRET=your-secret-key-here
    BETTER_AUTH_URL=http://localhost:4321
    NODE_ENV=development
    ```
  </Step>

  <Step title="Set Up the Database">
    Run database migrations to set up the schema:

    <CodeGroup>
      ```bash pnpm theme={null}
      pnpm run db:migrate
      ```

      ```bash npm theme={null}
      npm run db:migrate
      ```

      ```bash yarn theme={null}
      yarn db:migrate
      ```
    </CodeGroup>

    Optionally, seed the database with sample data:

    <CodeGroup>
      ```bash pnpm theme={null}
      pnpm run db:seed
      ```

      ```bash npm theme={null}
      npm run db:seed
      ```

      ```bash yarn theme={null}
      yarn db:seed
      ```
    </CodeGroup>
  </Step>

  <Step title="Start the Development Server">
    Launch the Astro development server:

    <CodeGroup>
      ```bash pnpm theme={null}
      pnpm run dev
      ```

      ```bash npm theme={null}
      npm run dev
      ```

      ```bash yarn theme={null}
      yarn dev
      ```
    </CodeGroup>

    The application will be available at `http://localhost:4321`
  </Step>

  <Step title="Verify Installation">
    Open your browser and navigate to:

    * Homepage: `http://localhost:4321/fr/`
    * Sign In: `http://localhost:4321/fr/auth/sign-in`
    * Documentation: `http://localhost:4321/fr/docs`

    <Check>
      If you can access these pages, your installation is successful!
    </Check>
  </Step>
</Steps>

## Key Dependencies

Concordia is built with the following core technologies:

<AccordionGroup>
  <Accordion title="Astro Framework">
    * **astro** `^5.18.0` - Static site generator with SSR support
    * **@astrojs/mdx** `^4.3.13` - MDX support for content
    * **@astrojs/check** `^0.9.6` - TypeScript checking
  </Accordion>

  <Accordion title="Deployment Adapters">
    * **@astrojs/vercel** `^9.0.4` - Vercel deployment adapter
    * **@astrojs/node** `^9.5.4` - Node.js standalone server adapter
  </Accordion>

  <Accordion title="Database & ORM">
    * **drizzle-orm** `^0.45.1` - Type-safe database ORM
    * **pg** `^8.18.0` - PostgreSQL client
    * **drizzle-kit** `^0.31.9` - Database migrations tool
  </Accordion>

  <Accordion title="Authentication">
    * **better-auth** `^1.4.18` - Modern authentication library
    * **jose** `^6.1.3` - JWT handling
  </Accordion>

  <Accordion title="Email & Notifications">
    * **nodemailer** `^7.0.13` - Email sending
  </Accordion>
</AccordionGroup>

## Available Scripts

Once installed, you can use these npm scripts:

### Development

```bash theme={null}
npm run dev           # Start development server
npm run build         # Build for production
npm run preview       # Preview production build
```

### Database Management

```bash theme={null}
npm run db:migrate    # Run database migrations
npm run db:generate   # Generate migration files
npm run db:seed       # Seed database with sample data
npm run db:check      # Check database connection
```

### Testing

```bash theme={null}
npm run test          # Run all tests
npm run test:unit     # Run unit tests only
npm run test:e2e      # Run end-to-end tests
npm run test:coverage # Run tests with coverage
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Database Connection Errors">
    Ensure PostgreSQL is running and the connection string in `.env` is correct:

    ```bash theme={null}
    npm run db:check
    ```

    This will test your database connection and report any issues.
  </Accordion>

  <Accordion title="Port Already in Use">
    If port 4321 is already in use, you can specify a different port:

    ```bash theme={null}
    npm run dev -- --port 3000
    ```
  </Accordion>

  <Accordion title="Module Not Found Errors">
    Try clearing the node\_modules and reinstalling:

    ```bash theme={null}
    rm -rf node_modules pnpm-lock.yaml
    pnpm install
    ```
  </Accordion>

  <Accordion title="SMTP Configuration Issues">
    If you're having email issues, test your SMTP configuration:

    ```bash theme={null}
    npm run smtp:check
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Configuration" icon="gear" href="/deployment/configuration">
    Configure Astro adapters and i18n settings
  </Card>

  <Card title="Environment Variables" icon="key" href="/deployment/environment-variables">
    Set up all required environment variables
  </Card>
</CardGroup>
