This project is a full-stack AI-powered Question and Answer application, consisting of a React frontend and a FastAPI backend. It utilizes OpenAI's GPT model for generating answers and Firebase for user authentication. The application is deployed on AWS Lightsail, providing a scalable and cost-effective hosting solution.
The project is organized into two main directories:
- Frontend: Contains the React-based web application. Refer to the frontend README for detailed information on setting up, running, and contributing to the frontend.
- Backend: Contains the FastAPI-based API service. Refer to the backend README for detailed information on setting up, running, and contributing to the backend.
- AWS Lightsail account
- Docker and Docker Compose installed on your local machine
- OpenAI API key
- Firebase Admin SDK JSON file
- Create a new Lightsail instance with Ubuntu OS.
- Configure the instance to allow inbound HTTP and HTTPS traffic.
- Assign a static IP address to your instance for consistent access.
- SSH into your Lightsail instance.
- Clone the project repository:
git clone [your-repo-url] - Set the required environment variables:
export OPENAI_API_KEY=your_openai_api_key export FIREBASE_ADMIN_SDK_PATH=/path/to/firebase-adminsdk.json - Install Docker and Docker Compose on the instance if not already installed.
- Navigate to the project root directory.
- Build and run the Docker containers:
docker-compose up -d --build
The frontend Nginx configuration is set up to proxy requests to the backend API:
nginx:frontend/nginx.conf
The project includes a GitHub Actions workflow for continuous deployment. Whenever changes are pushed to the main branch, the workflow automatically deploys the latest code to the Lightsail instance, ensuring that the application stays up to date.
To set up the project for local development, follow the instructions in the respective README files for the frontend and backend. Each directory contains detailed steps for installing dependencies, running the application locally, and contributing to the codebase.
Contributions to the project are welcome! If you'd like to contribute, please follow the guidelines outlined in the frontend and backend README files. Be sure to adhere to the project's coding standards and submit pull requests for review.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as permitted by the license.
For any further questions or inquiries, please contact the project maintainers.