# angelperezcastro/locilandapp architecture

> Architecture diagram of the GitHub repository angelperezcastro/locilandapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angelperezcastro/locilandapp
- Repository: https://github.com/angelperezcastro/locilandapp

## Overview

LociLand is a child-focused memory-palace learning app. A learner signs in, creates a themed palace, adds and orders memory stations, then walks the route in guided review and earns progress rewards. The graph highlights palace authoring, review, and gamification alongside navigation and Firebase-backed data. README capabilities fill out some branches; sampled source most clearly confirms palace-store calls and review completion wiring, so uncertain screen-to-service links are omitted.

Main entry points: [`src/navigation/AppNavigator.tsx`](https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/AppNavigator.tsx) (Learning navigation), [`src/store/usePalaceStore.ts`](https://github.com/angelperezcastro/locilandapp/blob/main/src/store/usePalaceStore.ts) (Palace state), [`src/services/reviewService.ts`](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/reviewService.ts) (Review sessions), [`src/screens/app/ProgressScreen.tsx`](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/ProgressScreen.tsx) (Progress dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App entry<br/>[App.tsx]"]
  node_rootnav["Root navigation<br/>[RootNavigator.tsx]"]
  node_authnav["Sign-in flow<br/>[AuthNavigator.tsx]"]
  node_appnav["Learning navigation<br/>[AppNavigator.tsx]"]
  node_onboarding["Onboarding"]
  node_authscreens["Login and register<br/>[LoginScreen.tsx]"]
end

subgraph group_palaces["Palace authoring"]
  node_home["Palace home<br/>[HomeScreen.tsx]"]
  node_palacecreate["Create palace"]
  node_palacedetail["Palace route"]
  node_stationedit["Station editing"]
  node_palacestore["Palace state<br/>[usePalaceStore.ts]"]
  node_palaceservice["Palace operations<br/>[palaceService.ts]"]
  node_stationservice["Station operations<br/>[stationService.ts]"]
end

subgraph group_learning["Guided learning"]
  node_review["Guided review<br/>[ReviewScreen.tsx]"]
  node_reviewdata["Review preparation"]
  node_reviewservice["Review sessions<br/>[reviewService.ts]"]
end

subgraph group_motivation["Progress and rewards"]
  node_progress["Progress dashboard<br/>[ProgressScreen.tsx]"]
  node_achievements["Achievements"]
  node_xp["XP and levels<br/>[xpService.ts]"]
  node_streak["Streak tracking<br/>[streakService.ts]"]
  node_notifications["Reminder logic"]
end

subgraph group_platform["Cloud and identity"]
  node_authservice["Authentication<br/>[auth.ts]"]
  node_profile["User profile<br/>[userProfile.ts]"]
  node_firebase["Firebase client<br/>[firebase.ts]"]
  node_firestore[("Firebase cloud data")]
  node_storage[("Firebase image storage")]
  node_imagesservice["Station image transfer<br/>[storageService.ts]"]
  node_localstore["Device onboarding state"]
end

node_learner(("Child learner"))
node_osnotify["Device notifications"]

node_learner -->|"opens"| node_app
node_app -->|"mounts"| node_rootnav
node_rootnav -->|"routes unauthenticated"| node_authnav
node_rootnav -->|"routes authenticated"| node_appnav
node_authnav -->|"presents"| node_authscreens
node_appnav -->|"routes to"| node_home
node_appnav -->|"routes to"| node_palacecreate
node_appnav -->|"routes to"| node_palacedetail
node_appnav -->|"routes to"| node_stationedit
node_appnav -->|"routes to"| node_review
node_appnav -->|"routes to"| node_progress
node_palacecreate -->|"creates palace"| node_palacestore
node_home -->|"loads palaces"| node_palacestore
node_palacedetail -->|"loads route"| node_palacestore
node_stationedit -->|"edits stations"| node_palacestore
node_palacestore -->|"manages palaces"| node_palaceservice
node_palacestore -->|"manages stations"| node_stationservice
node_review -->|"completes session"| node_reviewservice
node_reviewservice -->|"checks unlocks"| node_achievements
node_reviewservice -->|"awards XP"| node_xp
node_reviewservice -->|"reads and writes"| node_firestore
node_reviewdata -->|"loads palace route"| node_firestore
node_palaceservice -->|"reads and writes"| node_firestore
node_stationservice -->|"reads and writes"| node_firestore
node_stationservice -->|"transfers images"| node_imagesservice
node_imagesservice -->|"uploads and deletes"| node_storage
node_progress -->|"shows rewards"| node_achievements
node_progress -->|"shows streak"| node_streak
node_progress -->|"shows XP"| node_xp
node_notifications -.->|"schedules reminders"| node_osnotify
node_authservice -->|"uses client"| node_firebase
node_profile -->|"reads and writes"| node_firestore
node_firebase -->|"connects"| node_firestore
node_firebase -->|"connects"| node_storage
node_onboarding -->|"persists completion"| node_localstore

click node_app "https://github.com/angelperezcastro/locilandapp/blob/main/App.tsx"
click node_rootnav "https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/RootNavigator.tsx"
click node_authnav "https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/AuthNavigator.tsx"
click node_appnav "https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/AppNavigator.tsx"
click node_onboarding "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/onboarding/Onboarding01Screen.tsx"
click node_authscreens "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/auth/LoginScreen.tsx"
click node_home "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/HomeScreen.tsx"
click node_palacecreate "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/CreatePalaceScreen.tsx"
click node_palacedetail "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/PalaceDetailScreen.tsx"
click node_stationedit "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/AddStationScreen.tsx"
click node_palacestore "https://github.com/angelperezcastro/locilandapp/blob/main/src/store/usePalaceStore.ts"
click node_palaceservice "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/palaceService.ts"
click node_stationservice "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/stationService.ts"
click node_review "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/ReviewScreen.tsx"
click node_reviewdata "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/reviewScreenDataService.ts"
click node_reviewservice "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/reviewService.ts"
click node_progress "https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/ProgressScreen.tsx"
click node_achievements "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/achievementService.ts"
click node_xp "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/xpService.ts"
click node_streak "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/streakService.ts"
click node_notifications "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/notificationService.ts"
click node_authservice "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/auth.ts"
click node_profile "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/userProfile.ts"
click node_firebase "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/firebase.ts"
click node_imagesservice "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/storageService.ts"
click node_localstore "https://github.com/angelperezcastro/locilandapp/blob/main/src/services/onboardingStorage.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_rootnav,node_authnav,node_appnav,node_onboarding,node_authscreens toneBlue
class node_home,node_palacecreate,node_palacedetail,node_stationedit,node_palacestore,node_palaceservice,node_stationservice toneAmber
class node_review,node_reviewdata,node_reviewservice toneMint
class node_progress,node_achievements,node_xp,node_streak,node_notifications toneRose
class node_authservice,node_profile,node_firebase,node_firestore,node_storage,node_imagesservice,node_localstore,node_learner,node_osnotify toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/angelperezcastro/locilandapp/blob/main/App.tsx): `App.tsx`
- [Root navigation](https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/RootNavigator.tsx): `src/navigation/RootNavigator.tsx`
- [Sign-in flow](https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/AuthNavigator.tsx): `src/navigation/AuthNavigator.tsx`
- [Learning navigation](https://github.com/angelperezcastro/locilandapp/blob/main/src/navigation/AppNavigator.tsx): `src/navigation/AppNavigator.tsx`
- [Onboarding](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/onboarding/Onboarding01Screen.tsx): `src/screens/onboarding/Onboarding01Screen.tsx`
- [Login and register](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/auth/LoginScreen.tsx): `src/screens/auth/LoginScreen.tsx`

### Palace authoring

- [Palace home](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/HomeScreen.tsx): `src/screens/app/HomeScreen.tsx`
- [Create palace](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/CreatePalaceScreen.tsx): `src/screens/app/CreatePalaceScreen.tsx`
- [Palace route](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/PalaceDetailScreen.tsx): `src/screens/app/PalaceDetailScreen.tsx`
- [Station editing](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/AddStationScreen.tsx): `src/screens/app/AddStationScreen.tsx`
- [Palace state](https://github.com/angelperezcastro/locilandapp/blob/main/src/store/usePalaceStore.ts): `src/store/usePalaceStore.ts`
- [Palace operations](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/palaceService.ts): `src/services/palaceService.ts`
- [Station operations](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/stationService.ts): `src/services/stationService.ts`

### Guided learning

- [Guided review](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/ReviewScreen.tsx): `src/screens/app/ReviewScreen.tsx`
- [Review preparation](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/reviewScreenDataService.ts): `src/services/reviewScreenDataService.ts`
- [Review sessions](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/reviewService.ts): `src/services/reviewService.ts`

### Progress and rewards

- [Progress dashboard](https://github.com/angelperezcastro/locilandapp/blob/main/src/screens/app/ProgressScreen.tsx): `src/screens/app/ProgressScreen.tsx`
- [Achievements](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/achievementService.ts): `src/services/achievementService.ts`
- [XP and levels](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/xpService.ts): `src/services/xpService.ts`
- [Streak tracking](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/streakService.ts): `src/services/streakService.ts`
- [Reminder logic](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/notificationService.ts): `src/services/notificationService.ts`

### Cloud and identity

- [Authentication](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/auth.ts): `src/services/auth.ts`
- [User profile](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/userProfile.ts): `src/services/userProfile.ts`
- [Firebase client](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/firebase.ts): `src/services/firebase.ts`
- **Firebase cloud data**
- **Firebase image storage**
- [Station image transfer](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/storageService.ts): `src/services/storageService.ts`
- [Device onboarding state](https://github.com/angelperezcastro/locilandapp/blob/main/src/services/onboardingStorage.ts): `src/services/onboardingStorage.ts`

### Other components

- **Child learner**
- **Device notifications**

## Connections

- Child learner → App entry: opens
- App entry → Root navigation: mounts
- Root navigation → Sign-in flow: routes unauthenticated
- Root navigation → Learning navigation: routes authenticated
- Sign-in flow → Login and register: presents
- Learning navigation → Palace home: routes to
- Learning navigation → Create palace: routes to
- Learning navigation → Palace route: routes to
- Learning navigation → Station editing: routes to
- Learning navigation → Guided review: routes to
- Learning navigation → Progress dashboard: routes to
- Create palace → Palace state: creates palace
- Palace home → Palace state: loads palaces
- Palace route → Palace state: loads route
- Station editing → Palace state: edits stations
- Palace state → Palace operations: manages palaces
- Palace state → Station operations: manages stations
- Guided review → Review sessions: completes session
- Review sessions → Achievements: checks unlocks
- Review sessions → XP and levels: awards XP
- Review sessions → Firebase cloud data: reads and writes
- Review preparation → Firebase cloud data: loads palace route
- Palace operations → Firebase cloud data: reads and writes
- Station operations → Firebase cloud data: reads and writes
- Station operations → Station image transfer: transfers images
- Station image transfer → Firebase image storage: uploads and deletes
- Progress dashboard → Achievements: shows rewards
- Progress dashboard → Streak tracking: shows streak
- Progress dashboard → XP and levels: shows XP
- Reminder logic → Device notifications: schedules reminders
- Authentication → Firebase client: uses client
- User profile → Firebase cloud data: reads and writes
- Firebase client → Firebase cloud data: connects
- Firebase client → Firebase image storage: connects
- Onboarding → Device onboarding state: persists completion
