Skip to main content
Create your first .NET project with Chapi Assistant and experience the power of automated scaffolding, code generation, and AI assistance.

Prerequisites

Before starting, ensure you have completed the Installation guide and configured Git with your user identity.
1

Verify Installation

Open Chapi Assistant and verify it launches successfully. The main window should display with tabs for Changes, History, Assistant, and Releases.
2

Configure Git Identity (if needed)

If you haven’t configured Git yet:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Create Your First Project

1

Open Project Creation Dialog

In Chapi Assistant, navigate to the workspace panel and click New Project or use the project creation button in the toolbar.
2

Configure Project Details

Fill in the project creation form:
Project Name
string
required
Name for your new project (e.g., “MyApi”)
Parent Directory
string
required
Directory where the project will be created (e.g., C:\Projects)
Template URL
string
required
Git repository URL for the base template. Default is often pre-configured (e.g., https://gitlab.com/net-core2/api-base.git)
Remote URL
string
Optional: Your new Git remote repository URL (e.g., GitHub or GitLab repo)
3

Watch the Magic Happen

Click Create Project and watch the progress log. Chapi will:
Clonando repositorio base...
Limpiando metadatos de Git...
Personalizando estructura del proyecto...
Inicializando nuevo repositorio Git...
Asociando repositorio remoto...
Registrando proyecto en Chapi...
The CreateProjectUseCase.cs executes these operations:
// 1. Clone the template repository
var cloneResult = await _gitRepository.CloneAsync(request.TemplateUrl, targetPath);

// 2. Remove original .git folder
DeleteDirectory(Path.Combine(targetPath, ".git"));

// 3. Rename project structure
await _templateService.RenameTemplateAsync(targetPath, oldName, request.ProjectName, onProgress);

// 4. Initialize new Git repository
await _gitRepository.InitAsync(targetPath);

// 5. Add remote (if provided)
if (!string.IsNullOrWhiteSpace(request.RemoteUrl))
    await _gitRepository.AddRemoteAsync(targetPath, "origin", request.RemoteUrl);

// 6. Register in workspace
await _projectRepository.AddProjectAsync(targetPath);
Source: CreateProjectUseCase.cs:30-73
4

Explore Your New Project

Your project is now ready! The structure should look like this:
MyApi/
├── MyApi.sln
├── MyApi/
│   ├── Controllers/ (or Endpoints/ for Ardalis)
│   ├── Config/
│   │   └── DependencyInjection.cs
│   └── MyApi.csproj
├── Application/
│   └── Application.csproj
├── Domain/
│   └── Domain.csproj
└── Infrastructure/
    ├── Postgres/ (or Sybase/)
    └── Infrastructure.csproj

Make Your First Commit

1

View Changes

Switch to the Changes tab in Chapi Assistant. You’ll see all the renamed files ready to commit.
2

Generate AI Commit Message

Instead of writing a commit message manually, click the AI Generate button. Chapi will analyze your changes and create a meaningful commit message:
Initial project setup: Create MyApi from template

- Initialize Clean Architecture structure
- Configure dependency injection
- Set up API project with controllers
The AI analyzes the actual Git diff to generate context-aware commit messages. This feature uses your configured AI provider (Gemini, OpenAI, or Claude).
3

Commit Changes

Review the generated message, make any adjustments, and click Commit. Your first commit is now in the repository!

Generate Your First Module

Now let’s add a complete CRUD module with Chapi’s code generation:
1

Open Code Generation

Click the Assistant tab and select Generate Module or use the module generator in the toolbar.
2

Configure Module

Enter module details:
  • Module Name: Products
  • Database: Postgres (or Sybase)
Click Generate
3

Review Generated Code

Chapi generates code across all Clean Architecture layers:API Layer (Controllers/Products/ or Endpoints/Products/):
[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase
{
    private readonly IProductsApplication _application;
    
    [HttpGet]
    public async Task<IActionResult> Get()
    {
        var result = await _application.Get();
        return Ok(result);
    }
    
    [HttpGet("{id}")]
    public async Task<IActionResult> GetById(int id)
    {
        var result = await _application.GetById(id);
        return Ok(result);
    }
    
    [HttpPost]
    public async Task<IActionResult> Post([FromBody] ProductDto dto)
    {
        var result = await _application.Post(dto);
        return Ok(result);
    }
}
Application Layer, Domain Layer, and Infrastructure Layer are also generated with complete CRUD implementations.
For each module, Chapi creates:
  • 3 API endpoints: Get (list), GetById, Post
  • Application Use Cases: Business logic for each operation
  • Domain Entities: Your domain model
  • Infrastructure Repositories: Database access layer
  • Dependency Injection: Auto-configured in DependencyInjection.cs
Source: ModuleGeneratorService.cs:22-95
4

Commit Generated Code

Go back to the Changes tab, generate another AI commit message for the new module, and commit:
Add Products module with CRUD operations

- Generate API controller with Get, GetById, and Post endpoints
- Create application use cases
- Add domain entities and repository interfaces
- Implement infrastructure repository
- Configure dependency injection

Push to Remote Repository

1

Configure Authentication

If you provided a remote URL during project creation, you need to authenticate:
  1. Go to Settings > Git Authentication
  2. Click Login with GitHub
  3. Complete OAuth flow in your browser
  4. Tokens are securely stored in Windows Credential Manager
See Git Authentication for detailed setup.
2

Push Changes

In the Changes tab, click the Push button. Chapi will push all commits to your remote repository.
Pushing to origin/main...
✓ Successfully pushed 2 commits

Next Steps

You’ve successfully created a project, generated code, and pushed to Git! Explore these advanced features:

Git Workflow

Master branching, stashing, and conflict resolution

AI Assistant

Configure AI providers and use the conversational assistant

Module Generation

Learn advanced code generation techniques

Architecture

Understand the Clean Architecture implementation

Common Workflows

  1. Go to Changes tab
  2. Click the branch dropdown
  3. Click New Branch
  4. Enter branch name (e.g., feature/add-authentication)
  5. Start working on your feature
In the module generator, enter multiple module names separated by semicolons:
Products;Orders;Customers
Chapi will generate all three modules in one operation.
If code generation doesn’t produce the desired result:
  1. Open the Rollback view
  2. Select the transaction to rollback
  3. Click Execute Rollback
All files modified in that transaction are restored to their previous state.
  1. Click the Workspace dropdown in the toolbar
  2. Select another project
  3. Chapi switches context immediately
All Git operations, code generation, and AI context now target the selected project.
Keyboard shortcuts: Press Ctrl+K to open the command palette for quick access to all features.

Troubleshooting

The target directory already contains a folder with your project name. Either:
  • Choose a different project name
  • Delete the existing directory
  • Select a different parent directory
Ensure you’ve completed the OAuth flow:
  1. Go to Settings > Git Authentication
  2. Click Logout then Login again
  3. Complete the browser OAuth flow
  4. Verify credentials in Windows Credential Manager
Check your AI provider configuration:
  1. Go to Settings > AI Providers
  2. Verify your API key is entered correctly
  3. Check your API quota/billing status
  4. Try switching to a different provider (Gemini, OpenAI, or Claude)
See AI Setup Guide for detailed configuration.
  1. Check that Chapi correctly detected your architecture (Ardalis vs Classic)
  2. Verify your project structure matches the expected layout
  3. Use the Rollback feature to undo the generation
  4. Try generating a single operation instead of a full module
For more detailed guides, explore the Features and Guides sections.

Build docs developers (and LLMs) love