{"id":20828973,"url":"https://github.com/the-akira/flask-library","last_synced_at":"2025-05-07T21:21:56.372Z","repository":{"id":35707325,"uuid":"205951022","full_name":"the-akira/Flask-Library","owner":"the-akira","description":"A simple library prototype using Python and Flask","archived":false,"fork":false,"pushed_at":"2024-02-21T03:07:06.000Z","size":3875,"stargazers_count":3,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T14:11:19.200Z","etag":null,"topics":["cloudinary","cloudinary-api","flask","flask-application","flask-backend","flask-sqlalchemy","flask-wtf","heroku-deployment","python3"],"latest_commit_sha":null,"homepage":"https://secretslibrary.pythonanywhere.com","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/the-akira.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}},"created_at":"2019-09-02T23:26:50.000Z","updated_at":"2024-09-30T15:04:43.000Z","dependencies_parsed_at":"2024-02-21T04:25:05.049Z","dependency_job_id":"7d4cf3fb-3d0f-4f6f-907e-6f82462d1846","html_url":"https://github.com/the-akira/Flask-Library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-akira%2FFlask-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-akira%2FFlask-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-akira%2FFlask-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-akira%2FFlask-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the-akira","download_url":"https://codeload.github.com/the-akira/Flask-Library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252955163,"owners_count":21831059,"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":["cloudinary","cloudinary-api","flask","flask-application","flask-backend","flask-sqlalchemy","flask-wtf","heroku-deployment","python3"],"created_at":"2024-11-17T23:19:01.222Z","updated_at":"2025-05-07T21:21:56.336Z","avatar_url":"https://github.com/the-akira.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Library\n\n![img](https://raw.githubusercontent.com/the-akira/Flask-Library/master/projeto/static/img/Avatar.png)\n\nA simple library prototype using [Python](https://www.python.org/) and [Flask](https://flask.palletsprojects.com/en/2.1.x/).\n\n## Features\n\n- Create Books\n- Search Books\n- Delete Books\n- Update Books\n- Review Books\n- Message System\n- User Registration \u0026 Login\n- Account Info \u0026 Update\n\n## TODO\n\n- Create a table for Authors.\n- Create the interface for Authors.\n\n## Installation\n\n### Clone the Repository\n\n```\ngit clone https://github.com/the-akira/Flask-Library.git\n```\n\n### Inside the Main Directory\n\nCreate a Virtual Environment:\n\n```\npython -m venv myvenv\n```\n\nActivate the Virtual Environment:\n\n```\nsource myvenv/bin/activate\n```\n\nInstall Requirements:\n\n```\npip install -r requirements.txt\n```\n\nRun the Application:\n\n```\npython run.py\n```\n\nOpen your Web Browser and navigate to `http://127.0.0.1:5000/`.\n\n## Managing the Database\n\n### Inside the Main Directory\n\nStart a new [Python REPL](https://python.land/introduction-to-python/the-repl) in your terminal:\n\n```\npython\n```\n\nCreating a new database:\n\n```python\n\u003e\u003e\u003e from projeto import db\n\u003e\u003e\u003e db.create_all()\n```\n\nInitiating a new app context:\n\n```python\n\u003e\u003e\u003e from projeto import create_app\n\u003e\u003e\u003e app = create_app()\n\u003e\u003e\u003e app.app_context().push()\n```\n\nImporting the database models:\n\n```python\n\u003e\u003e\u003e from projeto.models import User, Book, Analysis\n```\n\nInserting a new user in the database:\n\n```python\nuser = User(\n    username='talantyr', \n    email='talantyr@gmail.com', \n    image_file='default.jpg', \n    password='22447755'\n)\ndb.session.add(user)\ndb.session.commit()\n```\n\nQuerying for all users in the database:\n\n```python\n\u003e\u003e\u003e users = User.query.all()\n\u003e\u003e\u003e [user.email for user in users]\n```\n\nSearch for a user with a specific ID:\n\n```python\n\u003e\u003e\u003e User.query.get(1)\n```\n\nOrder users by email ascending:\n\n```python\n\u003e\u003e\u003e users = User.query.order_by(User.email.asc())\n\u003e\u003e\u003e [user for user in users]\n```\n\nSearch for a specific user in the database:\n\n```python\n\u003e\u003e\u003e users = User.query.filter(User.username.contains('aki'))\n\u003e\u003e\u003e [user for user in users]\n```\n\nAdd a new book to the database with the current user:\n\n```python\nbook = Book(\n    title='Quincas Borba', \n    author='Machado de Assis', \n    genre='História', \n    summary='Clássico Brasileiro', \n    user=user\n)\ndb.session.add(book)\ndb.session.commit()\n```\n\nCreate a review for the book:\n\n```python\nreview = Analysis(\n    rating='Muito bom!', \n    review='Um livro altamente incrível', \n    book_id=book.id, \n    user=user\n)\ndb.session.add(review)\ndb.session.commit()\n```\n\nHave a good read!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-akira%2Fflask-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-akira%2Fflask-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-akira%2Fflask-library/lists"}