Skip to content

Jason-CJS/Briefed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Briefed — AI-Powered Personal Safety Briefing App

Briefed is a mobile app that generates personalized safety briefings and emergency-preparedness quizzes based on your upcoming activities. Powered by GPT-4o, it learns your habits over time, reads your Google Calendar, checks real-time weather, and drills you on what to do if something goes wrong — before it does.

Built during a hackathon. Runs on Android and Web via Expo.


What It Does

You tell Briefed what you're doing — hiking, flying, cooking, going to a concert — and it generates a set of safety quiz questions tailored specifically to those activities. Questions cover emergency protocols, first-aid techniques, situational tips, and safety facts. Over multiple sessions, the app remembers your injuries, conditions, habits, and preferences to personalise every briefing.

Core features:

  • AI briefings — GPT-4o generates 4–6 safety quiz questions per session, adapted to your activities, location, and current weather conditions
  • Activity chips — Pick from 100+ categorised activity tags or type your own custom tags
  • Google Calendar sync — Paste your public Google Calendar ICS URL and upcoming events appear as selectable activity chips
  • Real-time weather — When you mention a location (e.g. "flying to Japan"), the app fetches live weather and factors it into your briefing
  • User memory — Long-term memory stores permanent facts about you; short-term memory (7-day expiry) tracks recent session context so advice stays relevant
  • Personalised suggestions — The app learns which activities you select and surfaces smarter suggestions each session
  • Android home-screen widget — Displays a rotating quiz question on your home screen so you stay sharp between sessions
  • Fully offline storage — All your quiz history and memory is stored locally on-device; no account or backend required

Screenshots

Screenshot 2026-04-13 223725 Screenshot 2026-04-13 223719 Screenshot 2026-04-13 223713

Tech Stack

Layer Technology
Framework React Native 0.81.5 + Expo ~54
Routing Expo Router (file-based)
Language TypeScript (strict)
AI OpenAI GPT-4o (JSON mode)
Weather OpenWeatherMap API
Calendar Google Calendar ICS feed
Storage Expo FileSystem (local JSON)
Animations React Native Reanimated 4
UI expo-blur, expo-linear-gradient, @expo/vector-icons
Widget react-native-android-widget

Project Structure

Briefed-App/
├── app/
│   ├── (tabs)/
│   │   ├── index.tsx        # Home screen — activity selection & briefing trigger
│   │   ├── quiz.tsx         # Quiz history & answer reveal
│   │   ├── memory.tsx       # User memory & calendar setup
│   │   └── _layout.tsx      # Tab navigation
│   ├── _layout.tsx          # Root layout
│   └── modal.tsx            # Modal screen
├── services/
│   ├── briefingService.ts   # GPT-4o integration — core briefing engine
│   ├── weatherService.ts    # OpenWeatherMap integration
│   ├── calendarService.ts   # ICS parser for Google Calendar
│   ├── storage.ts           # Local JSON file storage
│   └── widgetService.ts     # Android home-screen widget sync
├── components/              # Reusable UI components
├── constants/
│   ├── activities.ts        # 100+ built-in activity chip definitions
│   ├── storageKeys.ts       # Storage key names
│   └── theme.ts             # Design tokens
├── types/
│   └── index.ts             # Shared TypeScript types
├── hooks/                   # Custom React hooks
└── assets/                  # Icons, splash screen, images

Prerequisites

  • Node.js 18 or later
  • npm or yarn
  • Expo Go app on your phone (for a quick test without a simulator), or:
    • Xcode + iOS Simulator (Mac only, for iOS)
    • Android Studio + Android Emulator (for Android)

Getting Started

1. Clone the repo

git clone https://github.com/Jason-CJS/Briefed.git
cd Briefed-App

2. Install dependencies

npm install

3. Set up API keys

Create a .env file in the project root:

EXPO_PUBLIC_OPENAI_KEY=sk-proj-your-openai-key-here
EXPO_PUBLIC_WEATHER_KEY=your-openweathermap-key-here
  • OpenAI API key — Sign up at platform.openai.com. The app uses GPT-4o, so ensure your account has access.
  • OpenWeatherMap API key — Free tier at openweathermap.org/api. The free plan covers everything this app needs.

The EXPO_PUBLIC_ prefix is required by Expo — it inlines the values at build time so they're accessible in the JavaScript bundle.

4. Start the development server

npm start

This opens the Expo dev menu. From there you can:

  • Press i — open in iOS Simulator (Mac only)
  • Press a — open in Android Emulator
  • Press w — open in your web browser
  • Scan the QR code with Expo Go on your phone

5. Run on a specific platform

npm run ios       # iOS Simulator
npm run android   # Android Emulator
npm run web       # Browser

Setting Up Google Calendar (Optional)

  1. Open Google Calendar on the web
  2. Go to Settings → select your calendar → Integrate calendar
  3. Copy the Public address in iCal format URL
  4. In the Briefed app, go to the Memory tab
  5. Paste the URL in the Google Calendar field and tap save

Your upcoming events will appear as selectable chips on the home screen.


How to Use the App

  1. Home screen — Select activity chips that describe what you're doing (or planning to do). You can type custom tags too.
  2. Tap "Get my briefing" — The app sends your activities, weather data (if a location is detected), and your memory to GPT-4o and generates a personalised quiz.
  3. Quiz tab — Review your quiz questions. Tap an answer to reveal the correct response and reasoning. Questions are grouped by session.
  4. Memory tab — Edit your long-term memory (injuries, conditions, experience level, preferences) so future briefings stay relevant to you.

Environment Variables Reference

Variable Description Required
EXPO_PUBLIC_OPENAI_KEY OpenAI API key for GPT-4o Yes
EXPO_PUBLIC_WEATHER_KEY OpenWeatherMap API key Yes (weather features)

Local Storage

The app stores everything locally on-device using Expo FileSystem — no account, no backend, no server. Data stored includes:

  • Your quiz history (grouped by session)
  • Long-term and short-term memory
  • Recently selected activity tags
  • Your Google Calendar URL
  • Weather alerts from previous sessions

Short-term memory entries automatically expire after 7 days.


Android Widget

On Android, Briefed can display a home-screen widget that shows a rotating quiz question from your history. After generating a briefing, add the Briefed widget to your home screen from your launcher's widget picker.


Contributing

Pull requests are welcome. For significant changes, open an issue first to discuss what you'd like to change.

# Lint the codebase
npm run lint

License

MIT

About

Your personalized activity briefing buddy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors