This document serves as a comprehensive technical specification and learning artifact for the Focus Notes application. It is intentionally structured to reflect production-grade engineering standards, suitable for enterprise review, academic evaluation, and long-term scalability planning.
The system is designed using modern, industry-aligned technologies:
- Backend: .NET 10 Minimal APIs
- Frontend: Kotlin with Jetpack Compose (Android)
- Architecture Style: Client–Server, Clean Architecture (Lite), MVVM
The application adopts a Client–Server Architecture, ensuring clear separation of concerns, independent scalability, and maintainability.
System Components:
-
Mobile Client (Android):
- Responsible for user interaction, UI rendering, and local state handling.
- Communicates with the backend via RESTful HTTP APIs.
-
Backend API (.NET 8):
- Encapsulates business logic, validation rules, and data persistence.
- Exposes a stable contract via DTOs.
-
Database Layer:
- PostgreSQL for production deployments.
- SQLite for local development and testing.
User Action
↓
Jetpack Compose UI
↓
ViewModel (StateFlow)
↓
Repository
↓
Retrofit (HTTP)
↓
.NET Minimal API Endpoint
↓
Entity Framework Core
↓
Database
The backend intentionally uses Minimal APIs to:
- Reduce boilerplate and cognitive overhead
- Encourage functional, readable request pipelines
- Accelerate learning while preserving architectural rigor
This approach balances procedural clarity with object-oriented structure.
📂 FocusNotes.API
├── 📂 Data
│ ├── AppDbContext.cs
│ └── Migrations/
├── 📂 Entities
│ └── Note.cs
├── 📂 Dtos
│ ├── CreateNoteDto.cs
│ ├── UpdateNoteDto.cs
│ └── NoteResponseDto.cs
├── 📂 Endpoints
│ └── NoteEndpoints.cs
├── 📂 Extensions
│ └── DataExtensions.cs
├── appsettings.json
└── Program.cs
Responsibility Allocation:
Entitiesdefine the domain truth.Dtosdefine the public API contract.Endpointsorchestrate request handling.Datamanages persistence and migrations.
public class Note
{
public int Id { get; set; }
public required string Title { get; set; }
public string? Content { get; set; }
public bool IsCompleted { get; set; }
public DateTime CreatedAt { get; set; }
}Design Notes:
- The entity is persistence-focused.
- It is never returned directly to the client.
public record CreateNoteDto(string Title, string? Content);
public record UpdateNoteDto(string Title, string? Content, bool IsCompleted);Strategic Benefits:
- Decouples API consumers from schema evolution
- Enables validation and versioning
- Encourages immutability
| Method | Endpoint | Responsibility |
|---|---|---|
| GET | /notes | Retrieve all notes (sorted by date) |
| GET | /notes/{id} | Retrieve a single note |
| POST | /notes | Create a new note |
| PUT | /notes/{id} | Update an existing note |
| DELETE | /notes/{id} | Remove a note |
The Android client follows the Model–View–ViewModel (MVVM) pattern.
Separation of Responsibilities:
- View (Compose UI): Rendering only
- ViewModel: State management and orchestration
- Repository: Data source abstraction
📂 com.example.focusnotes
├── 📂 data
│ ├── 📂 model
│ ├── 📂 remote
│ └── NotesRepository.kt
├── 📂 ui
│ ├── 📂 theme
│ ├── 📂 noteslist
│ │ ├── NotesListScreen.kt
│ │ └── NotesListViewModel.kt
│ └── 📂 notedetail
│ ├── NoteDetailScreen.kt
│ └── NoteDetailViewModel.kt
└── MainActivity.kt
| Technology | Purpose |
|---|---|
| Jetpack Compose | Declarative UI framework |
| Retrofit | HTTP networking |
| StateFlow | Reactive state management |
| Coroutines | Asynchronous execution |
| Hilt (Optional) | Dependency Injection |
- Application launches
- ViewModel triggers data fetch
- Repository calls Retrofit service
- Backend API retrieves data via EF Core
- DTOs returned as JSON
- StateFlow emits new state
- UI recomposes automatically
Objective: Validate backend setup
- Minimal API returning hardcoded notes
- Swagger-based verification
Objective: Establish network communication
- Android Compose UI
- Retrofit integration
- LazyColumn rendering
Objective: Introduce real storage
- EF Core with SQLite
- Migrations and async queries
Objective: Enable user interaction
- Create and delete notes
- Form handling and validation
- Encourages architectural thinking over ad-hoc coding
- Mirrors enterprise-grade mobile-backend systems
- Reinforces scalable design principles
- Demonstrates applied software architecture knowledge
- Aligns with production patterns used in fintech, mobility, and research-driven teams
- Backend bootstrap (
Program.cs– Phase 1) - Android Retrofit and networking layer
Both paths are independent and can be developed in parallel, reinforcing modular thinking.