Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Basira

AI-assisted, multi-tenant support platform API built with ASP.NET Core (.NET 10).

![CI](https://github.com/Youssef11-dev/basira-support-api/actions/workflows/ci.yml/badge.svg)

> **Status:** in development. Phase 0 (foundation) is done: solution structure,
> architecture tests, CI. Features below are **planned**, not implemented yet.

## Planned features

- Multi-tenant organizations with role-based access
- Support tickets with a defined lifecycle
- Knowledge base: document upload and background processing
- AI-suggested replies grounded in company documents, with sources
- Notifications

## Architecture

A modular monolith: one deployable app, split into modules with enforced
boundaries. See [ADR-0001](docs/adr/0001-modular-monolith.md).

```mermaid
flowchart TD
Host --> Identity
Host -.-> Tickets
Host -.-> KnowledgeBase
Host -.-> AiAssistant
Host -.-> Notifications
```

Solid arrows are implemented, dashed arrows are planned.

## Tech stack

- ASP.NET Core Web API, C#, .NET 10
- Entity Framework Core with PostgreSQL
- xUnit and NetArchTest for tests
- GitHub Actions for CI

## Getting started

Prerequisites: .NET 10 SDK, PostgreSQL.

```bash
git clone https://github.com/Youssef11-dev/basira-support-api.git
cd basira-support-api
dotnet user-secrets set "ConnectionStrings:Default" "Host=localhost;Port=5432;Database=basira_dev;Username=postgres;Password=<your-password>" --project src/Host
dotnet run --project src/Host
```

Then open `/health` on the URL printed in the console. It should return `Healthy`.

## Running tests

```bash
dotnet test
```

## Project structure

```
src/
Host/ composition root (Program.cs)
BuildingBlocks/ shared abstractions
Modules/
Identity/ Domain, Application, Infrastructure, Contracts, Api
tests/
Architecture.Tests/
docs/
adr/ architecture decision records
```

## Roadmap

- [x] Phase 0: foundation (structure, architecture tests, CI)
- [ ] Phase 1: Identity and Tickets
- [ ] Phase 2: production concerns (background jobs, caching, observability)
- [ ] Phase 3: knowledge base and AI assistant
- [ ] Phase 4: polish and deployment
44 changes: 44 additions & 0 deletions docs/adr/0001-modular-monolith.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ADR-0001: Modular Monolith with Clean Architecture per module

- **Status:** Accepted
- **Date:** 2026-11-29

## Context

Basira is a multi-tenant support platform with a knowledge base and
AI-assisted replies. It is built by a single developer. The system has several
distinct business areas (identity, tickets, knowledge base, AI assistant,
notifications) that should stay separate as the codebase grows, without paying
the operational cost of running many services.

## Decision

Build one deployable application (the Host) composed of modules.

- Each module has its own layers: Domain, Application, Infrastructure,
Contracts and Api.
- Each module has its own DbContext and its own database schema.
- Modules talk to each other only through Contracts (public interfaces and
events), never through another module's internals or tables.
- Architecture tests fail the build when these rules are broken.

## Alternatives considered

- **Single set of layers (plain Clean Architecture):** simpler, but boundaries
between business areas are not enforced and tend to erode.
- **Microservices:** independent deployment and scaling, but adds networking,
distributed data and deployment complexity that a single developer does not
need yet.

## Consequences

**Positive**
- Clear boundaries, enforced by the compiler and by architecture tests.
- A module can be extracted into a separate service later.
- Good practice for Clean Architecture and dependency rules.

**Negative**
- More projects and boilerplate per module.
- No foreign keys across modules; consistency between modules goes through
Contracts or events.
- The rules are only as strong as the tests that check them.