Marvel is an open source project by Radical having chatbot and smart tools for teachers.
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
and toolCommunicator
functions act as proxies, facilitating interaction between the Firebase infrastructure and the AI services, ensuring seamless data flow and integration. Firestore DB is utilized for data storage. The AI components, housed in a separate repository, include a chatbot and tools like "Quizify" and "YouTube Flashcard Generator."
-
/frontend
: Contains all the files related to the front-end application, including the NextJS app and associated resources. -
/functions
: Houses the Firebase Functions, which are serverless functions responsible for backend processes such as AI chatbot and tools communicators
-
firebase.json
: Contains configuration settings for Firebase services such as hosting and rules. -
firestore.indexes.json
: Manages custom indexing for Firestore to optimize query performance. -
firestore.rules
: Security rules for Firestore database, defining read/write permissions. -
package.json
&package-lock.json
: Defines the project’s global dependencies
- Node.js (v14 or later)
- Firebase CLI (v9.10.0 or later)
- Google Firebase Account
To set up the project, follow these steps:
- Clone the repository:
git clone https://github.com/radicalxdev/marvel-platform
- Create your firebase project on google firebase console
- Create a firestore database instance
- Get firebase config from firebase project settings in firebase console and save it to .env (create in root of this project, see sample.env for refrence)
- Install Firebase CLI by running the following in terminal:
npm install -g firebase-tools
- Login to firebase CLI by running the following command:
firebase login
.
- Navigate to back-end project directory:
cd functions
- Install dependencies:
npm install
- Run for local testing:
firebase serve --only functions
- Navigate to front-end project directory:
cd frontend
- Install dependencies:
npm install
- Run for local testing:
npm run dev
- Open the terminal and to start the emulators, run the following command:
npm run emulators
- Open another terminal simultaneously and start the frontend project, run the following command:
npm run frontend:dev
- Clone the repository:
git clone https://github.com/radicalxdev/marvel-platform
- Navigate to back-end project directory:
cd functions
- Install dependencies:
npm install
- Navigate to front-end directory:
cd ../frontend
- Install dependencies:
npm install
- Navigate to the root directory and run deploy:
cd .. && npm run deploy
If you would like to contribute to the project, please follow the guidelines in the CONTRIBUTING.md
file.
This project is licensed under the MIT License.