API & Integration Documentation
ReCode integrates with Appwrite to handle authentication, database operations, and file storage. This ensures secure, scalable, and real‑time communication between the frontend (React Native + Expo) and backend services.
🔐 Authentication API
ReCode uses Appwrite’s Auth service for user sign‑up, sign‑in, and session management.
Endpoints:
account.createEmailSession(email, password)→ Sign in useraccount.create(email, password, name)→ Register new useraccount.get()→ Fetch current user profileaccount.deleteSession('current')→ Log out
Integration Flow:
User enters email + password in ReCode’s sign‑up/sign‑in screen.
Appwrite validates credentials and creates a session.
ReCode stores session state in Zustand Auth Store.
Profile is automatically created with avatar, XP, and rank tracking.
🗄️ Database API
ReCode uses Appwrite’s Database service to store and retrieve user progress, challenges, and analytics.
Collections:
users→ Profile data (XP, rank, streak, skill scores)challenges→ Challenge definitions (type, domain, difficulty, hints)progress→ Challenge completion, XP earned, streak updates
Endpoints:
databases.listDocuments(databaseId, collectionId)→ Fetch challengesdatabases.createDocument(databaseId, collectionId, data)→ Save progressdatabases.updateDocument(databaseId, collectionId, documentId, data)→ Update streaks, skill scores
Integration Flow:
User completes a challenge.
ReCode updates local state (XP, streak, skill scores).
Appwrite database stores completion data.
Profile analytics update in real time.
✨ Why It Matters
Security → Appwrite handles authentication and data protection.
Scalability → Modular collections support new domains and challenge types.
Consistency → Local state mirrors backend data for seamless UX.
Extensibility → Easy to add new APIs (e.g., leaderboards, multiplayer challenges).
Last updated