Thinkora

NotioX Architecture

This document describes the codebase structure and conventions for maintainability and scale.

Directory Structure

src/
├── core/                 # App-wide constants and design system
│   ├── constants.ts      # Magic numbers, storage keys, config
│   ├── theme.ts          # Colors, spacing, typography, shadows
│   └── index.ts
├── navigation/           # Navigation setup and types
│   ├── types.ts          # Typed param lists (RootStackParamList, etc.)
│   └── AppNavigator.tsx
├── context/              # React context (global state)
│   └── AppContext.tsx    # Notes, folders, tags, reminders, filter
├── services/             # Platform & I/O (storage, notifications, voice, attachments)
│   ├── storage.ts        # AsyncStorage persistence
│   ├── reminderService.ts
│   ├── voiceService.ts
│   ├── attachmentService.ts
│   └── audioRecordService.ts
├── components/           # Reusable UI components
│   ├── Icons.tsx
│   ├── RichNoteEditor.tsx
│   ├── AttachmentList.tsx
│   ├── SketchCanvas.tsx
│   ├── ErrorBoundary.tsx
│   ├── AppLoading.tsx
│   └── index.ts
├── screens/              # Full-screen views
│   ├── NoteListScreen.tsx
│   ├── NoteEditorScreen.tsx
│   ├── FoldersScreen.tsx
│   └── TagsScreen.tsx
├── types/                # TypeScript types and interfaces
│   └── index.ts
└── utils/                # Pure helpers
    ├── id.ts
    └── stripHtml.ts

Conventions

1. Core layer

2. Navigation

3. State

4. Services

5. Components

6. Error handling

7. Types

Data flow

  1. Load: App starts → AppProvider reads from storage → sets state and loaded = trueAppContent renders AppNavigator.
  2. Notes: User edits in NoteEditorScreen → local state → auto-save and on blur call updateNote / addNote from context → context updates state → storage.setNotes in useEffect.
  3. Reminders: addReminder in context creates reminder and calls reminderService.scheduleTimeReminder (Notifee) on Android; reminder id and optional notifeeId stored in state and persisted.

Scaling tips