ArchForge is a command-line tool for generating the basic structure of a project using templates.
You can quickly create a new project by specifying the name, path, and desired template.
ArchForge offers two ways to create projects:
Run the interactive mode which will guide you through the project creation:
./archforge interactiveThe interactive mode will ask for:
- Project name (default: MyProject)
- Output directory (default: current directory)
- Template to use (select from available options)
- Preview option (Yes/No)
Create a project directly using command line arguments:
./archforge create --name MyProject --template webapi [--output ./path/to/output] [--preview]Required flags:
--nameor-n: The name of your project (must not contain spaces or hyphens)--templateor-t: The template to use
Optional flags:
--outputor-o: Output directory (defaults to current directory)--previewor-p: Preview the project structure before generating
Available templates:
webapi: Basic ASP.NET Core Web APIclean-arch-keycloak-pg-dapper: Clean Architecture with Keycloak, PostgreSQL, and Dapperclean-arch-keycloak-pg-ef: Clean Architecture with Keycloak, PostgreSQL, and Entity Framework
To run the tests, make sure you have Go installed and follow these steps:
- Clone the repository:
git clone https://github.com/Andrei-hub11/archforge.git
cd archforge- Run all tests:
go test ./...- Run tests for a specific package:
go test ./cmd- Run tests with verbose output:
go test -v ./...Note: Some interactive tests may be skipped in CI environments as they require user input. These tests are automatically skipped when the CI environment variable is set.
ArchForge includes integration tests that verify the template generation and compilation. These tests:
- Generate projects from each template
- Verify the correct folder structure and file creation
- Test that the generated projects can be built with
dotnet build - Verify that the basic WebAPI template can be run with
dotnet run
Integration tests require that you have the .NET SDK installed on your system.
Run the PowerShell script:
./run_integration_tests.ps1Run the bash script:
chmod +x ./run_integration_tests.sh
./run_integration_tests.shAlternatively, you can run specific integration tests:
# Set environment variable
export INTEGRATION_TESTS=1 # or $env:INTEGRATION_TESTS=1 in PowerShell
# Template generation tests
go test -v ./internal/generator -run TestTemplateGeneration_
# Folder structure tests
go test -v ./internal/generator -run TestFolderStructure_
# Project execution tests
go test -v ./internal/generator -run TestProjectExecution_These tests verify that templates can be properly generated, that they have the correct structure, and that the generated code can be built and run successfully.