SELISE <blocks /> Genesis is a .NET service foundation for building APIs and workers with built-in configuration, middleware, messaging, cache, observability, and multi-tenant utilities.
Naming convention: Blocks <Service_Name> Service
This repository provides a multi-project .NET solution containing a reusable framework package, sample API/worker services, tests, and an LMT client package for both .NET and Node.js workloads.
- Overview
- Table of Content
- Feature
- Technology Stack
- Project Structure
- Controller / Endpoint
- Prerequisites
- Getting Started
- Installation
- Reusable application bootstrap and middleware pipeline for API and worker services
- Built-in support for secrets, logging, tracing, metrics, and health integrations
- Message broker integration patterns for Azure Service Bus and RabbitMQ consumers
- Multi-tenant request context handling through
BlocksContext - Sample HTTP and gRPC services demonstrating Genesis integration
- Shared LMT client libraries for .NET and Node.js
- Unit tests and driver utilities for validation and integration scenarios
- .NET 9
- ASP.NET Core Web API
- ASP.NET Core gRPC
- Worker Service
- MongoDB Driver
- Azure Service Bus / RabbitMQ integration
- xUnit + Moq + FluentAssertions
- TypeScript (Node package)
.
├── src
│ ├── Genesis # Core framework package
│ ├── Blocks.LMT.Client # Shared .NET LMT client
│ ├── Api1 # Sample HTTP API service
│ ├── Apis # Sample API + gRPC service
│ ├── Workers # Worker sample (Azure Service Bus)
│ ├── WorkerTwo # Worker sample (RabbitMQ)
│ ├── TestDriver # Helper driver utilities
│ └── XUnitTest # Unit test project
├── node # @seliseblocks/lmt-client package
├── Apis.Dockerfile # API image definition
└── Workers.Dockerfile # Worker image definition
Routing pattern (HTTP): /api/[controller]/[action-or-route]
Base route: /api/s1
GET /api/s1/process- Processes a request with tenant context, triggers messaging and downstream API/gRPC calls, and returns aggregated data.GET /api/s1/cert- Returns the current request context for protected certificate-authenticated access checks.
Base route: /api/s2
GET /api/s2/process- Handles a sample request, publishes a queue message, and returns the currentBlocksContext.GET /api/s2/process_1- Returns the currentBlocksContextfor a lightweight context-validation endpoint.
Service route: /Greeter/SayHello
RPC Greeter/SayHello- Returns a serializedBlocksContextpayload to verify request context propagation over gRPC.
Note: Endpoints that use Authorize or ProtectedEndPoint require valid authentication and expected request headers/context.
- .NET SDK 9.0 or later
- Node.js 16 or later (for
node/package) - Access to required runtime dependencies for local integration (for example MongoDB, Redis, message broker)
- Required secret/configuration provider values (environment variables or vault)
- Docker Desktop (optional, for containerized builds)
- Clone the repository.
- Move to the solution root.
- Restore and build the solution.
- Configure environment settings and secrets.
- Run API and worker services.
Basic build commands:
dotnet restore src/blocks-genesis-net.sln
dotnet build src/blocks-genesis-net.slnRun sample services locally in separate terminals:
dotnet run --project src/Api1/ApiOne.csproj
dotnet run --project src/Apis/ApiTwo.csproj
dotnet run --project src/Workers/WorkerOne.csproj
dotnet run --project src/WorkerTwo/WorkerTwo.csprojRun tests:
dotnet test src/XUnitTest/XUnitTest.csprojBuild Node package:
cd node
npm install
npm run buildgit clone https://github.com/SELISEdigitalplatforms/blocks-genesis-net.git
cd blocks-genesis-netdotnet restore src/blocks-genesis-net.slnSet required BlocksSecret__* values for your target environment.
Quick local setup helper:
cd src/Genesis
source setup_env.shdotnet build src/blocks-genesis-net.slnFrom the repository root:
docker build -f Apis.Dockerfile -t blocks-genesis-api --build-arg git_branch=dev .
docker build -f Workers.Dockerfile -t blocks-genesis-worker --build-arg git_branch=dev .