Mission du soir - VEC canonical Forgejo repository
- JavaScript 51.5%
- TypeScript 48.5%
| backend | ||
| mobile | ||
| README.md | ||
Mission du soir MVP
Production-ready MVP monorepo to validate a single core loop: bedtime missions that reduce conflict.
Stack
- Mobile: Expo + React Native + TypeScript
- Backend: Node.js + Express + MongoDB Atlas + Mongoose
- Auth: Email/password JWT (parent/admin roles)
- Subscription: RevenueCat adapter layer
- Notifications: Expo Notifications
- Localization: i18next (EN/FR)
Project structure
mobile/Expo appbackend/API + Mongo models + seed script
Setup
1) Backend
cd backend
cp .env.example .env
npm install
npm run seed
npm run dev
2) Mobile
cd mobile
cp .env.example .env
npm install
npm run start
Codex Cloud quickstart (important)
If you run this project in Codex Cloud, use this sequence:
- Use MongoDB Atlas (required): local MongoDB is usually not available in cloud sandboxes.
- Bind API on all interfaces: backend defaults to
HOST=0.0.0.0. - Set mobile API URL explicitly before launching Expo:
cd mobile
export EXPO_PUBLIC_API_URL="http://127.0.0.1:4000"
npm run start -- --web
- In another terminal, launch backend:
cd backend
npm run dev
- If npm install fails with
403in your cloud environment, validate/fix npm config first:
npm config get registry
npm config delete proxy
npm config delete https-proxy
npm config set registry https://registry.npmjs.org/
Some Codex Cloud workspaces are behind restricted registries/proxies. If policy blocks npmjs access, use your allowed internal registry. Update
mobile/app.jsonexpo.extra.apiUrlor wire it to env for device testing.
MongoDB Atlas
- Create an Atlas cluster.
- Add network access for your IP.
- Create DB user and paste connection string into
backend/.envMONGO_URI.
RevenueCat configuration
- Create app and offerings (
monthly,yearly) in RevenueCat. - Set
REVENUECAT_API_KEYin backend env. - Set public SDK key in mobile env.
- Replace placeholder service (
mobile/src/services/revenueCat.ts,backend/src/services/revenueCatService.js) with real SDK/webhook sync.
Notifications configuration
- Expo plugin is enabled in
mobile/app.config.ts. - Notifications are scheduled after onboarding and bedtime edits.
- Two local notifications are configured:
- 5 minutes before bedtime
- At bedtime
Admin user
Seed creates:
admin@missiondusoir.app/Admin123!parent@missiondusoir.app/Parent123!
You can also register admins via /auth/register with role admin.
Seed data
npm run seed in backend creates:
- six themes
- EN+FR story entries per theme
- image assets with fallback URLs
- demo parent+admin users
- one child + default routine
API surface
Implemented endpoints:
POST /auth/register,POST /auth/loginPOST /children,GET /children/:id,PUT /children/:idGET /missions/today/:childId,POST /missions/start,POST /missions/step,POST /missions/completeGET /stories,GET /stories/:idPOST /admin/stories,PUT /admin/stories/:id,DELETE /admin/stories/:id,POST /admin/stories/:id/publish,POST /admin/stories/:id/previewGET /assets,POST /admin/assets,PUT /admin/assets/:id,POST /admin/assets/:id/regenerateGET /subscription/status,POST /subscription/sync
MVP guardrails
This repo intentionally focuses on a lightweight mission loop and excludes multi-child support, RPG systems, social features, and advanced progression.