Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2 #179

Merged
merged 42 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a4735e2
Merge branches 'es1-chat-history-feature' and 'es2-quick-actions-feat…
Viraj5903 Jul 25, 2024
db9c8f3
changed the border color and star
kishore223 Jul 30, 2024
62228cb
Add the Discovery Library Section.
Viraj5903 Jul 30, 2024
e33b1c0
adjusted padding and changed the border color darker
kishore223 Jul 31, 2024
04c84bc
Fetching and displaying Discovery Library.
Viraj5903 Aug 8, 2024
c326521
Updated Discovery Libraries and add seed file.
Viraj5903 Aug 13, 2024
d8e35d9
Complete Epic 5 and Revamp Chat UI.
Viraj5903 Aug 30, 2024
451533d
Merge branch 'chat-ui-revamp' into 'main'
Viraj5903 Sep 2, 2024
965fed3
ui fixes for chat
yunusj Oct 23, 2024
e34ee05
linting fix
yunusj Oct 24, 2024
baf74d4
Merge branch 'develop' into merged-opensource-stable
yunusj Oct 24, 2024
c328899
merge conflicts fix
yunusj Oct 25, 2024
99946a6
deployed to dev
yunusj Oct 29, 2024
339e92d
Create LICENSE.md
Ahmedr275 Nov 11, 2024
8d2b651
Update README.md
Ahmedr275 Nov 11, 2024
c8bbf54
Merge pull request #173 from marvelai-org/Ahmedr275-patch-1
yunusj Nov 11, 2024
cc3dd73
Update code-of-conduct.md
Ahmedr275 Nov 12, 2024
ef3c6e2
Update README.md
Ahmedr275 Nov 15, 2024
9fe480d
Update README.md
Ahmedr275 Nov 15, 2024
82a3f3c
conditional forms
yunusj Nov 16, 2024
ab6c454
folder structure converted to standard / best practices of firebase
yunusj Nov 16, 2024
0635f96
fixed lots of console errors on frontend such as react warning, error…
yunusj Nov 16, 2024
2400bf1
changes to architecture image.
Ahmedr275 Nov 18, 2024
51191a7
Update README.md
Ahmedr275 Nov 18, 2024
d3ecf9c
Update issue templates
Ahmedr275 Nov 18, 2024
179bbb8
Merge pull request #175 from marvelai-org/Issue-templates
yunusj Nov 18, 2024
ce5f848
Update bug_report.md
Ahmedr275 Nov 18, 2024
2b25766
Update feature_request.md
Ahmedr275 Nov 18, 2024
cd6358c
Update suggest-an-improvement.md
Ahmedr275 Nov 18, 2024
97bc507
onboarding fix
yunusj Nov 18, 2024
92ef258
Merge pull request #176 from marvelai-org/Issue-templates
yunusj Nov 19, 2024
c033c39
form integration
yunusj Nov 19, 2024
5a65c3c
Merge pull request #177 from marvelai-org/Opensource-setup-updates
yunusj Nov 20, 2024
10c9421
integrated 2 new tools, worksheet and syllabus generator and added ne…
yunusj Nov 20, 2024
19771ac
tool history moved to client side, backend function for tools removed
yunusj Nov 20, 2024
a0635ce
Operational tools: MCQs, Flashcard, Syllabus Generator. 2. Coming soo…
yunusj Nov 20, 2024
513246b
chat bug fixed
yunusj Nov 21, 2024
9e404ef
Merge branch 'develop' into feat/tools-integration
yunusj Nov 21, 2024
85ffab9
firebase default proj id corrected
yunusj Nov 21, 2024
176e54b
firebase default proj id corrected
yunusj Nov 21, 2024
f8c358d
Merge pull request #178 from marvelai-org/feat/tools-integration
yunusj Nov 21, 2024
ce66386
Merge branch 'main' into develop
yunusj Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .DS_Store
Binary file not shown.
File renamed without changes.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: BUG - [feature_name]-[problem in a short sentence]
labels: type:bug
assignees: ''
projects: marvelai-org/8

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request] - Ability for users to [user action]"
labels: type:new-feature
assignees: ''
projects: marvelai-org/8

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/suggest-an-improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Suggest an improvement
about: suggesting improvements to a feature or technical improvements
title: ''
labels: enhancement
assignees: ''
projects: marvelai-org/8

---

Which feature do you want to improve? Please name the feature and what it does.
Feature name with a simple description of it's functionality. Ex. flashcard generator tool for generating flashcards based on user's requirements.

Is your improvement related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.
141 changes: 6 additions & 135 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,144 +6,15 @@ on:
push:
branches:
- main
- develop
jobs:
build_and_deploy_sandbox:
name: "Deploy to Marvel Develop"
if: ${{ github.ref == 'refs/heads/develop' }}
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18.17.0"

- name: Install Firebase CLI
run: |
npm install -g firebase-tools

- name: Install Functions Dependencies
run: |
cd functions
npm install

- name: Decode Base64 Env Vars for Develop
if: github.ref == 'refs/heads/develop'
run: |
cd functions
echo "${{ secrets.SANDBOX_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Deploy Functions to Develop
if: github.ref == 'refs/heads/develop'
run: |
set -o allexport
source functions/.env
set +o allexport
firebase deploy --only functions --force --token ${{ secrets.FIREBASE_TOKEN }} --project kai-platform-sandbox

- name: Decode and create .env file from secret
run: |
echo "${{ secrets.SANDBOX_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Set environment variables
run: |
set -a
source .env
set +a

- name: Install Next.js globally
run: npm install -g next

- name: Build Next.js
run: npm run build:next

- name: Set Channel ID
id: set_channel_id
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "channel_id=live" >> $GITHUB_ENV
else
echo "channel_id=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
fi

- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GIT_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SANDBOX }}
projectId: kai-platform-sandbox
channelId: ${{ env.channel_id }}

build_and_deploy_production:
name: "Deploy to Marvel Production"
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18.17.0"

- name: Install Firebase CLI
run: |
npm install -g firebase-tools

- name: Install Functions Dependencies
run: |
cd functions
npm install

- name: Decode Base64 Env Vars for Specific Branches
if: github.ref == 'refs/heads/main'
run: |
cd functions
echo "${{ secrets.PROD_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Deploy Functions to Production
if: github.ref == 'refs/heads/main'
run: |
set -o allexport
source functions/.env
set +o allexport
firebase deploy --only functions --force --token ${{ secrets.FIREBASE_TOKEN }} --project kai-ai-f63c8

- name: Decode and create .env file from secret
run: |
echo "${{ secrets.PROD_ENV_FILE_BASE64 }}" | base64 --decode > .env

- name: Set environment variables
run: |
set -a
source .env
set +a

- name: Install Next.js globally
run: npm install -g next

- name: Build Next.js
run: npm run build:next

- name: Set Channel ID
id: set_channel_id
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "channel_id=live" >> $GITHUB_ENV
else
echo "channel_id=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
fi

- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
- uses: actions/checkout@v4
- run: next build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GIT_TOKEN }}
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAI_AI_F63C8 }}
channelId: live
projectId: kai-ai-f63c8
channelId: ${{ env.channel_id }}
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: next build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAI_AI_F63C8 }}
projectId: kai-ai-f63c8
13 changes: 3 additions & 10 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd functions

echo "Running linter on functions..."
npm run lint

cd ../frontend

echo "Running linter on platform frontend..."
npm run lint

cd frontend

echo "Running linter..."
npm run lint
Binary file added Marvel Architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
![image](https://github.com/user-attachments/assets/04e5f5a4-9ba7-4887-a158-bca181f7391c)


# Marvel AI Platform
Marvel is an open source project by Radical having chatbot and smart tools for teachers.
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](https://img.shields.io/badge/Next.js-12.3.0-blue)
![React](https://img.shields.io/badge/React-18.2.0-blue)
![Redux Toolkit](https://img.shields.io/badge/Redux%20Toolkit-%5E1.9.5-purple)
![Emotion](https://img.shields.io/badge/Emotion-%5E11.11.0-pink)
![MUI](https://img.shields.io/badge/MUI-%5E5.13.0-blue)
![Firebase](https://img.shields.io/badge/Firebase-%5E9.22.0-orange)
![Axios](https://img.shields.io/badge/Axios-%5E1.4.0-brightgreen)
![React Hook Form](https://img.shields.io/badge/React%20Hook%20Form-%5E7.43.9-lightgrey)
![Remark](https://img.shields.io/badge/Remark-%5E15.0.1-yellow)
![ESLint](https://img.shields.io/badge/ESLint-%5E8.40.0-blue)
![Prettier](https://img.shields.io/badge/Prettier-%5E2.8.8-ff69b4)
![Husky](https://img.shields.io/badge/Husky-%5E9.0.11-yellow)

## Table of Contents

Expand All @@ -14,13 +30,13 @@ Marvel is an open source project by Radical having chatbot and smart tools for t
## 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` 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."

![Architecture Diagram](architecture.png)
![Architecture Diagram](https://github.com/marvelai-org/marvel-platform/blob/2400bf1b10af77b57976778a108f3f2296aa5215/Marvel%20Architecture.png)

### Folder Structure
## Folder Structure Overview

- **`/frontend`**:
Contains all the files related to the front-end application, including the NextJS app and associated resources.
- **`/`**:
Standard firebase project structure, having frontend in the root and functions in the functions folder.

- **`/functions`**:
Houses the Firebase Functions, which are serverless functions responsible for backend processes such as AI chatbot and tools communicators
Expand All @@ -36,18 +52,18 @@ The "Marvel" platform is structured into two main components: Firebase and AI. T
Security rules for Firestore database, defining read/write permissions.

- **`package.json`** & **`package-lock.json`**:
Defines the project’s global dependencies
Defines the project’s frontend dependencies

## Prerequisites
- Node.js (v14 or later)
- Node.js (v18 or later)
- Firebase CLI (v9.10.0 or later)
- Google Firebase Account

## Setup
To set up the project, follow these steps:

## Local Development
1. Clone the repository: `git clone https://github.com/radicalxdev/marvel-platform`
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 and save it to .env (create in root of this project, see sample.env for refrence)
Expand All @@ -60,27 +76,36 @@ To set up the project, follow these steps:
3. Run for local testing: `firebase serve --only functions`

### Frontend
1. Navigate to front-end project directory: `cd frontend`
1. Navigate to front-end project directory: `cd ../` (root of project)
2. Install dependencies: `npm install`
3. Run for local testing: `npm run dev`
This will start the frontend on localhost:3000 (default port)

### Local Emulator (Optional)
#### Setup
1. Open the terminal and to start the emulators, run the following command: `npm run emulators`
2. Open another terminal simultaneously and start the frontend project, run the following command: `npm run frontend:dev`
2. Open another terminal simultaneously and start the frontend project, run the following command: `npm run dev`

## Cloud Deployment
1. Clone the repository: `git clone https://github.com/radicalxdev/marvel-platform`
1. Clone the repository: `git clone https://github.com/marvelai-org/marvel-platform`
2. Navigate to back-end project directory: `cd functions`
3. Install dependencies: `npm install`
4. Navigate to front-end directory: `cd ../frontend`
4. Navigate to front-end directory: `cd ../` (root of project)
5. Install dependencies: `npm install`
5. Navigate to the root directory and run deploy: `cd .. && npm run deploy`
5. Navigate to the root directory and run deploy: `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.

If you would like to contribute to the project, please follow the guidelines in the `CONTRIBUTING.md` file.
For detailed instructions, refer to the [CONTRIBUTING.md](https://github.com/marvelai-org/marvel-platform/blob/2400bf1b10af77b57976778a108f3f2296aa5215/contributing.md) file in the repository.

## License

This project is licensed under the [MIT License](LICENSE).
This project is licensed under the [MIT License](LICENSE.md).
Binary file renamed frontend/assets/.DS_Store → assets/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 6 additions & 0 deletions assets/svg/ChatBubbleV2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/svg/ChatHistoryButtonIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/svg/ChatIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading