{"id":27192401,"url":"https://github.com/sameh-farouk/cs50wep-p1","last_synced_at":"2026-05-04T08:42:03.863Z","repository":{"id":127939504,"uuid":"166490134","full_name":"sameh-farouk/CS50wep-p1","owner":"sameh-farouk","description":"This is Goobook, a Web application and RESTful web service using Python/Flask and PostgreSQL.","archived":false,"fork":false,"pushed_at":"2020-09-16T17:42:58.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-22T14:08:49.891Z","etag":null,"topics":["api-rest","flask","postgresql","python3","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sameh-farouk.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":"2019-01-19T00:37:52.000Z","updated_at":"2020-09-16T17:46:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"05d6719a-8481-4a18-bc61-25455b1cb960","html_url":"https://github.com/sameh-farouk/CS50wep-p1","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sameh-farouk/CS50wep-p1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2FCS50wep-p1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2FCS50wep-p1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2FCS50wep-p1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2FCS50wep-p1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sameh-farouk","download_url":"https://codeload.github.com/sameh-farouk/CS50wep-p1/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2FCS50wep-p1/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261304267,"owners_count":23138301,"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":["api-rest","flask","postgresql","python3","sqlalchemy"],"created_at":"2025-04-09T18:44:42.614Z","updated_at":"2025-10-09T15:39:55.271Z","avatar_url":"https://github.com/sameh-farouk.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GooBook\n## a Web application and RESTful web service using Python/Flask\n\n### Technologies Used:\n- Python3\n- Flask\n- Sqlalchmey\n- JSON\n- Bootstrap\n- Git\n- SQL\n- PostgreSQL\n- azure app service\n\nthis is my Goobook web app and restful web service , a built from scratch project for the second assignment in the CS50w Course.\n\ndemo at: http://goobook.azurewebsites.net/  but my azure app service free plan will expire on 2/18/2019\n\nThe app name Goobook was inspired from the famouse search engine google.\n\nWhen you sign up, will be able to search for books by isbn , title or author name, leave reviews for individual books, and see the reviews made by other people, as checking rating and reviews statistics coming from a third-party API by Goodreads.\n\nThe app it self has it's own API that users and developers can query for book details and book reviews programmatically . i wrote a page where you can read about it's usage.\n\n### big notes:\nDATABASE_URL variable need to be in the environment with valid database URI. also goodreads api need to fill in config file (development.py or production.py)\n\n### notes :\n#### Registration :\n  - username : i decided to let signup/login use (email address as a user name). people tend to forget the username more than they would forget thier email address.\n  - password : also password should be at least 8 or char, and have at least one capital letter , on small letter and a one digit. this done in front end using html5 pattren tag and regex. To DO: adding back-end validition.\n#### login:\nat login we i decided to record the time user loged in in last seen column in users table, so maybe it help later to check for unactive users.\n#### import:\ni was confused about if this program should create the actual db from scratch or just import the csv into it. i decided to make the import program only able to impprt the csv if the db was init with the correct tables, else it will tell to run db_init program. (another program i wrote to create the actual tables from schema.sql file.)\n\nin the import program i made it posible two import the csv file into the db using one of two methods. one using postgresql native import (copy command), and one using isert statment. the native import is the defult when you run the import program . it take only seconds. type `import.py -h` for info.\n\n#### Search:\ni made some addition to the basic requirements, included pagination in search results.\n\nhow pagination had been implemented? using sql LIMIT and OFFSET in the back-end with a help of dynamic url for next and prev page made using jinja.\n#### Book Page:\nalso in book page, i added a book cover img using cover third-party API by openlibrary.org. it was easy to add using jinja template alone.\n\nhttps://openlibrary.org/dev/docs/api/covers\n\n#### Review Submission:\nreview submission form was made using Bootstrap's JavaScript modal plugin. as login and signup forms. to improve the UX.\n#### Goodreads Review Data:\nstatistics data from goodreads was included in the book page with a ref note to goodreads website.\n#### API Access:\nincluded as project requirements. nothing less, nothing more..\n   \nBeyond assignment(project) requirements, i added few dditional views.\n- MyBooks Page: users will be taken to a page where they can see all the reviews they submited before with links to the reviewd books.\n- API Page: just a pge with the instruction required for using the app API.\n\noutside the main Application i made two additional programs:\n- db_init.py : this will read the schema.sql file and execute it to create the tables in the db. you can type `db_init.py -h` for more help about using this app as i packed it with extra functionlty to help me while i develop this app, for example `db_init.py -r` will drop the tables in the db and create all tables again, helps me when i decede to change some columns in the db and want to start over.\n- run.py : this will activte the app virual env located in app folder/venv , and lunch the flask app in host:0.0.0.0\n\n\n### special note:\nsqlalchmey db engine and the db scoped session come from db_helper.py module.\n\nbasicly the application.py , the import.py program and db_init.py program use the engine and session from db_helper module by importing it.\n\n### summary:\n\n    applicatio FOLDER\n        db_init.py      program to create the db tables from schema.sql file.\n                        see: db_init.py -h\n        import.py       program to import the books.csv into PostgreSQL database.\n                        see: import.py -h\n        db_helper.py    module conatins database access layer\n        db_functions.py module contains functions deal with the database\n        application.py  the web application\n        run.py          just shortcut to activate the app virtual env and run app\n        schema.sql      sql file contains db schema (users, books, reviews)\n        books.csv       \n        requirements.txt\n        README.md       this file\n        venv FOLDER     i didn't submit it, this contain virtual env for this app\n        templates FOLDER  my jinja templates.\n            api.html    child template : a page descripe the app API usage.\n            base.html   the base template. contains header, footer, nav, Bs scripts\n            details.html child template : a pgae display the book details.\n            index.html  child template : the home page.\n            mybooks.html child template : a pgae to show the user his own reviews.\n            results.html child template : display the search results.\n        static FOLDER    contain css file , some left empty, for later.\n            api.css\n            cover.css\n            details.css\n            mybooks.css\n            results.css\n        instance FOLDER\n            config.py    should contain any secret config\n        config FOLDER    this is a package contain spicific env config fils\n            development.py  settings you want to apply when in development env\n            production.py   settings you wnat to apply when in production env\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameh-farouk%2Fcs50wep-p1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsameh-farouk%2Fcs50wep-p1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameh-farouk%2Fcs50wep-p1/lists"}