|
| 1 | +# CodeBlock DevKit Template |
| 2 | + |
| 3 | +A comprehensive SaaS application template built with the [CodeBlock DevKit](https://codeblock.dev/) framework. This template provides a complete foundation for building modern, scalable SaaS applications with enterprise-grade architecture. |
| 4 | + |
| 5 | +## 🎬 Demo & Resources |
| 6 | + |
| 7 | +- **Website**: [https://codeblock.dev/](https://codeblock.dev/) |
| 8 | +- **Documentation**: [https://docs.codeblock.dev/](https://docs.codeblock.dev/) |
| 9 | +- **Demo Video**: [Watch how to use this template](https://codeblock.dev/demo) |
| 10 | + |
| 11 | +## 📋 Prerequisites: Purchasing a License |
| 12 | + |
| 13 | +To use this template, you need to purchase a license from the CodeBlock DevKit website. Here's how to get started: |
| 14 | + |
| 15 | +1. **Purchase a License**: Visit [https://codeblock.dev/pricing](https://codeblock.dev/pricing) and select the appropriate license for your needs |
| 16 | +2. **Download Your License**: After purchase, download your license file from your user dashboard |
| 17 | +3. **Place License File**: Copy the license file to the root directory of this template project |
| 18 | +4. **Run the Template**: Execute the setup script to configure your SaaS application |
| 19 | + |
| 20 | +## 📥 Download the Template |
| 21 | + |
| 22 | +You can download this template in two ways: |
| 23 | + |
| 24 | +### Option 1: Download ZIP File |
| 25 | +1. Go to [https://github.com/CodeBlock-Dev/CodeBlock.DevKit.Template](https://github.com/CodeBlock-Dev/CodeBlock.DevKit.Template) |
| 26 | +2. Click the green "Code" button |
| 27 | +3. Select "Download ZIP" |
| 28 | +4. Extract the ZIP file to your desired location |
| 29 | + |
| 30 | +### Option 2: Clone with Git |
| 31 | +```bash |
| 32 | +git clone https://github.com/CodeBlock-Dev/CodeBlock.DevKit.Template.git |
| 33 | +cd CodeBlock.DevKit.Template |
| 34 | +``` |
| 35 | + |
| 36 | +### Important Notes |
| 37 | +- All DevKit modules are delivered via NuGet packages, so you only need to maintain your business logic |
| 38 | +- You can update DevKit modules to the latest versions using the update script in the [Build section](#build-and-maintenance) |
| 39 | + |
| 40 | +## ⚙️ Setup the Template |
| 41 | + |
| 42 | +The template includes automated setup scripts for different operating systems: |
| 43 | + |
| 44 | +1. **Navigate to Setup Folder**: Go to the `/setup` directory |
| 45 | +2. **Run Setup Script**: Execute the appropriate script for your OS: |
| 46 | + - **Windows**: Run `setup.bat` or `setup.ps1` |
| 47 | + - **macOS/Linux**: Run `setup.sh` |
| 48 | +3. **Configure Your Application**: The setup wizard will guide you through: |
| 49 | + - Setting your solution name |
| 50 | + - Configuring database settings |
| 51 | + - Setting up admin user credentials |
| 52 | + - Customizing application settings |
| 53 | + |
| 54 | +## 🔧 Build and Maintenance |
| 55 | + |
| 56 | +This template includes comprehensive build automation using the [NUKE build system](https://nuke.build/). The build system is organized in the `/4-Build` directory with scripts for different tasks. |
| 57 | + |
| 58 | +### Available Build Scripts |
| 59 | + |
| 60 | +| Script Category | Location | Purpose | |
| 61 | +|----------------|----------|---------| |
| 62 | +| **Compile** | `/scripts/compile/` | Builds the entire solution | |
| 63 | +| **Lint** | `/scripts/lint/` | Runs code quality checks | |
| 64 | +| **Tests** | `/scripts/tests/` | Executes unit and integration tests | |
| 65 | +| **Packages** | `/scripts/packages/` | Updates CodeBlock.DevKit NuGet packages | |
| 66 | + |
| 67 | +### Running Build Scripts |
| 68 | + |
| 69 | +**Windows:** |
| 70 | +```powershell |
| 71 | +# PowerShell (recommended) |
| 72 | +.\scripts\compile\Compile.ps1 |
| 73 | +.\scripts\lint\Lint.ps1 |
| 74 | +.\scripts\tests\RunUnitTests.ps1 |
| 75 | +.\scripts\packages\UpdateDevKitPackages.ps1 |
| 76 | +
|
| 77 | +# Or batch files |
| 78 | +scripts\compile\Compile.bat |
| 79 | +``` |
| 80 | + |
| 81 | +**macOS/Linux:** |
| 82 | +```bash |
| 83 | +# Make scripts executable (one-time setup) |
| 84 | +chmod +x scripts/**/*.sh |
| 85 | + |
| 86 | +# Run scripts |
| 87 | +./scripts/compile/Compile.sh |
| 88 | +./scripts/lint/Lint.sh |
| 89 | +./scripts/tests/RunUnitTests.sh |
| 90 | +./scripts/packages/UpdateDevKitPackages.sh |
| 91 | +``` |
| 92 | + |
| 93 | +For detailed information about the build system, see the [Build README](src/4-Build/README.md). |
| 94 | + |
| 95 | +### Continuous Integration & Deployment |
| 96 | + |
| 97 | +The template includes pre-configured CI/CD workflows: |
| 98 | + |
| 99 | +- **CI Workflow** (`.github/workflows/ci.yml`): Builds, tests, and packages your application |
| 100 | +- **CD Workflow** (`.github/workflows/cd.yml`): Deploys to Windows IIS server |
| 101 | + |
| 102 | +**Customizing for Your Environment:** |
| 103 | + |
| 104 | +1. **Modify CI Workflow**: Update `.github/workflows/ci.yml` to match your build requirements |
| 105 | +2. **Configure CD Workflow**: Customize `.github/workflows/cd.yml` for your deployment target: |
| 106 | + - For Linux deployment: Change runner to `ubuntu-latest` |
| 107 | + - For cloud deployment: Update deployment steps for your cloud provider |
| 108 | + - For different platforms: Modify build commands and artifact packaging |
| 109 | + |
| 110 | +## 🚀 Implement Your Logic and Build Your SaaS |
| 111 | + |
| 112 | +The template includes a complete example implementation to help you understand how to build your own features. Study the demo implementation to learn the patterns: |
| 113 | + |
| 114 | +### Frontend Implementation |
| 115 | +- **Pages**: `/src/2-Clients/AdminPanel/Pages/DemoThings/` |
| 116 | +- **Navigation**: `/src/2-Clients/AdminPanel/Pages/Shared/NavMenu.razor` |
| 117 | + |
| 118 | +### Backend Implementation |
| 119 | +- **API Controllers**: `/src/2-Clients/Api/Controllers/DemoThingsController.cs` |
| 120 | +- **Application Services**: `/src/1-Libraries/Application/Services/DemoThings/` |
| 121 | +- **Use Cases**: `/src/1-Libraries/Application/UseCases/DemoThings/` |
| 122 | +- **Domain Logic**: `/src/1-Libraries/Core/Domain/DemoThings/` |
| 123 | + |
| 124 | +### Testing |
| 125 | +- **Unit Tests**: `/src/3-Tests/Application.Tests.Unit/UseCases/DemoThings/` |
| 126 | +- **Integration Tests**: `/src/3-Tests/Application.Tests.Integration/UseCases/DemoThings/` |
| 127 | + |
| 128 | +### Learning Resources |
| 129 | +- **DevKit Documentation**: [https://docs.codeblock.dev/](https://docs.codeblock.dev/) |
| 130 | +- **Architecture Patterns**: Study the demo implementation to understand clean architecture principles |
| 131 | +- **Best Practices**: Follow the established patterns for consistency and maintainability |
| 132 | + |
| 133 | +## 📚 Next Steps |
| 134 | + |
| 135 | +1. **Study the Demo**: Examine the demo implementation to understand the patterns |
| 136 | +2. **Customize Settings**: Update configuration files with your application details |
| 137 | +3. **Add Your Features**: Implement your business logic following the established patterns |
| 138 | +4. **Deploy**: Use the provided CI/CD workflows or customize them for your deployment environment |
| 139 | + |
| 140 | +For detailed guidance on implementing features and customizing the template, refer to the [CodeBlock DevKit Documentation](https://docs.codeblock.dev/). |
0 commit comments