marvelai-org / marvel-platform

This is the marvel teaching assistant ai project.
https://app.marvelai.org/
MIT License
18 stars 98 forks source link

image

Marvel AI Platform

Marvel AI is an open-source project by Reality AI, designed to provide smart tools and chatbots to assist teachers in education. The platform leverages Firebase, Next.js, and various AI components to create a seamless learning experience.

Next.js React Redux Toolkit Emotion MUI Firebase Axios React Hook Form Remark ESLint Prettier Husky

Table of Contents

Architecture

The "Marvel" platform is structured into two main components: Firebase and AI. The Firebase side, detailed in this repository, encompasses both the frontend, developed with NextJS and hosted on Firebase Hosting, and the backend, which includes user management and session handling via Firebase Functions like signUpUser and createChatSession. The communicator function acts as a proxy for chat interactions between the Firebase infrastructure and the AI services. Tool requests (like "Quizify" and "YouTube Flashcard Generator") are sent directly from the frontend to the AI endpoints. Firestore DB is utilized for data storage. The AI endpoints are housed in a separate repository, including a chatbot and tools like "Quizify" and "Flashcard Generator."

Folder Structure

Folder Structure Overview

Key Files

Prerequisites

Setup

To set up the project, follow these steps:

Local Development

  1. Clone the repository: git clone https://github.com/marvelai-org/marvel-platform

  2. Create your firebase project on google firebase console

  3. Create a firestore database instance

  4. Get firebase config from firebase project settings in firebase console

  5. Create a .env file in the root of the project using sample.env as a template: The default values in sample.env are configured to connect to the production MarvelAI server (app.marvelai.app). You can keep these values if you want to use the production firebase backend (Firestore and Functions), or update them to point to your own firebase project.

  6. Install Firebase CLI by running the following in terminal: npm install -g firebase-tools

  7. Login to firebase CLI by running the following command: firebase login

  8. Install all dependencies by running: npm run install:all

Development Options

You have two options to run the development environment:

Option 1: Frontend with Production Backend

npm run dev

This will start the frontend on localhost:3000 and connect to your deployed Firebase backend (Functions and Firestore). Use this option when you want to:

Option 2: Full Local Development Environment

npm run dev:all

This starts both the frontend and Firebase emulators locally, providing a completely isolated development environment. Use this option when you want to:

Accessing the Application

  1. Once the development server is running, visit: http://localhost:3000/
  2. Register a new account using the signup form
  3. You'll be taken to a confirmation page
  4. In development mode, you can simply return to http://localhost:3000/ and you'll be logged in automatically without email confirmation

Note: If you experience any issues with hanging emulator processes after stopping the development server, you can clean them up by running:

npm run kill-emulators

Cloud Deployment

Before deploying, ensure you have the correct Firebase project setup:

  1. Login to Firebase if you haven't already:

    firebase login
  2. List your Firebase projects to verify you're on the correct one:

    firebase projects:list
  3. If needed, select the correct project:

    firebase use <project-id>

Once your Firebase project is properly configured:

  1. Install all dependencies: npm run install:all
  2. Deploy the project (frontend and functions): npm run deploy

Contributing

  1. Fork the Repository: Create a personal fork of the repository to work on.
  2. Create a Branch: For each new feature or bug fix, create a new branch from the develop branch.
  3. Implement Changes: Make your changes, ensuring they adhere to the project’s coding standards.
  4. Commit Changes: Commit your changes with clear, descriptive messages.
  5. Push to Your Fork: Push your changes to your forked repository.
  6. Open a Pull Request: Navigate to the original repository and open a pull request from your branch to the develop branch.
  7. Code Review: Engage in the code review process, addressing any feedback provided.
  8. Merge: Once approved, your changes will be merged into the develop branch.

For detailed instructions, refer to the CONTRIBUTING.md file in the repository.

License

This project is licensed under the MIT License.