Skip to main content

Overview

Concordia is built with Astro and supports multiple deployment targets. The adapter is configured dynamically in astro.config.mjs based on build flags.

Adapter Configuration

The astro.config.mjs automatically selects the appropriate adapter:
astro.config.mjs

Deployment Options

Vercel (Default)

The default adapter for zero-configuration deployment.
1

Build for Vercel

Uses @astrojs/vercel adapter automatically.
2

Configure environment variables

In Vercel dashboard, add:
  • DATABASE_URL_PROD - PostgreSQL connection string
  • BETTER_AUTH_SECRET - Auth secret key
  • BETTER_AUTH_URL - Production URL
  • SMTP_PROVIDER, SMTP_USER, SMTP_PASS - Email settings
  • SITE - Your domain (e.g., https://yourdomain.com)
3

Deploy

Connect your repository to Vercel:

Vercel Configuration

Create vercel.json for custom settings:
vercel.json
Vercel automatically detects Astro projects and uses optimal settings. The above vercel.json is optional.

Node.js Deployment

Deploy as a standalone Node.js server.
1

Build for Node.js

Uses @astrojs/node adapter in standalone mode.
2

Configure environment

Create production .env file:
.env.production
3

Run migrations

4

Start server

Or directly:

Process Manager (PM2)

Use PM2 for production process management:

PM2 Ecosystem File

Create ecosystem.config.js for advanced configuration:
ecosystem.config.js
Start with:

Reverse Proxy (Nginx)

Recommended for production Node.js deployments:
nginx.conf
Add SSL with Certbot:

Docker Deployment

Containerize your application:
Dockerfile

Docker Compose

docker-compose.yml
Deploy:

Build Commands Reference

Environment Variables

Required environment variables for production:
.env.production
Never commit .env files to version control. Use your hosting platform’s environment variable management.

Performance Monitoring

Concordia includes Sonda for performance monitoring:
astro.config.mjs

Generate Performance Report

This analyzes your build and generates a report in ./reports.

Internationalization

Concordia supports multiple locales:
astro.config.mjs
URLs are prefixed with locale:
  • /fr/ - French (default)
  • /en/ - English
  • /ar/ - Arabic
  • /es/ - Spanish
The root / redirects to /fr/ by default. Adjust in redirects configuration.

Platform-Specific Guides

Railway

1

Connect repository

Import your Git repository in Railway dashboard.
2

Add PostgreSQL

Add PostgreSQL database from Railway marketplace.
3

Configure build

Railway auto-detects Node.js. Override if needed:
  • Build Command: npm run build:node
  • Start Command: node dist/server/entry.mjs
4

Set environment variables

Add all production environment variables in Railway dashboard.

Render

1

Create Web Service

Connect your repository and select “Web Service”.
2

Configure service

  • Build Command: npm run build:node
  • Start Command: node dist/server/entry.mjs
  • Environment: Node
3

Add PostgreSQL

Create PostgreSQL database in Render dashboard.
4

Set environment variables

Add environment variables including DATABASE_URL_PROD from Render PostgreSQL.

DigitalOcean App Platform

1

Create app

Connect repository from GitHub/GitLab.
2

Configure component

  • Type: Web Service
  • Build Command: npm run build:node
  • Run Command: node dist/server/entry.mjs
3

Add database

Create managed PostgreSQL database.
4

Configure environment

Add environment variables via App Platform dashboard.

Pre-Deployment Checklist

1

Test build locally

2

Run database migrations

3

Test SMTP configuration

4

Verify environment variables

Ensure all required variables are set in hosting platform.
5

Enable sourcemaps (optional)

Already enabled in astro.config.mjs:
6

Set up monitoring

Configure error tracking (Sentry, etc.) and uptime monitoring.

Troubleshooting

Build Fails

TypeScript errors:
Missing dependencies:

Server Errors

Port already in use:
Database connection fails:
  • Verify DATABASE_URL_PROD format
  • Check SSL requirements (?sslmode=require)
  • Ensure database allows connections from hosting IP

Performance Issues

Enable compression: For Node.js deployments, add compression middleware or use Nginx. CDN for static assets: Vercel includes CDN automatically. For Node.js, consider:
  • Cloudflare
  • AWS CloudFront
  • Fastly
Database connection pooling: Ensure PostgreSQL connection pool is configured in Drizzle.

Next Steps

Database Setup

Configure PostgreSQL and run migrations

SMTP Configuration

Set up email delivery for authentication