This is a Personal Budgeting Application that helps users manage their finances by tracking income, expenses, and budgets. The application consists of a Django backend, a React frontend, and uses MySQL as the database. The project is containerized using Docker and Docker Compose.
- Track income and expenses
- Display lists of income and expenses
- Add, edit, and delete income and expense entries
- Sample data for quick setup and testing
- Django
- Django REST Framework
- React
- MySQL
- Docker
- Docker Compose
- Axios
- Docker
- Docker Compose
- Kubernetes
- Minikube
- kubectl
-
Clone the Repository:
git clone https://github.com/lainceline/budget_app_project.git cd budget_app_project -
Set Up the Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Backend Dependencies:
pip install -r requirements.txt
-
Build and Start the Containers:
docker-compose up --build
-
Apply Migrations:
docker-compose exec web python manage.py migrate -
Load Sample Data:
docker-compose exec web python manage.py loaddata budget/fixtures/sample_data.json -
Create a Superuser (Optional):
docker-compose exec web python manage.py createsuperuser -
Access the Application:
- Backend:
http://localhost:8000 - Frontend:
http://localhost:3000
- Backend:
-
Start Minikube:
minikube start
-
Set Docker Environment to Minikube:
& minikube -p minikube docker-env --shell powershell | Invoke-Expression
eval $(minikube docker-env)
-
Build Docker Images:
docker build -t budget_app:latest ./budget_app docker build -t budget-frontend:latest ./budget-frontend
-
Apply Kubernetes Manifests:
kubectl apply -f k8s/mysql-deployment.yaml kubectl apply -f k8s/django-deployment.yaml kubectl apply -f k8s/react-deployment.yaml
-
Verify Pods and Services:
kubectl get pods kubectl get services
-
Access the Application:
minikube service react --url
- Run Backend Tests:
docker-compose exec web python manage.py test
-
Install Frontend Test Dependencies:
cd budget-frontend npm install -
Run Frontend Tests:
npm test
personal-budgeting-app/
│
├── budget_app/ # Django project directory
│ ├── budget/ # Django app directory
│ ├── budget_app/ # Django project settings
│ ├── manage.py # Django project management script
│ └── requirements.txt # Python dependencies
│
├── budget-frontend/ # React project directory
│ ├── public/ # Public assets
│ ├── src/ # React source code
│ ├── package.json # Node.js dependencies and scripts
│ └── package-lock.json # Lockfile for Node.js dependencies
│
├── k8s/ # Kubernetes manifests
│ ├── mysql-deployment.yaml # MySQL deployment and service
│ ├── django-deployment.yaml # Django deployment and service
│ └── react-deployment.yaml # React deployment and service
│
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project README
Feel free to submit pull requests or open issues to improve this project.
This project is licensed under the MIT License - see the LICENSE file for details.
This `README.md` provides comprehensive instructions for setting up and running the application using Docker Compose and Kubernetes with Minikube, as well as running tests for both the backend and frontend. If you have any further questions or need additional information, please let me know!