{"id":22495208,"url":"https://github.com/osbm/ain3005-final-project","last_synced_at":"2026-04-13T20:02:23.135Z","repository":{"id":217320415,"uuid":"737324814","full_name":"osbm/ain3005-final-project","owner":"osbm","description":"A library automation system that utilizes Apache kafka, docker compose, mongodb, flask","archived":false,"fork":false,"pushed_at":"2024-01-14T18:06:26.000Z","size":1144,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T21:16:02.001Z","etag":null,"topics":["apache-kafka","docker","docker-compose","flask","mongodb"],"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/osbm.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}},"created_at":"2023-12-30T16:14:59.000Z","updated_at":"2024-07-17T15:51:07.000Z","dependencies_parsed_at":"2024-01-15T19:13:43.849Z","dependency_job_id":null,"html_url":"https://github.com/osbm/ain3005-final-project","commit_stats":null,"previous_names":["osbm/ain3005-final-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/osbm/ain3005-final-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osbm%2Fain3005-final-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osbm%2Fain3005-final-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osbm%2Fain3005-final-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osbm%2Fain3005-final-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osbm","download_url":"https://codeload.github.com/osbm/ain3005-final-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osbm%2Fain3005-final-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31768649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["apache-kafka","docker","docker-compose","flask","mongodb"],"created_at":"2024-12-06T19:26:24.537Z","updated_at":"2026-04-13T20:02:23.115Z","avatar_url":"https://github.com/osbm.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# AIN3005 - Advanced Python Programming - Final Project\n\n\nThe goal of this project is to implement a Library Automation System (LAS) using Flask as the web framework, MongoDB as the database, and Apache Kafka for messaging. The LAS will provide various services, including book lending, reservation, and search functionality.\n\nRequirements:\n\n- Flask Web Application: Implement a REST API to serve requirements you analyzed in the first homework for the Library Automation System.\n- MongoDB Integration: Use MongoDB to store and manage data related to books, users, borrowing records, fines, and reservations.\n- Apache Kafka Messaging: Integrate Apache Kafka for communication between different components of the LAS, ensuring reliable and scalable messaging.\n- User Authentication and Authorization: Implement a user authentication system with roles (students, faculty members, staff, and graduates) to control access to LAS services. Implement JWT for secure user authentication and authorization. Each request to LAS services should be validated using JWT.\n\n\nNotes:\n\n- Include comprehensive documentation explaining the system architecture, database schema, and API endpoints.\n- Clearly specify all dependencies and include a setup guide for easy replication of the environment.\n- Provide a set of test cases to ensure the functionality of key features.\n\n\n\n# Installation Guide\n\n## Prerequisites\n\nYou need to install docker and docker-compose to run the application. You can find the installation guide for your operating system on the official docker website: https://docs.docker.com/get-docker/\n\n## Running the application\n\nTo run the application, you need to clone the repository and run the following command in the root directory of the project:\n\n```bash\ndocker compose up\n```\n\nThis is it. This command will build the images and run the containers. You can access the application on http://localhost:8000\n\n# Infrastructure\n\nThe application consists of 6 services:\n- **mongo**: MongoDB database to store the data\n- **mongodb-import-data**: This container is run once to import the data into the database using mongoimport. It is not needed after the data is imported.\n- **kafka**: Apache Kafka messaging system to communicate between services\n- **zookeeper**: This is needed for Kafka to work\n- **flask-app**: Flask application that serves the API endpoints\n- **kafta-consumer**: Kafka consumer that listens to the messages from the flask-app and streams them to log files then you can access it in the `kafka-consumer/output`  folder.\n\nThe mongo, kafka, and zookeeper services are taken from the official docker hub images. The flask-app and kafka-consumer images are built from the Dockerfiles in the `flask-app` and `kafka-consumer` folders respectively. The mongodb-import-data image is built from the Dockerfile in the `mongodb-import-data` folder.\n\n# Database Schema\n\nThe database consists of 4 collections:\n\n- **books**: This collection stores the information about the books. Following is the first document:\n\n```json\n{\n    \"isbn\": \"0596159900\",\n    \"title\": \"Head First HTML and CSS\",\n    \"year\": 2012,\n    \"price\": 26.78,\n    \"page\": 768,\n    \"category\": \"IT\",\n    \"coverPhoto\": \"images/head.first.html.and.css.png\",\n    \"publisher\": \"O'Reilly\",\n    \"author\": \"Elisabeth Robson, Eric Freeman\",\n    \"status\": \"reserved\",\n    \"current_occupant_username\": \"osman\",\n    \"last_update_date\": \"2017-01-01\",\n    \"deadline\": \"2024-01-26\"\n}\n```\n\n- **users**: This collection stores the information about the users. Following is the first document:\n\n```json\n{\n    \"name\": \"admin\",\n    \"surname\": \"admin\",\n    \"username\": \"admin\",\n    \"password\": \"admin\",\n    \"birthday\": \"01.01.2001\",\n    \"email\": \"admin@admin.com\",\n    \"user_type\": \"admin\",\n    \"current_balance\": 120000\n}\n```\n\n- **fines**: This collection stores the information about the fines. Following is the first document:\n\n```json\n{\n    \"fine_date\": \"2019-01-01\",\n    \"fine_id\": 1,\n    \"username\": \"meg\",\n    \"fine_amount\": 100,\n    \"reason\": \"late return\"\n}\n```\n\n# Enjoy!\n\nI also added some html and css to make the application look better. I hope you enjoy it!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosbm%2Fain3005-final-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosbm%2Fain3005-final-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosbm%2Fain3005-final-project/lists"}