Building Wraft

Building and customizing Wraft

Building Wraft

This guide covers building Wraft from source and customizing the platform for your specific needs.

Building from Source

Prerequisites

Ensure you have all the prerequisites installed before building Wraft.

Build Process

  1. Clone the repository

    git clone https://github.com/wraft/wraft.git
    cd wraft
  2. Install dependencies

    mix deps.get
  3. Setup the database

    mix ecto.setup
  4. Build the application

    mix compile
  5. Run tests

    mix test

Customization

Environment Configuration

Wraft uses environment variables for configuration. Copy the example environment file and customize it:

cp .env.example .env.dev

Key configuration options include:

  • Database connection settings
  • MinIO/S3 storage configuration
  • Application secrets and keys
  • External service integrations

Database Migrations

To run database migrations:

mix ecto.migrate

To rollback migrations:

mix ecto.rollback

Asset Compilation

For production builds, compile assets:

mix assets.deploy

Development Workflow

Interactive Development

Start the development server with an interactive shell:

iex -S mix phx.server

Hot Reloading

Wraft supports hot reloading during development. Changes to Elixir files will automatically reload the server.

Debugging

Use the interactive shell for debugging:

# In the IEx shell
iex> Wraft.Repo.all(Wraft.Documents.Document)

Production Build

For production deployment:

  1. Set production environment

    export MIX_ENV=prod
  2. Install production dependencies

    mix deps.get --only prod
  3. Compile for production

    mix compile
  4. Run database migrations

    mix ecto.migrate
  5. Start the production server

    mix phx.server

Troubleshooting

Common Issues

  • Database connection errors: Ensure PostgreSQL is running and accessible
  • MinIO connection issues: Verify MinIO server is running on the correct port
  • Missing dependencies: Run mix deps.get to install all dependencies
  • Permission errors: Ensure proper file permissions for the application directory

Getting Help

On this page