Mehtab is a comprehensive web application designed to help users learn new skills through interactive roadmaps. Users can register, enroll in roadmaps, and complete them in their respective section pages. The project features both a frontend built with React and a backend powered by GraphQL, which is deployed as a Lambda function on Netlify.
- User Registration & Authentication: Users can create accounts, log in, and manage their profiles.
- Roadmap Enrollment: Users can browse available roadmaps, enroll in them, and track their progress.
- Interactive Sections: Each roadmap is divided into sections, which users can complete one by one.
- Admin Management: Admin users can create, update, and delete roadmaps directly from the frontend interface.
- React: The frontend is built with React, providing a dynamic and responsive user interface.
- Apollo Client: Apollo Client is used to interact with the GraphQL backend, handling data fetching and caching.
- ShadCN: The UI components are styled using ShadCN, ensuring a modern and cohesive design throughout the application.
- Admin Functionality: Admin users have access to specialized tools that allow them to manage roadmaps, including creating new roadmaps, updating existing ones, and deleting those that are no longer needed.
The backend of Mehtab is implemented using GraphQL and is deployed as a Lambda function on Netlify. It includes the following queries and mutations:
me: User
: Fetches the currently authenticated user's data.allUsers: [User]
: Retrieves a list of all registered users.allRoadmaps: [Roadmap]
: Retrieves a list of all available roadmaps.
createUser(username: String!, password: String!, isAdmin: Boolean!): User
: Creates a new user. TheisAdmin
flag determines if the user has admin privileges.login(username: String!, password: String!): Token
: Authenticates a user and returns a token for session management.createRoadmap(title: String!, description: String!, image: String!, sections: [SectionInput!]!): Roadmap
: Allows an admin user to create a new roadmap.enrollUser(roadmapId: ID!): User
: Enrolls the current user in a specified roadmap.completeSection(roadmapId: ID!, sectionId: ID!): User
: Marks a section of a roadmap as completed for the current user.
To set up the project locally, follow these steps:
- Node.js (version 14.x or higher)
- npm or yarn
- A Netlify account (for deploying the backend)
- Clone the repository and navigate to the backend folder.
- Install dependencies:
npm install
- Deploy the backend to Netlify using the Netlify CLI:
netlify deploy --prod
- Configure the environment variables in Netlify to include your database connection string and any other necessary configurations.
- Navigate to the
client
folder in the project. - Install the frontend dependencies:
npm install
- Start the development server:
npm start
- Access the application in your browser at
http://localhost:3000
.
Contributions are welcome! Please fork the repository and create a pull request with your changes. Make sure to write tests for any new features or bug fixes.
This project is licensed under the MIT License. See the LICENSE
file for more details.