{"id":17965946,"url":"https://github.com/fabrizziob/CoffeeTime-WebApp","last_synced_at":"2025-03-25T07:31:11.392Z","repository":{"id":259493081,"uuid":"875720666","full_name":"FabrizzioB/CoffeeTime-WebApp","owner":"FabrizzioB","description":"FastAPI based web application for managing a team's coffee purchases.","archived":false,"fork":false,"pushed_at":"2024-12-06T11:08:28.000Z","size":5160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T04:43:40.718Z","etag":null,"topics":["css","fastapi","html","javascript","mysql","python","rest-api"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FabrizzioB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-20T17:16:57.000Z","updated_at":"2024-12-06T11:08:34.000Z","dependencies_parsed_at":"2024-12-06T12:29:33.444Z","dependency_job_id":null,"html_url":"https://github.com/FabrizzioB/CoffeeTime-WebApp","commit_stats":null,"previous_names":["fabrizziob/coffeetime","fabrizziob/coffeetime-webapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabrizzioB%2FCoffeeTime-WebApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabrizzioB%2FCoffeeTime-WebApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabrizzioB%2FCoffeeTime-WebApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabrizzioB%2FCoffeeTime-WebApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FabrizzioB","download_url":"https://codeload.github.com/FabrizzioB/CoffeeTime-WebApp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245418269,"owners_count":20612101,"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":["css","fastapi","html","javascript","mysql","python","rest-api"],"created_at":"2024-10-29T13:06:15.273Z","updated_at":"2025-03-25T07:31:11.379Z","avatar_url":"https://github.com/FabrizzioB.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoffeeTime Web Application\n\n\nThis project is a FastAPI-based web application for managing a team’s coffee purchases.\n\nIt includes a web interface and a set of API endpoints that interact with a MySQL database over an SSH tunnel. \n\nThe project manages a list of team members and tracks the number of times each member has paid for coffee.\n\n### Web Interface\n\n1. Login Page (/): Displays the login page for initial user access.\n2. Add Member Page (/add): Provides a form for adding a new team member. \n3. Update Coffee Count Page (/update): Allows users to update the coffee count for an existing member. \n4. Delete Member Page (/delete): Lets users remove a team member from the database. \n5. View Team Members (/team): Displays all team members and their coffee counts. \n6. Sort Members (/sort): Shows options to sort members based on coffee purchases.\n7. Single Page Application (SPA) Page (/index): Serves the main interface for the team management functionality.\n8. Register (/register): Page to register the user for the app.\n9. Password recovery (/recovery): Page to recover the account / password reset.\n\n### API Endpoints\n\n#### Member Management\n\n- PUT /add: Adds a new team member to the database with an initial coffee count.\n- DELETE /delete/{name}: Removes a specified member from the database by name.\n- Coffee Count Management\n- PUT /add-coffee: Increments the coffee count for a specified member by one.\n- PUT /add-coffee/{name}/{number}: Increments a specified member’s coffee count by a given number, validating that the number is non-negative.\n- PUT /remove-coffee: Resets the coffee count for a specified member to zero.\n\n#### Data Retrieval\n\n- GET /team-members-names: Returns a list of team member names in alphabetical order.\n- GET /team-members: Retrieves all team members along with their coffee counts as JSON.\n- GET /sort-least: Returns the team member who has paid for the least coffees.\n- GET /sort-most: Returns the team member who has paid for the most coffees. \n\n### Database Management\n- Connection Setup: The coffee.py file configures a secure SSH tunnel to access a MySQL database. This allows the app to establish a connection to the database server remotely.\n- Database Operations: The database contains a team_members table that stores each team member’s name and the number of times they have paid for coffee.\n- Create Table: Ensures that the team_members table is present in the database.\n- Insert, Update, and Delete Records: Functions to add, increment, reset, or remove entries related to team members and coffee counts.\n- Data Retrieval: Queries to fetch team members by name, sorted lists of members by coffee counts, and individual member checks. \n\n### Sorting and Filtering\n\n- Sorting functions (sort_least_coffees and sort_most_coffees) identify team members who have paid for the fewest and most coffees, respectively. The results are alphabetically ordered when counts are the same. \n\n### Startup and Shutdown\n\n- The app opens a connection to the database on startup and closes it gracefully on shutdown, ensuring resource management and connection stability.\n\n### To do list\n\n- In View Team Members view should be a button to delete/remove the user.\n- Login, register and recovery to finish.\n- Only logged in users can use the app.\n- Only users logged in can use all the functionalities of the app.\n- Mockups.\n- Front-end in React.\n- Convert the application to Docker container and deploy.\n- Create a monitoring Server to monitor the application in Python.\n- Set this on a webserver like Apache.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabrizziob%2FCoffeeTime-WebApp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabrizziob%2FCoffeeTime-WebApp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabrizziob%2FCoffeeTime-WebApp/lists"}