{"id":17677697,"url":"https://github.com/tyh71/bed-ca2","last_synced_at":"2025-03-30T17:46:03.719Z","repository":{"id":133826018,"uuid":"359068456","full_name":"TYH71/BED-CA2","owner":"TYH71","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-18T09:38:02.000Z","size":29767,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T20:03:39.715Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/TYH71.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":"2021-04-18T06:55:26.000Z","updated_at":"2021-04-18T09:38:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"b272ca68-d60d-4522-871d-641f5f53581a","html_url":"https://github.com/TYH71/BED-CA2","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/TYH71%2FBED-CA2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYH71%2FBED-CA2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYH71%2FBED-CA2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TYH71%2FBED-CA2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TYH71","download_url":"https://codeload.github.com/TYH71/BED-CA2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246358141,"owners_count":20764364,"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":[],"created_at":"2024-10-24T07:29:20.343Z","updated_at":"2025-03-30T17:46:03.571Z","avatar_url":"https://github.com/TYH71.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n## Repository\n\n- client\n    - contains files for the Front-End (etc. HTML, CSS, JS)\n    - public - contains static files which will be served in the browser\n- server\n    - contains files for the Backend (etc. app.js, databaseConfig.js, .env.development)\n    - model, controller, db (MVC structure)\n- stockimages\n    - contains stock images to demostrate image uploading process\n- Assignment Brief\n- README.md\n    - text file to provide instructions\n\n## Instructions\n\n1. Run the provided sql dump file in mySQL workbench\n2. go to /server/.env.development and adjust the configurations (DB_HOST, DB_USER, DB_PASSWORD) accordingly.\n3. Open two terminal, Terminal 1 change the directory to /client, Terminal 2 change the directory to /server\n4. type this command in both terminal ‘npm run start-dev’, ensure that there is the terminal shows ‘localhost:3000’ (server) and ‘localhost:3001’ (client)\n5. Open browser and enter ‘localhost:3001’, browse through the pages accordingly\n- * brcrypt is used to hash the password, I will give the relevant admin information, the rest of the user's password are stored in the seperate table, mysql assignment2.hash_password\n\nusername: TYH\n\npassword: password\n\n## HTML Pages\n\n- index.js - landing page\n- login.html - Login page to logged into the respective users\n- signup.html - page to create a customer (non-admin) user\n- games.html - page to show game listing and a search box\n- game.html - page which shows the relevant game details, all reviews made, and a section to submit a review for the page\n- admin.html - can only be assessed by an admin user, page to create categories and create games\n\n## Requirements done\n\n- Front-End for web application - open source templates was download from the internet and edited to better suit this assignment\n- Persistent Login - done in login.html. After logging in, the page will defer to the previous page it was located at, the log in button is toggled to log out\n- Search Game by title, platform and price - done in games.html. is able to search games independently by each variables. title is searched using RegEx (regular expression) so feel free to use any subset of the game title (eg. 'mine' ⇒ 'minecraft')\n- view game detail - found in game.html. clicking read more on the game card (in games.html) will change page to view game details. (game information) Also shows the reviews\n- add new reviews - found in game.html. client checks for presense of token to allow this prompt. submit reviews cause page to refresh and show the updated list of reviews. user authentication by jwt is checked when submitting reviews (middleware)\n- add new game - found in admin.html. submit a new game, check for admin rights using JWT. (middleware) every variable is required except for image upload. submitting then sends to the game details page. (game.html)\n- add new category - found in admin.html. submit a new category, check for JWT for admin rights (middleware). page refresh after submitting. 422 error will be displayed for duplicate entry\n- JWT checking - JWT is check for user/admin authentication for add reviews, add games, and add categories. refreshing/loading a page will automatically checks the token for admin priviledges and adjust accordingly (endpoint). payload contains userid and type\n\n## Bonus Requirements\n\n- sign up page - signup.html. pretty standard, creates a customer (non-admin) user. prompts for username, email, and password\n- image uploading during creating games - uploads image to backend then store the image in /client/public/gameimg (serve-static directory), image is optional when creating a game\n- search box did five variables (title, platform, categories, years, price) instead of three. more filters, more sophisticated\n- bcrypt is used to hash the user’s passwords as a form of encryption. hash password is stored in user table, raw password is stored in a seperate table, assignment2.hash_password\n- edit users admin priviledges in admin page. can edit users between customer or admin. cannot edit current logged in user permissions","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyh71%2Fbed-ca2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyh71%2Fbed-ca2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyh71%2Fbed-ca2/lists"}