{"id":27140351,"url":"https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlserver_fastapi_logging_streamlit_pydantic","last_synced_at":"2025-10-24T07:40:31.268Z","repository":{"id":285884794,"uuid":"959659390","full_name":"mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic","owner":"mehulcode12","description":"This project is an expense management system that consists of a Streamlit frontend application, SQL for database and a FastAPI backend server.  This application allows users to manage their daily expenses, view analytics, and interact with a database for storing and retrieving expense data.","archived":false,"fork":false,"pushed_at":"2025-04-04T16:06:25.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T16:34:29.506Z","etag":null,"topics":["expense-manager","expense-tracker","fastapi","logging","mysql","pydantic","python","sql","streamlit","streamlit-webapp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehulcode12.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-03T06:31:29.000Z","updated_at":"2025-04-04T16:06:28.000Z","dependencies_parsed_at":"2025-04-04T16:34:32.565Z","dependency_job_id":null,"html_url":"https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic","commit_stats":null,"previous_names":["mehulcode12/codebasics_expense_tracking_with_sqlserver_logging_streamlit_pydantic_streamlit","mehulcode12/codebasics_expense_tracking_with_sqlserver_fastapi_logging_streamlit_pydantic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehulcode12%2Fcodebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehulcode12%2Fcodebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehulcode12%2Fcodebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehulcode12%2Fcodebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehulcode12","download_url":"https://codeload.github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785943,"owners_count":20995644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expense-manager","expense-tracker","fastapi","logging","mysql","pydantic","python","sql","streamlit","streamlit-webapp"],"created_at":"2025-04-08T05:51:52.325Z","updated_at":"2025-10-24T07:40:31.173Z","avatar_url":"https://github.com/mehulcode12.png","language":"Python","readme":"\r\n\r\n# Expense Management System\r\n\r\n\r\nThis project is an expense management system that consists of a Streamlit frontend application, SQL for database and a FastAPI backend server.\r\n\r\nThis application allows users to manage their daily expenses, view analytics, and interact with a database for storing and retrieving expense data.\r\n\r\n## Features\r\n\r\n- Add or update daily expenses with details like amount, category, and notes.\r\n- Analyze expenses over a date range with visualizations.\r\n- Store expense data in a MySQL database.\r\n- Backend powered by FastAPI for handling requests.\r\n- Frontend built with Streamlit for a user-friendly experience.\r\n- Secure authentication and user management.\r\n- Export expenses as CSV or Excel for record-keeping.\r\n\r\n## Tech Stack\r\n\r\n- **Backend**: FastAPI, Uvicorn\r\n- **Frontend**: Streamlit\r\n- **Database**: MySQL\r\n- **Other Libraries**: Pydantic, Requests\r\n\r\n## Project Structure\r\n\r\n- **frontend/**: Contains the Streamlit application code.\r\n- **backend/**: Contains the FastAPI and SQL backend server code.\r\n- **tests/**: Contains the test cases for both frontend and backend.\r\n- **requirements.txt**: Lists the required Python packages.\r\n- **README.md**: Provides an overview and instructions for the project.\r\n\r\n## Setup Instructions\r\n\r\n1. **Clone the repository**:\r\n   ```bash\r\n   git clone https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic.git\r\n   cd expense-management-system\r\n   ```\r\n2. **Install dependencies:**   \r\n   ```bash\r\n   pip install -r requirements.txt\r\n   ```\r\n3. **Run the SQL server:**   \r\n   ```bash\r\n   Use SQL WorkBench and import the sql file from root directory. make sure you provide proper host and password(as per your system)\r\n   ```\r\n4. **Run the FastAPI server:**   \r\n   ```bash\r\n   uvicorn backend.server:app --reload\r\n   ```\r\n5. **Run the Streamlit app:** \r\n    (note: use second terminal/cmd to execute this)\r\n   ```bash\r\n   streamlit run frontend/app.py\r\n   ```\r\n\r\n## API Endpoints\r\n\r\n- **GET /expenses/{expense_date}**: Fetch expenses for a specific date.\r\n- **PUT /expenses/{expense_date}**: Update expenses for a specific date.\r\n- **POST /analytics/**: Fetch expense summary for a date range.\r\n- **POST /export/**: Export expense data as CSV or Excel.\r\n\r\n## Project Structure\r\n\r\n```\r\nExpense_Tracking/\r\n├── backend/                           # Backend folder containing FastAPI server code\r\n│   ├── server.py                      # FastAPI server entry point\r\n│   ├── server.log                     # log file\r\n│   ├── db_helper.py                   # Database helper functions for CRUD operations\r\n│   ├── logging_setup.py               # Logging configuration for the backend\r\n│   └── tests/                         # Backend test cases\r\n│       ├── test_server.py             # Tests for the FastAPI server\r\n│       └── test_db_helper.py          # Tests for database helper functions\r\n│\r\n├── frontend/                          # Frontend folder containing Streamlit app code\r\n│   ├── app.py                         # Streamlit app entry point\r\n│   ├── add_update_tab.py              # Code for the \"Add/Update Expense\" tab\r\n│   ├── analytics_category.py          # Code for the \"View Analytics by Category\" tab\r\n│   ├── analytics_month.py             # Code for the \"View Analytics by Month\" tab\r\n│   ├── debugging.py                   # Code made for debugging and integratoin purpose\r\n│\r\n├── database/                          # Folder for database-related scripts and configurations\r\n│   ├── init_db.sql                    # SQL script to initialize the database and create tables\r\n│   ├── db_config.py                   # Database connection configuration\r\n│   └── migrations/                    # Folder for database migration scripts\r\n│       ├── 001_create_expenses_table.sql\r\n│       └── 002_add_indexes.sql\r\n│\r\n├── tests/                             # Root-level folder for integration tests\r\n│   ├── __init__.py                    # Marks the folder as a Python package\r\n│   └── backend/                       # Folder for database migration scripts\r\n│       ├── test_db_helper.sql         # Tests database helper functions for fetching and summarizing expense data.\r\n│\r\n│\r\n├── requirements.txt                   # Python dependencies for the project\r\n├── README.md                          # Project documentation\r\n```\r\n\r\n## Screenshots \u0026 Recordings\r\n\r\nTo better understand how the application works, here are some screenshots and recordings:\r\n\r\n- **Screenshots**: \r\n1. ## Adding/Updating DATA ![Adding/Updating DATA](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/Screenshots/Screenshot%202025-04-04%20211357.png)\r\n2. ## SQL database ![SQL database](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/Screenshots/Screenshot%202025-04-04%20211418.png)\r\n3. ## Server log file ![Server log file](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/Screenshots/Screenshot%202025-04-04%20211452.png)\r\n4. ## Analytics 1 ![Analytics 1](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/Screenshots/Screenshot%202025-04-04%20211331.png)\r\n5. ## Analytics 2 ![Analytics 2](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/Screenshots/Screenshot%202025-04-04%20211318.png)\r\n6. ## Analytics 3 ![Analytics 3](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/Screenshots/Screenshot%202025-04-04%20211306.png)\r\n\r\n   \r\n- **Screen Recording**:\r\n- [CLick here](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_FastAPI_Logging_Streamlit_pyDantic/blob/main/ScreenRecording.mp4)\r\n\r\nUpload your screenshots and recordings to a publicly accessible location and update this section with the links.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see file for details.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! \r\n\r\nNeed of Contributor:\r\n1. Secure authentication and user management.\r\n2. Export expenses as CSV or Excel for record-keeping.\r\n\r\nPlease follow these steps:\r\n1. Fork the repository.\r\n2. Create a new branch (`feature-branch`).\r\n3. Commit your changes with clear messages.\r\n4. Push the branch and create a Pull Request.\r\n\r\nFor major changes, open an issue first to discuss proposed modifications.\r\n\r\n## Contact\r\n\r\nFor any questions or support, reach out to:\r\n\r\n- **Email**: mehulligade12@gmail.com\r\n- **GitHub Issues**: [Issue Tracker](https://github.com/mehulcode12/codebasics_expense_tracking_with_sqlServer_Logging_Streamlit_pyDantic_Streamlit/issues)\r\n\r\n## Disclaimer\r\n\r\nThis project was inspired by the **Codebasics DSAI Bootcamp**. It is not entirely my original work but has been extended and customized for additional functionality.\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehulcode12%2Fcodebasics_expense_tracking_with_sqlserver_fastapi_logging_streamlit_pydantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehulcode12%2Fcodebasics_expense_tracking_with_sqlserver_fastapi_logging_streamlit_pydantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehulcode12%2Fcodebasics_expense_tracking_with_sqlserver_fastapi_logging_streamlit_pydantic/lists"}