- Introduction
- Features
- Installation
- Configuration
- Running the Application
- API Documentation
- Project Structure
- License
This is a backend project built with FastAPI. The project provides several routing paths to handle different functionalities. FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
- Fast and asynchronous API endpoints.
- Detailed API documentation with Swagger UI and Redoc.
- Easy to extend and customize.
- Uses Pydantic for data validation.
- Python 3.6+
pip
(Python package installer)
-
Clone the repository:
git clone https://github.com/PinsaraPerera/intellihack_backend.git cd your-repo-name
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
Create a .env
file in the root directory and add your environment variables. Example:
PROJECT_ID = ""
REGION = ""
INSTANCE_NAME = ""
INSTANCE_CONNECTION_NAME = f"{PROJECT_ID}:{REGION}:{INSTANCE_NAME}"
DB_USER = ""
DB_PASS = ""
DB_NAME = ""
PRIVATE_IP =
OPENAI_API_KEY = ""
BUCKET_NAME = ""
# redis configure
REDIS_HOST = ""
REDIS_PORT =
# microservices url
AGENT_SERVICE_URL = ""
To run the application, execute the following command:
uvicorn app.main:app --host 0.0.0.0 --port 80 --reload
This will start the server at http://127.0.0.1:80
API Documentation FastAPI automatically generates interactive API documentation at the following URLs:
Swagger UI: http://127.0.0.1:80/docs Redoc: http://127.0.0.1:80/redoc
intellihack_backend/
├── .github/
│ └── workflows/
│ └── (workflow files)
├── app/
│ ├── api/
│ │ ├── endpoints/
│ │ │ ├── init.py
│ │ │ ├── authentication.py
│ │ │ ├── gcp.py
│ │ │ ├── query.py
│ │ │ ├── train.py
│ │ │ └── users.py
│ ├── core/
│ ├── crud/
│ ├── db/
│ ├── models/
│ ├── quizGeneratingAgent/
│ ├── schemas/
│ ├── utils/
│ ├── init.py
│ └── main.py
├── .dockerignore
├── .gitignore
├── Dockerfile
├── Dockerfile.redis
├── LICENSE
├── README.md
├── dependencies.txt
├── entrypoint.sh
├── logging_config.py
├── redis.conf
├── requirements.txt
└── template.py
This project is licensed under the Apache License. See the LICENSE file for more details.