🚀 Live Demo: https://outside-quest.vercel.app/
Outside Quest is a gamified wellness application designed to help gamers and students combat screen fatigue. By integrating real-time weather data and motivational quotes, the app generates daily "real-world quests" that encourage users to step away from their screens and earn XP for physical activity and mindfulness.
- Chrome (Desktop/Mobile)
- Firefox
- Safari (iOS/MacOS)
- Clone the repository to your local machine.
- Run
npm installin the terminal to install all dependencies (Next.js, Axios, Chart.js, Supabase, Framer Motion). - Create a
.env.localfile in the root directory. - Add your API keys to the
.env.localfile (see the Configuration section below).
Your .env.local file should look like this (referencing the keys used in your API testing):
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
OPENWEATHER_API_KEY=your_openweather_keyIf setting up a fresh database, run this SQL query in the Supabase SQL Editor to create the required table matching our data structure:
create table quests (
id bigint generated by default as identity primary key,
user_id text not null, -- Stores the hardcoded ID used in testing
quest text not null,
xp_earned int not null,
created_at timestamp with time zone default timezone('utc'::text, now()) not null
);Run npm run dev to start the local development server.
Open http://localhost:3000 in your browser to view the application.
- Manual Testing: We use standard
console.logdebugging and manual API testing via the browser network tab. - API Verification: To test the API routes individually, navigate to
http://localhost:3000/api/daily-questin your browser to see the raw JSON output.
Purpose: Fetches local weather from OpenWeatherMap and a random quote from ZenQuotes. It processes this data to generate a specific "quest".
Inputs: None (uses server-side environment variables and hardcoded location).
Outputs: JSON object: { weather, temp, quote, quest, xp }.
Purpose: Retrieves the history of completed quests from the Supabase database for the profile visualization.
Outputs: JSON array of quest objects: [{ id, quest, xp_earned, ... }].
Purpose: Writes a new completed quest to the Supabase database.
Inputs: JSON body: { quest: string, xp_earned: number }.
Outputs: Success message and the inserted data row.
- Location Hardcoding: The weather API is currently hardcoded to coordinates
39.2904, -76.6122(Baltimore, MD) for demonstration purposes. - API Rate Limits: Rapidly refreshing the page may cause the OpenWeatherMap or ZenQuotes API to return errors due to free tier rate limiting.
- Shared User Profile: The application currently uses a hardcoded "Demo User ID" (11dcc0eb...) for all database entries. This means all visitors share the same XP history and profile graph.
- Geolocation: Implement the browser Geolocation API to auto-detect user position for accurate weather data.
- User Authentication: Implement Supabase Auth to allow unique user accounts and private history.