{"id":15704853,"url":"https://github.com/tsherburne/udacity-fsdev-logs","last_synced_at":"2025-07-23T20:03:10.063Z","repository":{"id":120563482,"uuid":"117292078","full_name":"tsherburne/udacity-fsdev-logs","owner":"tsherburne","description":"Udacity Full Stack Developer SQL Logs Analysis Project","archived":false,"fork":false,"pushed_at":"2018-01-13T15:34:12.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T15:31:35.445Z","etag":null,"topics":["udacity-fullstack-nanodegree"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tsherburne.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":"2018-01-12T22:01:58.000Z","updated_at":"2018-01-12T22:10:05.000Z","dependencies_parsed_at":"2023-04-08T23:16:28.067Z","dependency_job_id":null,"html_url":"https://github.com/tsherburne/udacity-fsdev-logs","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"44d5bacbd0cff65e3a173b8527bb92ca97dc61fc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsherburne/udacity-fsdev-logs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsherburne%2Fudacity-fsdev-logs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsherburne%2Fudacity-fsdev-logs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsherburne%2Fudacity-fsdev-logs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsherburne%2Fudacity-fsdev-logs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsherburne","download_url":"https://codeload.github.com/tsherburne/udacity-fsdev-logs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsherburne%2Fudacity-fsdev-logs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266738657,"owners_count":23976439,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["udacity-fullstack-nanodegree"],"created_at":"2024-10-03T20:14:05.874Z","updated_at":"2025-07-23T20:03:10.037Z","avatar_url":"https://github.com/tsherburne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## SQL Logs Analysis Project\nThis respository is for project #3 (Logs Analysis) \nfor the [Udacity Fullstack Developers Nano Degree](https://www.udacity.com/course/full-stack-web-developer-nanodegree--nd004).\n### Table of Contents\n\n* [Installation](#installation)\n    * [Setup AWS Cloud 9 - If used instead of Vagrant](#setup-aws-c9)\n    * [Project Setup](#project-setup)\n* [Database Overview](#database-overview)\n* [Running](#running)\n\n### Installation\n\n#### Setup AWS C9\nEnvironment Setup (Postgres on Amazon Clound 9 Instance):\n\nSee reference: https://gist.github.com/dstroot/2920991\n\n```\n# Install Postgres\nsudo yum -y install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs\nsudo service postgresql initdb\n\n# Setup initial 'postgres' user password\n\nsudo -u postgres psql postgres\npostgres=# \\password postgres\n\n#You'll see:\n#Enter new password:\n#Enter it again:\n\n# Use MD5 Authentication\nsudo sed -i.bak -e 's/ident$/md5/' -e 's/peer$/md5/' /var/lib/pgsql9/data/pg_hba.conf\n\n#Start\nsudo /sbin/chkconfig --levels 235 postgresql on\nsudo service postgresql start\n\n#Login as 'postgres' user using password setup above\npsql -U postgres\n\n```\nInstall Python Libraries\n\n```\nsudo yum install flask\nsudo pip install psycopg2\nsudo pip install Bleach\n\n```\n\nCreate database\n```\npsql -U postgres\npostgres=# create database news;\npostgres=# grant all privileges on database news to postgres;\npostgres=# \\list\n```\nConnect to Database and List Tables\n```\npostgres=# \\connect news\nnews=# \\dt\n\n```\n\nLoad the Database\n```\npsql -U postgres -d news -f newsdata.sql\n```\n#### Project Setup\nCreate Database Views\n```\ncreate view daily_errors as select date_trunc('day', time) as date, count(*) as total from log where status = '404 NOT FOUND' group by date;\ncreate view daily_logs as select date_trunc('day', time) as date, count(*) as total from log group by date;                    \n```\n\nClone the respository:\n\n```\ngit clone https://github.com/tsherburne/udacity-fsdev-logs.git\ncd udacity-fsdev-logs\n```\n\nIf needed, change the database connection string in `report.py`\n\n```\ndb = psycopg2.connect(database=\"news\", user=\"postgres\", password=\"postgres1234\")\n```\n### Database Overview\nThe schema for the reports database is shown here:\n![Image](class-diagram.png)\n\n### Running\nRun the Report:\n```\npython report.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsherburne%2Fudacity-fsdev-logs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsherburne%2Fudacity-fsdev-logs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsherburne%2Fudacity-fsdev-logs/lists"}