ai_policy_copilot is a comprehensive application designed to assist users in managing and generating AI policies. It features a frontend built with Next.js and a backend powered by FastAPI, providing a seamless experience for users to interact with AI policy management tools.
- Features
- Prerequisites / Requirements
- Installation
- Usage
- Configuration
- Project Structure
- API / Core Concepts
- Contributing
- License
- Contact / Support
- Acknowledgments
- 🌐 Full-stack application with a responsive frontend and robust backend.
- ⚙️ Easy deployment using Docker and Docker Compose.
- 📦 Modular architecture with clear separation between frontend and backend.
- 🔒 Environment variable management for secure configuration.
- 📊 API endpoints for policy management and data retrieval.
- Node.js (for frontend)
- Python 3.8+ (for backend)
- Docker (for containerization)
- Docker Compose (for orchestration)
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Dcastor21/ai_policy_copilot.git cd ai_policy_copilot -
Navigate to the frontend directory and install dependencies:
cd fe npm install -
Navigate to the backend directory and install dependencies:
cd ../be pip install -r requirements.txt -
Set up environment variables by copying the example file:
cp .env.example .env
-
Start the application using Docker Compose:
docker-compose up
Once the application is running, you can access the frontend at http://localhost:3000. The backend API will be available at http://localhost:8000.
To retrieve policies, you can use the following curl command:
curl http://localhost:8000/api/policiesThe application uses environment variables for configuration. You can modify the .env file in the backend directory to set your specific configurations, such as database URLs and API keys.
ai_policy_copilot
├── README.md
├── .gitignore
├── docker-compose.yml
├── fe
│ ├── README.md
│ ├── package.json
│ ├── tsconfig.json
│ ├── next.config.ts
│ ├── .env
│ ├── public
│ └── src
│ ├── app
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components
│ │ ├── Header.tsx
│ │ ├── QueryInput.tsx
│ │ └── ResponseCard.tsx
│ ├── lib
│ │ └── api.ts
│ └── types
│ └── index.ts
└── be
├── README.md
├── .env.example
├── Dockerfile
├── requirements.txt
└── app
├── main.py
├── api
│ └── routes.py
├── core
│ └── config.py
└── services
├── ingestion.py
├── llm.py
└── retrieval.py
The backend is structured around FastAPI, providing a RESTful API for policy management. Key components include:
- main.py: Entry point for the FastAPI application.
- routes.py: Defines the API endpoints for managing policies.
- config.py: Contains configuration settings for the application.
- services: Contains business logic for policy ingestion, LLM interactions, and retrieval.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a clear description of your changes.
This project is licensed under the MIT License.
For support or inquiries, please contact the project maintainer at [darnelcastor2@gmail.com].
- Thanks to the contributors and the open-source community for their support and resources.