Skip to content
Back to Changelog

FRONTEND CHANGELOG | Sep 01 - Sep 12 | 22 hours

Sep 11, 2025 v0.9.10

FRONTEND CHANGELOG | Sep 01 - Sep 12 | 22 hours

API Client Architecture (Complete HTTP Layer Implementation)

Core API Client Infrastructure

A comprehensive API client system was implemented to handle all HTTP communication with the Node.js backend:

ApiClient Class:

  • Centralized Dio-based HTTP client with configurable timeouts and base URL management
  • Generic request() method supporting all HTTP methods with consistent error handling
  • Convenience methods (get, post, put, delete, patch) with endpoint method validation
  • Path parameter substitution via requestWithPathParams() for dynamic URLs
  • Proper resource cleanup with close() method

Interceptor Chain (Order-Dependent):

  1. AuthInterceptor - Automatic Bearer token injection and proactive token refresh
  2. TokenRefreshInterceptor - Reactive 401 handling with automatic retry
  3. ApiLoggingInterceptor - Comprehensive request/response logging with sensitive data marking
  4. ErrorHandlingInterceptor - Status code-specific error handling and logging
  5. RetryInterceptor - Exponential backoff retry for transient failures

API Endpoints & Exception Handling

ApiEndpoints Class: Static endpoint definitions with metadata including HTTP method, authentication requirements, timeout configuration, and descriptions. Currently defines health check, authentication endpoints (send-code, verify-code, refresh-token), with structured placeholder for future endpoints.

Exception Hierarchy: Custom ApiException base class with specialized subclasses:

  • NetworkException - Connectivity issues and timeouts
  • HTTP status-specific exceptions: BadRequestException (400), UnauthorizedException (401), ForbiddenException (403), NotFoundException (404), TooManyRequestsException (429), ServerException (5xx)
  • RequestCancelledException and UnknownException for edge cases
  • Smart error message extraction from API responses with validation error array handling

Authentication Services (Token Management System)

Token Storage Service

TokenStorageService: Secure token persistence using FlutterSecureStorage with automatic JSON serialization:

  • AuthTokenData model for structured token storage (accessToken, refreshToken, expiresAt)
  • Atomic operations for storing/retrieving authentication data
  • Secure token removal with error handling
  • Platform-specific secure storage integration

Token Refresh Service

TokenRefreshService: Automated JWT refresh management:

  • Proactive refresh 5 minutes before expiry via ensureValidToken()
  • Reactive refresh on 401 responses with concurrent request handling
  • Retry logic with exponential backoff (3 attempts, 2-8-16 second delays)
  • Thread-safe refresh with Completer to prevent duplicate refresh requests
  • Automatic cleanup of invalid refresh tokens

Authentication Service Enhancements

AuthService Updates:

  • Full integration with API client and token services
  • Structured error handling with user-friendly messages
  • Email validation with comprehensive regex patterns
  • Automatic token refresh integration
  • Router refresh notifications for navigation state updates

Project Management Feature (Workspace System)

Domain Models

ProjectModel: Complete project entity with:

  • UUID-based identification and workspace association
  • Intelligent abbreviation generation from project names (handles camelCase, spaces, special characters)
  • Timestamp tracking (created, updated, lastViewed)
  • JSON serialization support with fromJson/toJson
  • Comprehensive equality and hashing implementation

Services & State Management

ProjectsService: Business logic layer for project operations:

  • Project creation with name validation and abbreviation generation
  • Recent projects tracking with view count management
  • Project switching with state persistence
  • Mock data generation for development

ProjectsStore: Riverpod-based state management:

  • Current project tracking with automatic initialization
  • Recent projects list with timestamp-based sorting
  • Loading states and error handling
  • Integration with navigation and UI components

UI Components

CreateProjectDialog: Modal dialog for project creation:

  • Real-time name validation and abbreviation preview
  • Form validation with comprehensive error messaging
  • Responsive design with proper focus management
  • Integration with projects service for creation workflow

ProjectSelector: Advanced dropdown with overlay system:

  • Custom overlay positioning with LayerLink
  • Keyboard navigation support (Escape to close)
  • Current project display with abbreviation badges
  • Recent projects list with quick switching
  • “Show all” and “Create new” action integration

New Navigation Components

MorePopupButton: Consolidated settings menu replacing individual buttons:

  • PopupMenuButton with theme switching, navigation (hotkeys, roadmap), and logout
  • Conditional icon display based on current theme mode
  • Consistent styling with Material symbols integration

LogoutNavButton: Dedicated logout component:

  • Confirmation dialog with proper error state styling
  • Hover effects with error color theming
  • Responsive icon sizing and text overflow handling
  • Replaced multiple individual action buttons with consolidated MorePopupButton
  • Updated project selector integration with new workspace system
  • Improved layout spacing and component organization

Infrastructure & Configuration Updates

Application Configuration

AppConfig Enhancements:

  • appBarSize configuration (replacing appBarHeight)
  • Environment-specific configuration loading
  • Platform channel integration for configuration management

Provider Architecture

New Providers:

  • apiClientProvider - Managed API client lifecycle
  • tokenStorageServiceProvider - Secure token storage service
  • tokenRefreshServiceProvider - Automated token refresh
  • apiClientManagerProvider - API client cleanup management
  • authServiceProvider - Enhanced authentication service

Routing & State Management

RouterRefreshNotifier: Auth state change listener for navigation updates:

  • Integration with authentication service
  • Automatic route refresh on auth state changes
  • Proper cleanup and listener management

Utility & Framework Updates

Fractional Indexing Implementation

FractionalIndexing Class: Advanced ordering system for list management:

  • Character-based fractional positioning between existing items
  • Midpoint calculation for insertion operations
  • Boundary handling for prepend/append operations
  • Comprehensive validation and error handling

BACKEND CHANGELOG | Sep 01 - Sep 12 | 28 hours

Authentication System Overhaul

Enhanced Authentication Flow

Controller Restructuring:

  • Renamed /auth/submit-email to /auth/send-code for clearer API semantics
  • Updated authentication flow to handle both existing users (login) and new users with invitations (registration)
  • Integrated @Public() decorator on entire AuthController to bypass JWT requirements for auth endpoints
  • Comprehensive Swagger/OpenAPI documentation with detailed request/response schemas

JWT Token Refresh System:

  • New /auth/refresh endpoint for secure token renewal
  • RefreshTokenDto with validation for client refresh token requests
  • Automatic generation of both new access and refresh tokens
  • Integration with security metadata tracking (user agent, IP address)

Security Infrastructure

JWT Authentication Guard:

  • JwtAuthGuard implemented as global guard protecting all routes by default
  • @Public() decorator allows selective bypass for authentication endpoints
  • JwtStrategy for Passport.js integration with configurable JWT verification
  • @CurrentUser() decorator for clean user context extraction in controllers

Token Management:

  • RefreshToken entity with comprehensive security fields (expiration, revocation, user agent, IP tracking)
  • Secure token storage with cascade deletion on user removal
  • Revocation system for compromised or expired refresh tokens
  • Database relationship management with proper foreign key constraints

Authentication Service Enhancements

Service Architecture:

  • Refactored AuthService with dependency injection for WorkspaceService and ProjectService
  • Enhanced authenticate() method replacing submitEmail() for unified login/registration flow
  • Automatic default workspace and project creation for new users
  • refreshToken() method with comprehensive validation and token lifecycle management
  • Updated user tracking with lastLoginAt timestamp

Project & Workspace Management System

Domain Models

Project Entity:

  • Complete CRUD entity extending BaseEntity for standardized ID/timestamp management
  • Workspace and user association with proper TypeORM relationships
  • Name and description fields with length constraints and nullable handling
  • Database schema with proper indexing and foreign key relationships

Workspace Entity:

  • Multi-tenant workspace system with user ownership
  • One-to-many relationship with projects for proper data isolation
  • Extensible architecture for future multi-user workspace features
  • Consistent with project entity patterns for maintainability

Project Management API

ProjectController: Full RESTful API implementation:

  • POST /projects - Project creation with workspace validation
  • GET /projects - List projects with workspace filtering and pagination support
  • GET /projects/:id - Single project retrieval with ownership validation
  • PUT /projects/:id - Project updates with authorization checks
  • DELETE /projects/:id - Project deletion with cascade considerations

Data Transfer Objects:

  • CreateProjectDto with comprehensive validation rules
  • UpdateProjectDto using PartialType for flexible updates
  • ProjectResponseDto with standardized response formatting
  • Input validation using class-validator decorators

Service Layer Architecture

ProjectService: Business logic implementation:

  • Project creation with workspace existence validation
  • User authorization checks preventing cross-tenant access
  • Database transaction handling for data consistency
  • Error handling with appropriate HTTP status codes

WorkspaceService: Workspace management:

  • Default workspace creation during user registration
  • Workspace naming conventions based on user email
  • Future-proofed for multi-workspace per user functionality

Database Architecture & Infrastructure

Entity Relationships

Enhanced User Entity:

  • Added lastLoginAt field for authentication tracking
  • Maintained backward compatibility with existing user data
  • Proper relationships with workspaces and projects

Base Entity Pattern:

  • Centralized BaseEntity with UUID primary keys and timestamp management
  • Consistent across Project and Workspace entities
  • Extensible foundation for future domain models

Authentication Data Models

Invitation System:

  • Invitation entity for managing user registration approval
  • Email-based invitation validation with status tracking
  • Integration with authentication flow for seamless user onboarding

Verification Code System:

  • Enhanced VerificationCode entity with consistent code length validation
  • Temporal validation for code expiration handling
  • Secure code generation and storage patterns

Application Architecture

Module Organization

Enhanced App Module:

  • Global JWT authentication guard registration
  • Integration of ProjectModule and WorkspaceModule
  • Maintainence of existing rate limiting and database configurations

Authentication Module:

  • Passport.js integration with JWT strategy
  • Service dependency injection for cross-module communication
  • Proper module encapsulation with clear service boundaries

Project Module:

  • Complete module setup with controller, service, and repository patterns
  • TypeORM repository integration for database operations
  • Clean separation of concerns following NestJS best practices

Infrastructure Improvements

Database Configuration:

  • Updated data source configuration for new entities
  • Migration support for schema evolution
  • Proper entity registration and relationship mapping

Global Exception Handling:

  • Consistent error response formatting across all endpoints
  • HTTP status code standardization
  • Security-conscious error message exposure
Authentication

Log in or sign up

Verify your email to manage your workspaces and subscriptions.