This guide gets a fully functional local instance of Sealearn running on your machine — backend API, React frontend, MongoDB, and Redis — in under ten minutes. By the end you will have a running app pre-loaded with sample subjects and shop items that you can log into and explore immediately.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DerBasilisk/SEA-ServicioEvaluaconAsistida/llms.txt
Use this file to discover all available pages before exploring further.
Install Prerequisites
Sealearn requires three services to be available before you install any dependencies.
Verify your environment before continuing:
| Requirement | Minimum version | Notes |
|---|---|---|
| Node.js | 18.x LTS | The frontend uses Vite 7 which requires Node 18+ |
| MongoDB | 6.x | Can be a local mongod process or a free MongoDB Atlas cluster |
| Redis | 6.x | Required for real-time duel state and invite management |
Clone the Repository
Clone the Sealearn monorepo from GitHub. The repository contains both the
backend and frontend/sea directories at the top level.Install Backend Dependencies
Navigate into the Key packages installed include
backend directory and install all Node.js packages. The backend uses CommonJS modules with Express 5, Mongoose, Socket.IO, ioredis, Passport, and the Groq and Google GenAI SDKs.express ^5.2.1, mongoose ^9.2.4, socket.io ^4.8.1, ioredis ^5.10.0, groq-sdk ^1.1.1, @google/genai ^1.46.0, and nodemon ^3.1.14 for development hot-reloading.Install Frontend Dependencies
Open a new terminal tab, then navigate to The frontend uses React 19, Vite 7, Tailwind CSS 3, Zustand 5, React Router v7, and the
frontend/sea from the repo root and install the React project’s dependencies.socket.io-client ^4.8.3 package that connects to both the default duel namespace and the /chat namespace.Configure Backend Environment Variables
Inside the
backend directory, create a .env file. Below is a complete template with descriptions for every variable the application reads.You only need one
GROQ_API_KEY_* for local development. The AI service (services/ai.service.js) filters out blank entries and builds a pool from whichever keys are present. Gemini is only called when all Groq circuit breakers are open.Start the Backend
From the You should see output similar to:Confirm the API is healthy:The backend mounts these route groups:
backend directory, start the development server. nodemon watches for file changes and restarts automatically./api/users, /api/profile, /api/subjects, /api/lessons, /api/questions, /api/progress, /api/auth, /api/password, /api/friends, /api/upload, /api/leagues, /api/admin, /api/chat, and /api/shop. Socket.IO listens on the same HTTP server at path /socket.io.Start the Frontend
In your second terminal (inside Vite will start on
frontend/sea), start the Vite dev server:http://localhost:5173 by default and print a local URL you can open directly. The frontend connects to the backend at http://localhost:3000 (configured via the Axios base URL and the Socket.IO client connection string).Seed the Database
With both the backend and MongoDB running, open a third terminal and run the seed scripts from the
backend directory to populate subjects, units, lessons, and shop items.seedSubject.js creates a sample subject hierarchy (subject → units → lessons) so that adaptive lessons and duels have real content to work with. seedShop.js populates ShopItem documents with the default cosmetic catalogue that learners can browse and purchase.A third script —
node seeds/seedQuestions.js — is also available if you want a full set of pre-built questions attached to the seeded lessons. This is recommended if you want to test the duel system locally without first authoring questions manually.Register and Explore
Open
http://localhost:5173 in your browser. You will land on the Sealearn welcome screen.- Click Register and create an account with your email and a password.
- Verify your email if Resend is configured, or skip verification for local testing by setting
emailVerified: truedirectly on your user document in MongoDB. - Browse the seeded subjects and start a lesson to see the adaptive question flow in action.
- Add a friend, then challenge them to a Duel from the chat window to test the real-time Socket.IO layer.