Developer Guide

Development setup and API documentation for Wraft

Wraft Developer Guide

Wraft is an open-source Contract Lifecycle Management (CLM) tool built with Elixir and Phoenix that helps businesses produce their most important documents with complete control over the entire lifecycle.

๐ŸŽฏ Architecture Overview

Wraft is built on top of open formats, using Markdown and JSON to ensure your content is always accessible and future-proof. Our goal is to give people complete control over their most important documents, from drafting to collaborating and distributing.

๐Ÿš€ Quick Start

Clone the Repository

git clone https://github.com/wraft/wraft.git
cd wraft

Install Dependencies

Follow the detailed setup guide for your operating system

Configure Environment

cp .env.example .env.dev
# Edit .env.dev with your configuration
source .env.dev

Run the Application

mix setup
iex -S mix phx.server

๐Ÿ“‹ System Requirements

Ensure you have all required dependencies installed before proceeding with the setup.

Core Dependencies

  • Elixir 1.17
  • Erlang/OTP 27

Use .tool-versions for exact version requirements with asdf version manager.

๐Ÿ”ง Development Setup

1. Version Manager Setup

We recommend using asdf for managing Elixir and Erlang versions to ensure consistency across development environments.

# Install asdf plugins
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
 
# Install versions from .tool-versions
asdf install

2. Platform-Specific Dependencies

# Install dependencies via Homebrew
brew install postgresql minio pandoc imagemagick inotify-tools
 
# Install MacTeX for LaTeX
# Download from: https://www.tug.org/mactex/

3. Application Setup

# Load environment variables
source .env.dev
 
# Set up the project (installs deps, sets up database)
mix setup
 
# Start the Phoenix server
mix phx.server
 
# Or with interactive shell
iex -S mix phx.server

Success! Your development server should now be running at http://localhost:4000

๐Ÿงช Testing

# Run the full test suite
mix test
 
# Run tests with coverage
mix test --cover
 
# Run specific test file
mix test test/wraft_doc/document_test.exs
 
# Run tests in watch mode
mix test.watch

๐Ÿ—๏ธ Project Structure

wraft/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ wraft/           # Core business logic
โ”‚   โ”œโ”€โ”€ wraft_doc/       # Document processing
โ”‚   โ””โ”€โ”€ wraft_web/       # Phoenix web layer
โ”œโ”€โ”€ test/                # Test files
โ”œโ”€โ”€ priv/
โ”‚   โ”œโ”€โ”€ repo/migrations/ # Database migrations
โ”‚   โ””โ”€โ”€ static/          # Static assets
โ”œโ”€โ”€ config/              # Application configuration
โ””โ”€โ”€ docs/                # Additional documentation

๐Ÿ“š Additional Resources

๐Ÿ†˜ Getting Help

Having trouble with setup? Check our troubleshooting guide or reach out to the community.

  • GitHub Issues: Report bugs and request features
  • Discussions: Ask questions and share ideas
  • Discord: Real-time community support
  • Documentation: Comprehensive guides and references

Ready to contribute? Check out our Contributing Guidelines to get started with your first contribution.