An AI powered Assessment Evaluation Framework
This project is a full-stack application with a React frontend and a FastAPI backend.
- Python 3.10+
- Node.js and npm
-
Create and activate a virtual environment:
python3 -m venv backend/venv source backend/venv/bin/activate -
Install the dependencies:
pip install -r backend/requirements.txt
-
Set up your environment:
- Copy the
backend/.env.examplefile tobackend/.env. - Fill in the required environment variables:
DATABASE_TYPE: The type of database to use (e.g.,sqlite,postgres).DATABASE_URL: The connection string for your database.SECRET_KEY: A secret key for JWT authentication.GCS_BUCKET_NAME: The name of your Google Cloud Storage bucket.GEMINI_API_KEY: Your API key for the Gemini model.GCP_PROJECT_ID: Your Google Cloud project ID.GCP_LOCATION: The location of your Google Cloud resources (e.g.,us-east4).RAG_CORPUS_DISPLAY_NAME: The display name for your RAG corpus.LOG_LEVEL: The logging level for the application (e.g.,INFO,DEBUG).
- Copy the
-
Run the backend server:
The application will be available at
http://localhost:8001.uvicorn backend.app:app --host 0.0.0.0 --port 8001 --reload
-
Navigate to the frontend directory:
cd frontend -
Install the dependencies:
npm install
-
Run the frontend development server:
The application will be available at
http://localhost:5173(or another port if 5173 is busy).npm run dev
This section provides instructions for deploying the application to Google Cloud Run.
- A Google Cloud Platform (GCP) project with billing enabled.
- The Google Cloud SDK installed and configured on your local machine.
- The
gcloudcommand-line tool authenticated with your GCP account (gcloud auth login). - The necessary APIs enabled in your GCP project (Cloud Build, Cloud Run, Artifact Registry, IAM).
This method uses the pre-configured cloudbuild-*.yaml files to automate the build and deployment process.
gcloud builds submit --config cloudbuild-backend.yaml .gcloud builds submit --config cloudbuild-frontend.yaml .This method provides the individual commands to build, push, and deploy the Docker images.
Build the Docker image:
docker build -t gcr.io/[YOUR_PROJECT_ID]/backend ./backendPush the image to Google Artifact Registry:
docker push gcr.io/[YOUR_PROJECT_ID]/backendDeploy the image to Cloud Run:
gcloud run deploy backend \
--image gcr.io/[YOUR_PROJECT_ID]/backend \
--region [YOUR_REGION] \
--platform managed \
--allow-unauthenticated \
--service-account [YOUR_SERVICE_ACCOUNT] \
--set-env-vars-from-file .envBuild the Docker image:
docker build -t gcr.io/[YOUR_PROJECT_ID]/frontend ./frontendPush the image to Google Artifact Registry:
docker push gcr.io/[YOUR_PROJECT_ID]/frontendDeploy the image to Cloud Run:
gcloud run deploy frontend \
--image gcr.io/[YOUR_PROJECT_ID]/frontend \
--region [YOUR_REGION] \
--platform managed \
--allow-unauthenticatedOnce both the backend and frontend have been successfully deployed, you can access the application using the URL provided by the frontend Cloud Run service. You can find this URL in the GCP console or in the output of the gcloud run deploy command.