# MENYA — Learn. Practice. Excel.
A centralized digital learning platform for Rwandan learners from **Primary 1 (P1) to Senior 6 (S6)**.
Curriculum books · National exam past papers · Interactive exercises — all free, no account needed.
Built with **Vue 3 (Composition API)**, **Vue Router**, **Tailwind CSS**, and **Lucide icons**.
---
## 🧩 Architecture (one app, not two)
MENYA is a **single application**: an Express server that serves **both** the Vue
website **and** the JSON API (plus uploaded PDFs/covers) from the **same URL**.
There is no second server to run and no CORS to configure. Content added in the
admin portal is saved to a database and is live for **every visitor**.
```
Browser ──▶ Express server (one origin)
├─ / → the Vue website (built files)
├─ /admin → the admin portal (same app)
├─ /api/... → JSON API (books, papers, exercises, login)
└─ /uploads/... → uploaded PDF & cover files
```
---
## ✅ How to run
**Requirements:** Node.js 18+ (LTS) from
nodejs.org
### First time — install everything (frontend + backend)
```bash
cd menya
npm run setup # installs deps for the app AND the server
```
### Option A — Development (live reload, two processes, one command)
```bash
npm run dev
```
- Opens the site at **
http://localhost:5173** (Vite, hot reload)
- Starts the API on **
http://localhost:4000** automatically
- Vite proxies `/api` to the server, so it behaves exactly like production
- Admin portal: **
localhost (login: `admin` / `menya2026`)
### Option B — Production mode locally (one unified server)
```bash
npm run serve # builds the site, then runs ONE server for everything
```
- Everything (website + admin + API + uploads) on **
http://localhost:4000**
- This is exactly how it runs when deployed.
> **Tip:** `npm run serve` is the best way to preview the real production behaviour.
### Troubleshooting
| Problem | Fix |
|---|---|
| `'vite'/'node' is not recognized` | Run `npm run setup` …