Skip to content

Getting Started

This guide will help you set up APiGen and create your first API.

Prerequisites

  • Java 25+ (OpenJDK or GraalVM)
  • Docker (for databases and services)
  • Gradle 9.3+ (included via wrapper)

Installation

Clone the Repository

bash
git clone https://github.com/jnzader/apigen.git
cd apigen

Build the Project

bash
./gradlew build -x test

Verify Installation

bash
./gradlew :generator:cli:run --args="--help"

Project Structure

After cloning, you'll see:

apigen/
├── libs/               # Core libraries
│   ├── bom/            # Bill of Materials
│   ├── core/           # CRUD, auditing, caching
│   ├── security/       # JWT, OAuth2
│   └── exceptions/     # Error handling

├── generator/          # Code generation
│   ├── codegen/        # Multi-language engine
│   ├── server/         # REST API server
│   ├── cli/            # Command-line tool
│   └── ide-plugins/    # IDE integrations

├── features/           # Advanced modules
│   ├── graphql/
│   ├── grpc/
│   ├── gateway/
│   └── ...

├── mcp/                # AI Integration
│   ├── java/           # Native MCP server
│   └── python/         # Python wrapper

└── apigen-examples/    # Example projects

Quick Verification

Run the Generation Server

bash
./gradlew :generator:server:bootRun

The server starts at http://localhost:8080. Test it:

bash
curl http://localhost:8080/api/languages

Run the CLI

bash
./gradlew :generator:cli:run --args="list-languages"

Configuration

Gradle Properties

Edit gradle.properties for global settings:

properties
# Java version
javaVersion=25

# Default target language
defaultLanguage=java-spring

# Coverage thresholds
jacocoMinCoverage=0.60
pitestThreshold=0.10

Environment Variables

bash
# For AI code review (optional)
export ANTHROPIC_API_KEY=your-key-here

# For database tests
export TEST_DB_URL=jdbc:postgresql://localhost:5432/test

Next Steps

Now that APiGen is installed:

  1. Quick Start - Generate your first API
  2. Code Generation - Learn the generation options
  3. Module Overview - Explore available modules

Troubleshooting

Java Version Issues

bash
# Check Java version
java -version

# Should show: openjdk version "25" or higher

If using wrong version, set JAVA_HOME:

bash
export JAVA_HOME=/path/to/jdk-25

Gradle Issues

bash
# Clear Gradle cache
./gradlew clean --refresh-dependencies

# Use specific Gradle version
./gradlew wrapper --gradle-version 9.3

Docker Issues

Ensure Docker is running for integration tests:

bash
docker info

Start required services:

bash
docker-compose -f docker/docker-compose.yml up -d

Released under the MIT License.