Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is an AI-first Expo mobile app built with TypeScript, designed for rapid development with AI assistance. The stack is optimized for lowest friction and single-language (TypeScript) development everywhere.
expo-router + TypeScript + EAS Buildzod schemas = DB/API contractexpo-notifications + Expo Pushapp.config.ts + Zod-validated env; secrets only in Edge Functionsreact-native-mmkv (skip complex offline writes in v1)supabase gen types) gives compile-time guidance# Install dependencies pnpm install # Start development server pnpm expo start # Platform-specific development pnpm run android # Start Android emulator pnpm run ios # Start iOS simulator pnpm run web # Start web version # Linting pnpm run lint # Reset project to clean slate pnpm run reset-project # Type generation from Supabase supabase gen types typescript --project-id <project-id> > supabase/types/database.ts # EAS Build eas build --platform ios --profile preview eas build --platform android --profile preview
apps/mobile/ (Expo) ├── app/ # Routes via expo-router (auth, onboarding, home, paywall) ├── lib/ # Core integrations │ ├── supabase.ts │ ├── queryClient.ts │ └── superwall.ts ├── features/ # Feature modules (onboarding, habits, chat, tracker) ├── components/ui/ # Paper component wrappers ├── stores/ # Zustand stores (optional, minimal) ├── env.ts # Zod-validated config └── types/ # TypeScript types supabase/ ├── functions/ # Edge Functions │ └── ai/index.ts # Single AI endpoint with SSE streaming ├── migrations/ # SQL migrations └── types/database.ts # Generated DB types
app/_layout.tsx - Root layout with theme providerapp/(tabs)/_layout.tsx - Bottom tab configurationapp/(auth)/ - Sign in/up screensapp/paywall.tsx - Superwall integrationapp/+not-found.tsx@/ maps to project root (configured in tsconfig.json).ios.tsx and .web.ts file extensionsenv.tsremote_settings table cached locally-- Profiles table (extends auth.users) create table profiles ( id uuid primary key references auth.users on delete cascade, email text, name text, settings jsonb default '{}'::jsonb, created_at timestamptz default now() ); -- Questionnaires for onboarding create table questionnaires ( id uuid primary key default gen_random_uuid(), slug text unique, schema_json jsonb not null ); -- User answers to questionnaires create table answers ( id uuid primary key default gen_random_uuid(), user_id uuid references profiles(id) on delete cascade, questionnaire_id uuid references questionnaires(id) on delete cascade, payload_json jsonb not null, created_at timestamptz default now() ); -- Habits tracking create table habits ( id uuid primary key default gen_random_uuid(), user_id uuid references profiles(id) on delete cascade, title text not null, schedule_json jsonb default '{}'::jsonb, created_at timestamptz default now() ); -- Habit completion logs create table habit_logs ( id uuid primary key default gen_random_uuid(), habit_id uuid references habits(id) on delete cascade, date date not null, status text check (status in ('done','missed','skipped')) ); -- Chat messages create table messages ( id bigserial primary key, user_id uuid references profiles(id) on delete cascade, role text check (role in ('system','user','assistant')), content text not null, created_at timestamptz default now() ); -- Enable RLS on all tables alter table profiles enable row level security; alter table answers enable row level security; alter table habits enable row level security; alter table habit_logs enable row level security; alter table messages enable row level security; -- RLS policies (own rows only) create policy "own rows" on answers for all using (user_id = auth.uid()) with check (user_id = auth.uid()); -- Repeat for habits, habit_logs, messages
// supabase/functions/ai/index.ts import "jsr:@supabase/functions-js/edge-runtime.d.ts"; import { streamText } from "jsr:@ai-sdk/openai"; Deno.serve(async (req) => { const { messages, model = "gpt-4o-mini", system } = await req.json(); const apiKey = Deno.env.get("OPENAI_API_KEY")!; const stream = await streamText({ model: { provider: "openai", name: model, apiKey }, messages, system }); return new Response(stream.toReadableStream(), { headers: { "Content-Type": "text/event-stream" } }); });