Live: https://mind-forge-fe.vercel.app
- About
- Features
- Tech Stack
- Project Structure
- Environment Variables
- Installation
- Usage
- Contributing
- License
- Acknowledgements
MindForge is a modern web application for learning programming through interactive, AI-generated courses.
Users can generate and study programming courses tailored to their chosen topic and difficulty, complete with practical study cases.
MindForge is designed for both learners and administrators, offering a seamless and responsive learning experience.
-
Generate Course from Gemini AI
Create programming courses automatically based on selected topics (e.g., Frontend Web Development, Backend Web Development, Mobile Backend Development) and difficulty levels (Beginner, Intermediate, Advanced). -
Homepage & Testimonials
Accessible homepage with responsive design and real user testimonials.
- Course Learning
Study structured courses with 4β8 chapters. - Study Case
Work on real-world projects in the last chapter and practice directly in your IDE.
- Manage Courses & Topics (CRUD)
- View User Statistics
- Secure Login and Registration
| Layer | Technologies |
|---|---|
| Frontend | React.js, React Router, React Query, Swiper JS, Axios, Sonner, Tailwind CSS |
| Backend | Express.js (TypeScript), Prisma |
| Database | PostgreSQL |
| Deployment | Vercel (Frontend), Railway (Backend), Docker (Backend containerization) |
frontend/
βββ public/
β βββ mindforge-homepage.png
βββ src/
β βββ components/
β β βββ chapter/
β β βββ courses/
β β βββ ui/
β βββ hooks/
β βββ pages/
β β βββ users/
β βββ utils/
β βββ App.jsx
β βββ main.jsx
β βββ index.css
βββ .env
βββ package.json
βββ README.md
Create a .env file inside the frontend directory:
VITE_API_URL=https://api.mindforge.dev
For local development:
VITE_API_URL=http://localhost:3001
Clone the repository
git clone https://github.com/mind-forgee/mind-forge-fe.git cd mind-forge-fe
Install dependencies
npm install
Setup environment variables
Create a .env file in the project root
Add the required variables (see Environment Variables)
Run the development server
npm run dev
Open in browser
Register or log in to your account.
Generate a course by selecting a topic and difficulty.
Study the chapters and complete the final study case.
Admins can access the dashboard to manage users, courses, and topics.
Contributions are always welcome! π
Fork the repository
Create a feature branch
git checkout -b feature/your-feature
Commit your changes
git commit -m "Add some feature"
Push to your branch
git push origin feature/your-feature
Open a Pull Request
- Functional Requirements Document (FRD)
- Non-Functional Requirements (NFR)
- Out-of-Scope Features
- Project Structure
- Low-Level System Architecture (LLA)
- Database Design (ERD)
- DevOps & Deployment Plan
- As a user, I want to register so that I can access the platform.
- As a user, I want to log in so that I can access my account.
- As a user, I want to log out so that I can secure my account.
- As a user, I want to change my password so that I can maintain the security of my account.
- As a new user, I want to pick a topic so that I can start learning in my area of interest.
- As a user, I want to pick the difficulty level of the topic so that I can learn at my preferred pace.
- As a user, I want the system to assign me to an existing course if it matches my topic and difficulty so that I can start learning immediately.
- As a user, I want the system to generate a new course if no matching course exists so that I can still learn my chosen topic and difficulty.
- As a user, I want to access my dashboard after being assigned to a course so that I can track my learning progress.
- As a user, I want to start and complete chapters in the course so that I can progress through the material.
- As a user, I want to submit proof for the study case chapter (optional) so that I can validate my learning.
- As a user, I want to see my progress percentage so that I can track how much of the course I have completed.
-
UC1: Register
- Actor: User
- Precondition: User provides valid registration details.
- Steps:
- User submits registration form.
- System validates and creates a new account.
- Postcondition: User account is created.
-
UC2: Log In
- Actor: User
- Precondition: User provides valid credentials.
- Steps:
- User submits login form.
- System validates credentials and grants access.
- Postcondition: User is logged in.
-
UC3: Log Out
- Actor: User
- Precondition: User is logged in.
- Steps:
- User clicks the log-out button.
- System terminates the session.
- Postcondition: User is logged out.
-
UC4: Change Password
- Actor: User
- Precondition: User is logged in and provides the current password.
- Steps:
- User navigates to the change password section.
- User enters the current password and the new password.
- System validates the current password and updates the password.
- Postcondition: User's password is updated.
-
UC5: Pick Topic
- Actor: New User
- Precondition: User is authenticated.
- Steps:
- User selects a topic from the available list.
- System records the selected topic.
- Postcondition: Topic is selected.
-
UC6: Pick Difficulty
- Actor: User
- Precondition: User has selected a topic.
- Steps:
- User selects a difficulty level for the topic.
- System records the selected difficulty.
- Postcondition: Difficulty is selected.
-
UC7: Assign to Existing Course
- Actor: User
- Precondition: User has selected a topic and difficulty, and a matching course exists.
- Steps:
- System checks for an existing course matching the topic and difficulty.
- System assigns the user to the course.
- Postcondition: User is assigned to an existing course.
-
UC8: Generate New Course
- Actor: User
- Precondition: User has selected a topic and difficulty, and no matching course exists.
- Steps:
- System generates a new course using AI based on the selected topic and difficulty.
- System assigns the user to the newly generated course.
- Postcondition: User is assigned to a newly generated course.
-
UC9: Access Dashboard
- Actor: User
- Precondition: User is assigned to a course.
- Steps:
- User navigates to the dashboard.
- System displays the userβs course and progress.
- Postcondition: User accesses the dashboard.
-
UC10: Start and Complete Chapters
- Actor: User
- Precondition: User is assigned to a course.
- Steps:
- User starts a chapter in the course.
- User completes the chapter.
- System updates the userβs progress.
- Postcondition: User progresses through the course.
-
UC11: Submit Proof for Study Case Chapter
- Actor: User
- Precondition: User has reached the study case chapter.
- Steps:
- User submits a link as proof for the study case (optional).
- System records the submission.
- Postcondition: Proof is submitted (if provided).
-
UC12: View Progress Percentage
- Actor: User
- Precondition: User is assigned to a course.
- Steps:
- User views the progress percentage on the dashboard.
- System calculates and displays the progress percentage.
- Postcondition: User sees their progress percentage.
- As a user, I want to view my profile so that I can see my personal information.
- As a user, I want to update my profile so that I can keep my information up to date.
-
UC1: View Profile
- Actor: User
- Precondition: User is authenticated.
- Steps:
- User navigates to their profile.
- System displays the user's profile information.
- Postcondition: User views their profile.
-
UC2: Update Profile
- Actor: User
- Precondition: User is authenticated.
- Steps:
- User submits updated profile information.
- System validates and saves the changes.
- Postcondition: User's profile is updated.
- As a user, I want to view detailed information about a course so that I can decide whether to enroll.
- As an admin can delete courses so that I can manage the course catalog.
-
UC1: View Assigned Course
- Actor: User
- Precondition: User has selected a topic and difficulty, and the system has assigned a course.
- Steps:
- User navigates to their dashboard.
- System displays the assigned course details.
- Postcondition: User views the assigned course.
-
UC2: View Course Details
- Actor: User
- Precondition: User is assigned to a course.
- Steps:
- User clicks on the assigned course.
- System displays detailed information about the course.
- Postcondition: User views course details.
-
UC3: Manage Courses
- Actor: Admin
- Precondition: Admin is authenticated.
- Steps:
- Admin can deletes a course.
- System updates the course catalog.
- Postcondition: Course catalog is updated.
- As a user, I want to browse topics so that I can explore areas of interest.
- As an admin, I want to manage topics so that I can organize content effectively.
-
UC1: Browse Topics
- Actor: User
- Precondition: User is authenticated.
- Steps:
- User navigates to the topic list.
- System displays a list of topics.
- Postcondition: User views the list of topics.
-
UC2: Manage Topics
- Actor: Admin
- Precondition: Admin is authenticated.
- Steps:
- Admin creates a topic.
- System updates the topic list.
- Postcondition: Topic list is updated.
- User: A regular user of the platform who can register, log in, and access learning materials.
- Admin: A privileged user who can manage courses, topics, and user accounts.
-
User:
- Can register, log in, and log out.
- Can pick topics and difficulty levels.
- Can view and complete assigned courses.
- Can view and update their profile.
- Can submit proof for study case chapters.
-
Admin:
- Can manage courses
- Can manage topics
- Can view and manage user accounts.
- Trigger: User selects a topic and difficulty level.
- Process:
- The system uses Gemini AI to generate the course structure and chapters based on the selected topic and difficulty.
- The generated structure is saved in the database.
- Background Task:
- Using Redis, the system asynchronously generates detailed content for each chapter.
- Outcome: A fully structured course with chapters and content is available for the user.
- Trigger: User submits registration or login form.
- Process:
- For registration, the system validates the input and creates a new user account.
- For login, the system verifies the credentials and generates an authentication token.
- Outcome: User is authenticated and can access the platform.
- Trigger: Admin performs actions like deleting a course.
- Process:
- The system validates the admin's input.
- Updates are reflected in the course catalog.
- Outcome: The course catalog is updated accordingly.
- Trigger: Admin creates topics.
- Process:
- The system validates the input and updates the topic list.
- Outcome: Topics are organized and available for users.
- Trigger: User completes a chapter or submits proof for a study case.
- Process:
- The system updates the user's progress percentage.
- For study case submissions, the system records the proof.
- Outcome: User's progress is tracked and displayed on the dashboard.
- Transaction Submission: Ensure API endpoints respond within 500 ms under normal load.
- Database Queries: Optimize Prisma queries to minimize latency.
- Uptime: Maintain 99.9% uptime by leveraging robust error handling.
- Redundancy: Use Docker and for container orchestration to ensure high availability.
- Horizontal Scaling: Support 10Γ more users by deploying additional instances of the backend.
- Queue Management: Use Bull queues for handling asynchronous tasks efficiently.
- Authentication: Implement JWT-based authentication for secure user sessions.
- Data Protection: Use bcrypt for password hashing and enforce HTTPS for secure communication.
- RBAC: Role-Based Access Control for managing user permissions.
- Modular Architecture: Organize code into features (e.g.,
user,course,topic) for better maintainability. - CLI Logging: Use middleware for centralized error logging and debugging.
- Documentation: Maintain up-to-date API documentation in postman.
- What: Detailed learning analytics, progress reports, time tracking, learning pattern analysis, and personalized recommendations based on user behavior
- Why Out of Scope: While basic progress percentage tracking is included, comprehensive analytics would require additional data collection, complex algorithms, and reporting infrastructure that extends beyond the core MVP functionality
- Future Consideration: Could be added in Phase 2 to provide users with deeper insights into their learning journey
- What: Ability to generate and deliver course content in multiple languages, including internationalization (i18n) of the platform interface
- Why Out of Scope: The current AI integration with Gemini focuses on single-language content generation. Multi-language support would require additional AI model configurations, translation services, and extensive localization work
- Future Consideration: Essential for global expansion but not critical for initial market validation
- What: Video lectures, interactive quizzes, coding challenges, multimedia content, embedded simulations, or gamification elements beyond basic chapter completion
- Why Out of Scope: The current system focuses on text-based chapter content with optional study case proof submission. Rich media and interactive content would require additional infrastructure, storage solutions, and complex content management
- Future Consideration: Would significantly enhance user engagement but requires substantial development resources
- What: Discussion forums, peer-to-peer learning, study groups, course reviews/ratings, social sharing, or collaborative learning features
- Why Out of Scope: The current architecture focuses on individual learning paths. Social features would require additional database schemas, real-time communication infrastructure, moderation systems, and complex user interaction patterns
- Future Consideration: Could transform the platform into a comprehensive learning community but represents a major scope expansion
- What: Comprehensive admin interface for course management, user analytics, content moderation, bulk operations, advanced reporting, and fine-grained permission management beyond basic CRUD operations
- Why Out of Scope: Current admin functionality is limited to basic course and topic management through API endpoints. A full-featured admin dashboard would require a separate frontend application, extensive UI/UX design, and additional backend endpoints
- Future Consideration: Critical for scaling operations but not essential for proving the core learning concept
- Purpose: Initializes the Express application and sets up middleware, routes, and error handling.
- NFR Alignment:
- Performance: Middleware like
express.json()ensures efficient request parsing. - Maintainability: Modular route imports (
userRoutes,courseRoutes, etc.) improve code organization.
- Performance: Middleware like
- Purpose: Starts the Express server and listens on the configured port.
- NFR Alignment:
- Availability: Logs server status to ensure uptime monitoring.
- Scalability: Configurable port allows deployment flexibility.
- Purpose: Defines the database schema and relationships.
- NFR Alignment:
- Performance: Optimized schema design for efficient queries.
- Scalability: Supports migrations for evolving database needs.
- Purpose: Manages project dependencies and scripts.
- NFR Alignment:
- Maintainability: Scripts like
npm run devstreamline development workflows. - Scalability: Dependencies like
@prisma/clientandbullsupport robust backend operations.
- Maintainability: Scripts like
- Purpose: Configures TypeScript compiler options.
- NFR Alignment:
- Maintainability: Enforces strict type checking for reliable code.
- Performance: Optimized output directory (
dist) for production builds.
- Subdirectories:
user/: Handles user authentication and management.course/: Manages course-related operations.topic/: Handles topic-related functionalities.
- NFR Alignment:
- Maintainability: Feature-based structure simplifies code navigation.
- Security: Each feature implements its own validation and authorization logic.
- Files:
errorHandler.ts: Centralized error handling.verifyToken.ts: Middleware for token validation.
- NFR Alignment:
- Security: Ensures only authenticated requests are processed.
- Maintainability: Reusable middleware components.
- Files:
chapterQueue.ts: Manages asynchronous tasks using Bull.generateToken.ts: Utility for generating JWT tokens.
- NFR Alignment:
- Scalability: Efficient task management for high-load scenarios.
- Security: Secure token generation for authentication.
- Purpose: Defines services for local and production development and testing.
- NFR Alignment:
- Availability: Simplifies environment setup for consistent deployments.
- Scalability: Supports multi-container applications.
- Purpose: Provides setup instructions and project overview.
- NFR Alignment:
- Maintainability: Ensures developers can quickly onboard and understand the project.
Vite was chosen as the bundler for its blazing-fast development and build performance. React is used to build dynamic, modular, and maintainable user interfaces.
Express provides flexibility for building APIs with a mature ecosystem. TypeScript adds type-safety, which improves reliability, reduces runtime errors, and simplifies debugging and maintenance.
PostgreSQL was selected for its stability, strong support for complex transactions, relational data modeling, and high performance at scale. It ensures data integrity and consistency, making it suitable for structured data needs.
Redis is used as a fast in-memory data store to handle task queues and background jobs. Offloading heavy tasks to background workers improves responsiveness and scalability of the main application.
REST was chosen for its simplicity, wide adoption, and compatibility across platforms and libraries. It is well-suited for standard API requirements without the added complexity of GraphQL.
Prisma provides a modern ORM experience with type-safety, auto-completion, and a developer-friendly query builder. It simplifies schema management and database migrations compared to raw SQL.
Docker ensures that each component (API, database, cache, worker) runs in isolated containers. This guarantees consistency across development, staging, and production environments.
GitHub Actions was chosen to automate build, test, and deployment pipelines. Its native integration with GitHub makes it efficient and easy to maintain without requiring additional CI/CD tools.
- Controller:
course.controller.ts- Handles API requests for creating courses, fetching user courses, completing chapters, collecting study case proofs, and updating study case statuses.
- Service:
course.service.ts- Implements business logic for course-related operations, such as:
- Creating courses using Prisma ORM and integrating with AI models for content generation.
- Managing user-course relationships and chapter progress.
- Handling study case proofs and their statuses.
- Implements business logic for course-related operations, such as:
Interaction:
- The controller interacts with the service layer to process requests and send responses.
- The service layer communicates with the database via Prisma and integrates with shared utilities like
chapterQueueandgeminiAI.
- Controller:
user.controller.ts- Manages user-related API endpoints, including user creation, login, logout, fetching user details, and password changes.
- Service:
user.service.ts- Handles user authentication, token generation, and database operations for user management.
Interaction:
- The controller uses the service layer for user authentication and data retrieval.
- The service layer interacts with shared utilities like
generateTokenandcheckUser.
- Controller:
profile.controller.ts- Provides an endpoint for updating user profiles.
- Service:
profile.service.ts- Updates user profile information in the database, ensuring email uniqueness.
Interaction:
- The controller calls the service to update user details.
- The service validates and updates the database using Prisma.
- Controller:
topic.controller.ts- Handles API requests for fetching, creating, and deleting topics.
- Service:
topic.service.ts- Manages topic-related database operations, including validation and CRUD operations.
Interaction:
- The controller interacts with the service for topic management.
- The service ensures data integrity and interacts with the database.
- Purpose: Provide reusable functionalities across modules.
chapterQueue: Manages background tasks for chapter content generation.geminiAI: Integrates with AI models for content generation.generateToken,setAuthCookie,clearAuthCookie: Handle authentication and session management.checkUser: Validates user existence in the database.
Interaction:
- Shared utilities are used by multiple services to perform specific tasks, such as AI integration, authentication, and background processing.
- Purpose: Handle cross-cutting concerns like authentication and error handling.
verifyToken: Ensures API requests are authenticated.errorHandler: Manages API error responses.
Interaction:
- Middleware is invoked in the request lifecycle to validate and process requests before reaching controllers.
- Description: Stores user information including authentication details and roles.
- Purpose:
- Manage user accounts and authentication.
- Assign roles for access control.
- Description: Represents topics for courses.
- Purpose:
- Categorize courses under specific topics.
- Provide a structure for organizing educational content.
- Description: Contains course details including difficulty and associated topic.
- Purpose:
- Store information about courses.
- Link courses to topics and difficulty levels.
- Description: Represents chapters within a course.
- Purpose:
- Divide courses into smaller, manageable sections.
- Provide detailed content for each chapter.
- Description: Tracks courses selected by users.
- Purpose:
- Record user preferences for courses.
- Enable personalized learning experiences.
- Description: Stores proof submissions for study cases.
- Purpose:
- Track user submissions for study cases.
- Facilitate review and approval processes.
- Description: Tracks user progress in chapters.
- Purpose:
- Monitor user completion of chapters.
- Provide insights into learning progress.
id: Primary key.email: Unique constraint.- Foreign key relationships:
generated_course(Course).selected_course(SelectedCourse).chapter_progress(chapterProgress).study_case_proofs(StudyCaseProof).
id: Primary key.name: Unique constraint.- Foreign key relationships:
courses(Course).
id: Primary key.topic_id: Foreign key referencing Topic.generated_by: Foreign key referencing User.- Composite unique constraint:
topic_id, difficulty.
id: Primary key.course_id: Foreign key referencing Course.- Composite unique constraint:
course_id, order_index. - Index:
course_id, order_index.
- Composite primary key:
user_id, course_id. - Composite unique constraint:
user_id, course_id. - Foreign key relationships:
user_id(User).course_id(Course).
- Composite primary key:
chapter_id, user_id. - Composite unique constraint:
chapter_id, user_id. - Foreign key relationships:
chapter_id(Chapter).user_id(User).
- Composite primary key:
user_id, chapter_id. - Composite unique constraint:
user_id, chapter_id. - Foreign key relationships:
user_id(User).chapter_id(Chapter).
- Use Docker to containerize the backend application.
- Deploy the backend on a Virtual Machine (VM)
- Use PostgreSQL as the database (as indicated in
.env.example). - Use Redis for caching or queueing.
- Deploy the frontend on Vercel for seamless CI/CD and hosting.
- The
.env.examplefile already provides a good template. Ensure the following:- Replace placeholders with actual values for production.
- Build and test the backend application.
- Push the Docker image to a container registry.
- Deploy the Docker container to the VM.
- Automatically deploy to Vercel on every push to the
mainbranch.
This project is licensed under the MIT License. See the LICENSE file for more details.
Gemini AI for powering course generation
Prisma & PostgreSQL for database layer
Vercel & Railway for seamless deployment
Open-source community β€οΈ


