A Duolingo-style financial education platform that teaches users about trading, investing, and financial literacy through interactive lessons and quizzes.
-
4 Comprehensive Modules with 52+ lessons covering:
- Module 1: Trading (15 lessons) - Stock market fundamentals, technical analysis, risk management
- Module 2: Retirement Planning (12 lessons) - 401(k), IRAs, Social Security, tax strategies
- Module 3: Cryptocurrencies (15 lessons) - Blockchain, Bitcoin, Ethereum, DeFi, trading strategies
- Module 4: Brokers & Trading Platforms (10 lessons) - Broker types, order execution, margin trading
-
Interactive Learning
- Module pretests to assess knowledge
- Detailed lessons with practical examples
- Quiz questions after each lesson
- Progress tracking and streak system
- Experience points (XP) and level progression
-
User Features
- Account registration and authentication
- Daily activity streaks with reset logic
- Module completion tracking
- Automatic module unlocking on completion
- Experience points system
Frontend:
- React 18.3.1
- TypeScript 5.6.3
- Vite 6.4.1
- React Router for navigation
- Lucide React for icons
Backend:
- Express 5.2.1
- MongoDB 7.1.0 for data persistence
- Bcryptjs for password hashing
- CORS enabled for frontend communication
- Bun runtime (https://bun.sh)
- MongoDB Atlas account or local MongoDB instance
- Node.js 20+
-
Clone the repository
git clone https://github.com/GhostOf0days/Tradelingo.git cd Tradelingo -
Install dependencies
bun install
-
Set up environment variables Create a
.envfile in the root directory with your MongoDB connection string:MONGODB_URI=your_mongodb_connection_string_hereโ ๏ธ Important: Keep your.envfile private and never commit it to version control. Add it to.gitignore. -
Start the backend server
bun server/index.ts
Server runs on
http://localhost:3000 -
Start the frontend dev server (in another terminal)
bun run dev
Frontend runs on
http://localhost:5173orhttp://localhost:5174
MongoDB with automatic schema migrations:
- Users collection with authentication, progress tracking, and module completion data
- Automatic field addition for legacy users (lastUnlockedModuleId, progressByModuleId, completedModules)
- Secure password hashing with bcrypt
{
email: string,
password: string (hashed),
displayName: string,
experiencePoints: number,
lastUnlockedModuleId: number,
progressByModuleId: { [moduleId]: { lessonCurrent: number } },
streakDays: number,
lastActivityDate: string (ISO date),
completedModules: array,
createdAt: Date
}POST /api/register- Register new userPOST /api/login- Login user
GET /api/progress/:email- Get user's module progressPOST /api/complete-lesson- Mark lesson as completePOST /api/pass-module- Pass module pretest and unlock next modulePOST /api/complete-module- Mark entire module as completedPOST /api/update-xp- Update user's experience points
GET /api/user/:email- Get user's full profileGET /api/completed-modules/:email- Get list of completed modulesPOST /api/update-streak- Update daily streak
bun run lintโ ESLint (src, server, tests)bun run lint:fixbun run formatโ Prettierbun run test/bun run test:runโ Vitest (mocked DB intests/mockDb.ts)bun run test:coverage
Tradelingo/
โโโ src/
โ โโโ components/ # React components (Header, ModulesPage, etc.)
โ โโโ pages/ # Page components (Lesson, Login, Register)
โ โโโ contexts/ # React contexts (UserContext for auth)
โ โโโ data/ # Module lesson content (module1.ts, module2.ts, etc.)
โ โโโ App.tsx
โ โโโ index.tsx
โโโ server/
โ โโโ index.ts # Express server & API endpoints
โ โโโ db.ts # Database utilities
โโโ tests/ # Unit tests and mock data (api.test.ts, mockDb.ts)
โโโ vite.config.ts # Vite configuration
โโโ vitest.config.ts # Vitest configuration
โโโ eslint.config.js # ESLint flat config
โโโ tsconfig.json # TypeScript configuration
โโโ package.json
- User authentication with password hashing
- 4 complete modules with comprehensive lessons
- Module unlocking system (unlock next module on completion)
- Pretest & post-lesson quizzes
- Progress tracking per module
- Daily streak system
- Experience points system
- Schema migration for legacy users
- Responsive UI with CSS styling
The backend automatically runs migrations on startup to ensure all users have required fields:
- Adds
lastUnlockedModuleId: 1for legacy users - Adds
progressByModuleId: {}for legacy users - Adds
completedModules: []for legacy users
Class project for educational purposes.