From Source

Build and run Authority from source code.

Prerequisites

Step 1: Clone Repository

git clone https://github.com/azutoolkit/authority.git
cd authority

Step 2: Install Dependencies

shards install

Step 3: Set Up Database

Create the database:

createdb authority_db

Or using psql:

Step 4: Configure Environment

Copy the example environment file:

Edit .env.local:

Step 5: Run Migrations

Step 6: Seed Default Data (Optional)

Create an admin user:

Step 7: Start the Server

Development mode:

Or with hot reload:

Production Build

Compile Release Binary

Run Production Server

Running Tests

Run specific tests:

Development Workflow

Watch for Changes

Use watchexec or similar:

Database Reset

File Structure

Common Issues

Crystal not found

Ensure Crystal is in your PATH:

PostgreSQL connection refused

Start PostgreSQL:

Shards install fails

Update shards cache:

Port already in use

Check what's using the port:

Next Steps

Last updated

Was this helpful?