A full-stack, AI-powered Q&A platform for educational content. This project uses a microservices architecture with a React frontend, a Java Spring Boot backend, and a Python FastAPI service for Generative AI capabilities.
The application is composed of several containerized services orchestrated by Docker Compose:
client: A React single-page application that provides the user interface.server: A Java Spring Boot application that handles business logic, user authentication, and data management.genai-service: A Python FastAPI microservice that performs Retrieval-Augmented Generation (RAG) for the Q&A feature.postgres-db: A PostgreSQL database for storing user and course data.weaviate: A Weaviate vector database for storing document embeddings used by thegenai-service.
Workflow: The Client communicates with the Server via a REST API. For AI-related tasks (like asking a question), the Server calls the GenAI Service, which uses the Weaviate vector store to find relevant context and generate an answer.
These instructions will get the entire application running on your local machine for development and testing purposes.
- Docker
- Docker Compose
Clone the repository and run the following command from the project root:
docker compose up --build- The client (React app) will be available at: http://localhost:5173
- The genai-service (FastAPI) will be available at: http://localhost:8000
- The server (Spring Boot) will be available at: http://localhost:8080
docker compose down
curl http://localhost:8000/health
curl -X POST http://localhost:8000/api/v1/index \
-H 'Content-Type: application/json' \
-d '{"documents": [{"id": "doc1", "text": "This is a test document."}]}'
curl -X POST http://localhost:8000/api/v1/query \
-H 'Content-Type: application/json' \
-d '{"query": "test document"}'
See services/genai/README.md for more details and payload examples.
- The Profile page allows users to view and update their name/email and change their password.
- To test:
- Log in and navigate to
/profile. - Update your name/email and submit. If you change your email, you will be logged out and must log in again.
- Change your password using the form. You must enter your current password and confirm the new password.
- Log in and navigate to
If you encounter build errors, run:
cd services/client
npm install
npm run dev
The Profile page allows users to update their name, email, and password. It uses the following API endpoints:
GET /api/v1/user/profileβ Fetch user profile dataPUT /api/v1/user/profileβ Update user profile (name/email)POST /api/v1/user/change-passwordβ Change user password
- Log in to the frontend.
- Navigate to the Profile page.
- Update your name or email and click Update Profile.
- If you change your email, you may be logged out and required to log in again.
- Change your password using the form. You must enter your current password and confirm the new password.
curl -X GET http://localhost:8000/api/v1/user/profile -H "Authorization: Bearer <token>"curl -X PUT http://localhost:8000/api/v1/user/profile \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "New Name", "email": "new@email.com"}'curl -X POST http://localhost:8000/api/v1/user/change-password \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"old_password": "currentpass", "new_password": "newpass"}'- Ensure all dependencies are installed (see above).
- If Poetry lock errors occur in genai-service, run
poetry lockinsideservices/genai. - If you see import errors in genai-service, ensure
PYTHONPATHis set (handled in Dockerfile). - For React/TypeScript errors, ensure all
@types/*packages are installed.
- Setup Instructions: See below for quick local setup. Each service has its own README for service-specific instructions.
- Architecture Overview:
docs/architecture-description.mdincludes diagrams and models. - Usage Guide: This README and service READMEs provide step-by-step usage and testing instructions.
- Student Responsibilities: Team roles and contributions are documented in
docs/team-responsibilities.md(or update with your actual file). - API Documentation:
- Backend: OpenAPI/Swagger docs at
services/genai/README.md,services/backend/README.md, and API Gateway setup/routing details atservices/backend/api-gateway/README.md- Discovery Service registration and configuration:
services/backend/discovery-service/README.md - Document Microservice API and management:
services/backend/document-microservice/README.md - User-Course Microservice API and management:
services/backend/user-course-microservice/README.md - Discovery Service registration and configuration:
services/backend/discovery-service/README.md
- Discovery Service registration and configuration:
- Frontend:
services/client/README.mdMonitoring Documentation: - Prometheus and Grafana setup instructions are in
docs/monitoring.md(or update with your actual file). - Alerting rules and dashboard exports included. CI/CD and GenAI Documentation:
- CI/CD pipeline details in
docs/cicd-pipeline.md(or update with your actual file). - GitHub Actions workflow documentation in
.github/workflows/README.md - GenAI usage and integration in
services/genai/README.md. Reproducible Setup: - Deployment and local setup instructions are clear, reproducible, and platform-specific. You can set up the entire project locally with three or fewer commands, using sane defaults for all services (see Getting Started above). Weekly Reporting:
- Weekly progress and engineering process are documented in
docs/weekly-reports.md(or update with your actual file).
- Backend: OpenAPI/Swagger docs at
- All major subsystems expose documented APIs using OpenAPI/Swagger. See service-specific READMEs for endpoint details and example payloads.
- Prometheus is integrated for metrics collection.
- Grafana dashboards visualize system behavior and include at least one alert rule.
- See
docs/monitoring.mdfor setup and dashboard exports.
- GitHub Actions CI pipeline builds, tests, and generates Docker images for all services.
- CD pipeline deploys to Kubernetes (Rancher/AWS) on main branch merges.
- Automated tests run in CI and cover key functionality for server, client, and GenAI logic.
- See
docs/cicd-pipeline.mdfor details.
- Team roles, contributions, and weekly progress are documented in
docs/team-responsibilities.mdanddocs/weekly-reports.md.
When a document is deleted via the backend API, the following workflow is triggered:
- The backend first calls the GenAI service's de-index endpoint to remove all vector data for the document from the vector database (Weaviate).
- Only if de-indexing succeeds, the document is deleted from the main database.
- If de-indexing fails, the document is not deleted from the database, ensuring consistency between the main data store and the vector store.
Endpoints involved:
- Backend:
DELETE /api/v1/documents/{courseSpaceId}/{id}(seeservices/backend/document-microservice/README.md) - GenAI:
DELETE /api/v1/index/{course_space_id}/{document_id}(seeservices/genai/README.md)
For more details and payload examples, see the linked service READMEs.
MIT
This project uses a polyglot monorepo structure. Each service manages its own dependencies and environment:
This repository uses a polyglot monorepo structure. Each microservice is fully isolated and manages its own dependencies and environment. The following conventions apply:
Python Microservices (e.g., genai)
- Dependency management: Poetry
- Each service contains its own
pyproject.tomland virtual environment - All Poetry commands should be executed from the respective service directory
Node.js/React Microservices
- Dependency management: npm
- Each service contains its own
package.jsonandnode_modulesdirectory - All npm commands should be executed from the respective service directory
Java Microservices
- Dependency management: Gradle or Maven
- Each service contains its own
build.gradleorpom.xml - All build and test commands should be executed from the respective service directory
-
Change to the service directory:
cd services/genai -
Set the Python path and run tests:
PYTHONPATH=src poetry run pytest
This ensures the
genaipackage is found by Python. -
(Optional) Run a specific test file:
PYTHONPATH=src poetry run pytest tests/unit/test_qa_pipeline.py
Note: Each microservice is isolated. You should maintain separate Poetry, npm, or Gradle environments for each service.
-
Change to the service directory:
cd services/genai -
Set the Python path and run tests:
PYTHONPATH=src poetry run pytest
This ensures the
genaipackage is found by Python. -
(Optional) Run a specific test file:
PYTHONPATH=src poetry run pytest tests/unit/test_qa_pipeline.py
Note: Each service is isolated. You can (and should) have multiple Poetry, npm, or Gradle environmentsβone per service.