A full-stack web application for AI-powered tax advice.
Frontend: React.
Backend: Flask (Python) with OpenAI integration.
Develop and run easily with Docker and Docker Compose.
- Docker and Docker Compose
- An OpenAI API key (format:
sk-...
)
git clone https://github.com/Herc-Ch/tax_ai_app.git
cd tax_ai_app
Create a .env
file in your project root with:
OPENAI_API_KEY=sk-your-openai-api-key-here
⚠️ Never commit your.env
file or API keys to public repositories!
docker compose up --build
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Frontend: Uses Node.js to build your React app, then serves with Nginx for production.
- Backend: Runs Flask, handles form data and connects to OpenAI for tax advice.
- No Python/Node/npm install required on your machine – all happens in the containers.
Backend exposes endpoints at http://localhost:5000/api/submit-tax
:
Method | Endpoint | Description | Example Body (JSON) |
---|---|---|---|
POST | /api/submit-tax | Submit new tax data | { "filing_status": "single", ... } |
GET | /api/submit-tax | Get all tax data submissions | – |
PUT | /api/submit-tax | Update tax data at a given index | { "index": 0, "income": 1500, ... } |
DELETE | /api/submit-tax?index=0 | Delete tax submission at given index | – |
AI Advice:
POST /api/ai-tax-advice
with your tax form fields to receive AI-generated advice.
You do NOT need to install Node, Python, or pip if using Docker!
But for advanced local development:
Backend:
cd backend
pip install -r requirements.txt
export OPENAI_API_KEY=sk-your-openai-api-key
python main.py
Frontend:
npm install
npm start
- The backend stores data in memory (not persistent).
- For production: use HTTPS, proper secrets management, and persistent storage.
- All dependencies are installed inside containers when using Docker.
This project uses GitHub Actions to automate the testing and validation process with every code change.
- Trigger: The CI pipeline runs automatically on every
push
orpull request
to themain
branch. - Steps:
- Checkout Code – Retrieves the latest code from the repository.
- Set Up Docker – Installs Docker and Docker Compose for building and running services.
- Build and Start Services – Builds backend and frontend containers using
docker-compose
. - Run Backend Tests – Executes Python unit tests using
pytest
inside the backend container. - Linting – A separate job uses Super-Linter to check code quality and formatting for multiple languages (Python, JavaScript, CSS, Markdown, YAML, etc.).
The pipeline uses the OPENAI_API_KEY
stored as a GitHub Secret to run the backend in CI without exposing sensitive credentials.
I considered adding a conversational mode, where the user could ask follow-up questions or clarify their situation, and the AI would remember the context. This would turn the tool into a lightweight AI tax assistant, similar to ChatGPT but focused strictly on tax filing. For the scope of this project, I focused on one-shot advice to keep the experience simple and polished—but the architecture can be easily extended for chat.
This project includes interactive API documentation generated automatically with Swagger (OpenAPI) using the Flasgger library for Flask.
-
Access the API docs:
Once the backend server is running, visit http://localhost:5000/apidocs in your browser. -
Features:
- Explore all available API endpoints and methods (
GET
,POST
,PUT
,DELETE
). - See required parameters, example requests, and response schemas.
- Try out the endpoints live in your browser without any extra tools (no need for Postman).
- Explore all available API endpoints and methods (
Swagger UI makes it easy for developers, interviewers, and non-technical users to understand, test, and interact with the API quickly and reliably.
This project uses a local SQLite database to store submitted tax information in an anonymized form for demonstration and aggregate statistical analysis purposes. No names, emails, or other identifying information are stored. You can explore or inspect the database directly using DB Browser for SQLite.
Note:
If data is truly anonymized, it is no longer considered “personal data” under GDPR.
- All data stored in the database is fully anonymized and cannot be linked back to any individual.
- This ensures ethical and legal compliance with modern privacy standards.
- Users are encouraged to review or analyze the anonymized data using standard SQLite tools.
Your privacy and security are a top priority in this demo application.
Happy tax filing with AI!