Bloom Tutor is a platform designed to facilitate the generation, evaluation, and delivery of educational content using Bloom's Taxonomy, RAG, and advanced LLM models. It supports functionalities such as question generation, knowledge graph management, and interactive user interfaces for learning.
- AI Question Generation: Generate questions based on Bloom's Taxonomy.
- Knowledge Graph Integration: Manage and query knowledge graphs for enhanced content delivery.
- Interactive Frontend: A React-based interface for seamless user interaction.
- Backend Services: Python-based backend for processing and data management.
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- Docker & Docker Compose
- Neo4j Database
- OpenAI API Key
-
Clone the repository:
git clone <repository-url> cd content-delivery
-
Install frontend dependencies:
cd frontend npm install
-
Install backend dependencies:
cd ../backend pip install -r requirements.txt
-
Configure environment variables:
- Create a
.env
file in bothfrontend
andbackend
directories. - Add the required variables (e.g.,
OPENAI_API_KEY
, Neo4j credentials).
- Create a
-
Build and run using Docker locally:
docker compose up --build
-
Access the application at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8009
This section explains how to deploy the platform on a Google Cloud Virtual Machine using Docker images stored in Artifact Registry.
- You have a VM instance running on Google Cloud.
- You are the owner of the GCP project (e.g.
schole-edtech
). - Docker is installed on the VM.
- You have pushed your images to Artifact Registry (steps below).
gcloud artifacts repositories create content-delivery --repository-format=docker --location=us --description="Docker repo for backend and frontend"
# Authenticate Docker with Artifact Registry
gcloud auth configure-docker us-docker.pkg.dev
# Tag images
docker tag content-delivery-backend us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-backend:latest
docker tag content-delivery-frontend us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-frontend:latest
# Push images
docker push us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-backend:latest
docker push us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-frontend:latest
# Connect to your VM
gcloud compute ssh your-vm-name --zone=us-central1-a
# Install Docker (if not already installed)
sudo apt update
sudo apt install docker.io -y
sudo usermod -aG docker $USER
newgrp docker
sudo apt install docker-compose-v2
# Authenticate Docker inside the VM
gcloud auth configure-docker us-docker.pkg.dev
Create a file named docker-compose.prod.yml
on the VM with the following content:
version: "3.8"
services:
backend:
image: us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-backend:latest
ports:
- "8009:8009"
env_file:
- .env
restart: always
frontend:
image: us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-frontend:latest
ports:
- "5173:5173"
env_file:
- .env
restart: always
Make sure to copy your
.env
file to the same directory on the VM.
-d flag is for background running
docker compose -f docker-compose.prod.yml up -d
Pull images
docker compose -f docker-compose.prod.yml up --pull always
You can now access the application from the public IP of your VM:
- Frontend:
http://<VM-IP>:5173
- Backend:
http://<VM-IP>:8009
By default, Google Cloud blocks all incoming traffic. To make your app accessible from the internet, open the necessary ports via firewall rules (from your local machine not connected to ssh, not from the server):
gcloud compute firewall-rules create allow-content-delivery-frontend \
--allow=tcp:5173 \
--target-tags=http-server \
--description="Allow access to content-delivery frontend on port 5173" \
--direction=INGRESS \
--priority=1000 \
--network=default
gcloud compute firewall-rules create allow-content-delivery-backend \
--allow=tcp:8009 \
--target-tags=http-server \
--description="Allow access to content-delivery backend on port 8009" \
--direction=INGRESS \
--priority=1000 \
--network=default
Make sure your VM has the tag
http-server
, or these rules will not apply.
To ensure the containers restart automatically when the VM reboots:
-
Edit your crontab:
crontab -e
-
Add this line at the end:
@reboot docker compose -f /path/to/docker-compose.prod.yml up -d
If you only want to test the backend image:
docker pull us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-backend:latest
docker run -p 8009:8009 --env-file .env us-docker.pkg.dev/schole-edtech/content-delivery/content-delivery-backend:latest
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.