-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
UncannyPrompt is a layered .NET 10 monolith. The MVP runs as one web container plus SQL Server, but the project boundaries keep the domain, use cases, infrastructure, and HTTP edge separated.
Presentation
UncannyPrompt.WebApp
Razor Pages, REST controllers, Developer API docs/key pages, auth, security middleware, Swagger, static assets
Application
UncannyPrompt.Application
DTOs, request models, service interfaces, service implementations, access-control query helpers
Domain
UncannyPrompt.Domain
entities, enums, domain concepts, no framework dependencies
Infrastructure
UncannyPrompt.Infrastructure
EF Core, SQL Server, repositories, unit of work, migrations, crypto primitives, configuration composition
Shared
UncannyPrompt.Shared
small cross-project constants such as authentication scheme names
-
UncannyPrompt.Domaindepends on nothing. -
UncannyPrompt.Applicationdepends onDomainandShared. -
UncannyPrompt.Infrastructuredepends onApplication,Domain, andShared; it implements the interfaces consumed by application services. -
UncannyPrompt.WebAppcomposes the application and infrastructure layers through dependency injection. -
UncannyPrompt.UnitTestsreferences the layers it verifies.
The repository-level layout follows that split:
src/ runtime projects
tests/ test projects
wiki/ source-controlled developer/operator documentation
The reference deployment has two runtime services:
| Service | Responsibility |
|---|---|
webapp |
ASP.NET Core Razor Pages UI and JSON API |
sqlserver |
Transactional persistence through EF Core |
There is no separate worker in the MVP. Prompt creation, versioning, sharing, resolution, copy logging, and audit all run in request/response flows through application services.
- Tenant - the top-level isolation boundary.
- Workspace - a grouping unit inside a tenant.
- Project - contains folders, prompts, variables, tags, and sharing boundaries.
- Folder - hierarchical prompt organization inside a project.
- Prompt - the main authored object with content, optional negative prompt, metadata, tags, favorites, and versions.
- PromptVersion - immutable snapshot of content and negative prompt, used for version history and restore.
- VariableDefinition / VariableValue - named placeholders and scoped values for prompt resolution.
- ShareGrant - ACL grant for project, folder, or prompt targets.
- PublicShareLink - anonymous prompt link with deterministic lookup hash plus verification hash.
- AuditEvent - append-only record of security and operational events.
Browser/API caller
-> WebApp controller or Razor Page
-> Application service
-> AccessControlQueries / TenantScopeService
-> IRepository / IUnitOfWork
-> EF Core DbContext
-> SQL Server
Controllers and Razor Pages do not query EF directly. They call application services, which enforce tenant scope, resource permissions, validation, auditing, and persistence boundaries.
The left-menu Developers area is part of the WebApp presentation layer. It exposes authenticated API documentation and API key management while reusing the same UserApiKey, authentication handler, and application services used by API callers.
Author creates prompt
-> PromptService.CreateAsync
-> PromptVersion #1
-> tags/favorites/pins/listing projections
Author edits prompt content
-> PromptService.UpdateAsync
-> new PromptVersion only when content changes or explicit version metadata is provided
User resolves/copies prompt
-> PromptResolutionService.ResolveAsync
-> variable precedence applied
-> PromptService.LogCopyAsync records usage/audit metadata
See Prompt Lifecycle and Variables and Resolution for the detailed behavior.
- src/UncannyPrompt.WebApp/Program.cs - host bootstrap and HTTP pipeline.
-
src/UncannyPrompt.WebApp/Extensions/WebApplicationBuilderExtensions.cs -
.envloading, configuration composition, Serilog host setup. - src/UncannyPrompt.Application/DependencyInjection/ApplicationServiceRegistration.cs - application service registration.
- src/UncannyPrompt.Infrastructure/DependencyInjection/InfrastructureRegistration.cs - EF Core, repositories, and security primitive registration.
- src/UncannyPrompt.WebApp/Pages/Developer/Api - authenticated API docs and API key UI.