{"id":23790113,"url":"https://github.com/gtcore902/p7-backend-nodejs-vieux-grimoire","last_synced_at":"2026-05-04T09:32:33.456Z","repository":{"id":225106511,"uuid":"765071169","full_name":"gtcore902/P7-backend-nodejs-vieux-grimoire","owner":"gtcore902","description":"The goal is to create the backend part of a book consultation website.","archived":false,"fork":false,"pushed_at":"2026-01-19T20:00:50.000Z","size":263,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-20T01:34:45.121Z","etag":null,"topics":["api-rest","bcrypt-nodejs","express-js","express-middleware","jsonwebtoken","node-js"],"latest_commit_sha":null,"homepage":"","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/gtcore902.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-29T08:21:54.000Z","updated_at":"2026-01-19T19:59:41.000Z","dependencies_parsed_at":"2024-03-04T12:28:02.041Z","dependency_job_id":"d8fca9d5-4270-475b-9329-d8469b344a1a","html_url":"https://github.com/gtcore902/P7-backend-nodejs-vieux-grimoire","commit_stats":null,"previous_names":["gtcore902/p7-backend-nodejs-vieux-grimoire"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gtcore902/P7-backend-nodejs-vieux-grimoire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtcore902%2FP7-backend-nodejs-vieux-grimoire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtcore902%2FP7-backend-nodejs-vieux-grimoire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtcore902%2FP7-backend-nodejs-vieux-grimoire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtcore902%2FP7-backend-nodejs-vieux-grimoire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtcore902","download_url":"https://codeload.github.com/gtcore902/P7-backend-nodejs-vieux-grimoire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtcore902%2FP7-backend-nodejs-vieux-grimoire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32601527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["api-rest","bcrypt-nodejs","express-js","express-middleware","jsonwebtoken","node-js"],"created_at":"2025-01-01T17:18:34.130Z","updated_at":"2026-05-04T09:32:33.439Z","avatar_url":"https://github.com/gtcore902.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# P7-backend-nodejs-vieux-grimoire\n\n## OpenClassrooms Web Developer Path Project\n\nThis project is part of the [OpenClassrooms](https://www.openclassrooms.com/) Web Developer Path.\n\n## :checkered_flag:Objective\n\nThe goal is to create the backend part of a book consultation website :books:.\n\n## :computer:Technologies Used\n\n- [Node.js](https://nodejs.org/en/)\n- [Express](https://expressjs.com/)\n- [JsonWebTokens](https://jwt.io/)\n- [Bcrypt](https://www.bcrypt.fr/)\n\n## :smiley:Functional Specifications\n\n### Context\n\nThe \"Au Vieux Grimoire\" libraries have numerous passionate customers. The objective of the \"Mon Vieux Grimoire\" site is to allow readers to create books, rate them, and consult existing books along with their ratings.\n\n### General Architecture\n\nThe web application will consist of 4 pages:\n\n- A page to allow user registration/login;\n- A homepage displaying books already added by users (visible whether logged in or not);\n- A \"book\" page displaying all information about a proposed book (visible whether logged in or not);\n- A page allowing users to add new books to the platform (visible only to logged-in users).\n\n### Additional Information\n\n#### Connection/Registration Page\n\nThis page is quite simple; it must contain:\n\n- Two input fields: an \"email\" field and a \"password\" field;\n- Two buttons: a \"registration\" button and a \"login\" button.\n\nThis page contains nothing else, not even the header or footer.\n\n#### Header\n\nIn the header, we should find the company logo and a menu.\nThis menu should present the following links:\n\n- \"Home\": directs to the homepage;\n- \"Create a Book\": directs to the book creation page;\n- \"Logout\": this should allow the user to log out from the platform, before being redirected to the connection/registration page.\n\nWe will find the header on all pages, except the connection/registration page.\n\n#### Footer\n\nIn the footer, we should find the address, phone number, a visual of a map, and the copyright.\nWe will find the footer on all pages, except the connection/registration page.\n\n#### :house:Homepage\n\nThe homepage should present the list of all books added by users. This page is visible to all visitors, whether they are logged in or not.\nFor each book, the image and title should appear.\nIn the first version of the platform, there will be no pagination.\n\n#### :books:Book Page\n\nIn this page, we will find all the information related to a book, i.e., image, title, author, year, genre, and average rating.\nThe average rating is a 5-star evaluation.\nA user should be able to provide a rating, between 0 and 5 stars.\nSpecial Case: If the user viewing a book is the creator of that book on the platform, this user will have 2 additional buttons available, one button to delete the book, and another to edit it.\n\n#### :pencil:Book Creation Page\n\nIn this page, users will have the possibility to create a book by providing all the necessary information, i.e., image (upload field for an image), title, author, year, and genre.\nA validation/creation button will confirm the creation of the book once all the information is entered.\n\n## :wrench:API Technical Specifications\n\nThis table details the requirements of the API required for the proper functioning of the frontend.\n\n### API Specification\n\n| Endpoint                  | Authentication | Request Body (if applicable)        | Expected Response                 | Function                                                                                                                                    |\n| ------------------------- | -------------- | ----------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| POST /api/auth/signup     | Not required   | { email: string, password: string } | { message: string }               | Hashes the user's password, adds the user to the database.                                                                                  |\n| POST /api/auth/login      | Not required   | { email: string, password: string } | { userId: string, token: string } | Verifies user's login credentials; returns the user's \\_id from the database and a signed JSON web token (also containing the user's \\_id). |\n| GET /api/books            | Not required   | -                                   | Array of books                    | Returns an array of all books from the database.                                                                                            |\n| GET /api/books/:id        | Not required   | -                                   | Single book                       | Returns the book with the provided \\_id.                                                                                                    |\n| GET /api/books/bestrating | Not required   | -                                   | Array of books                    | Returns an array of the top 3 books from the database with the highest average rating.                                                      |\n| POST /api/books           | Required       | { book: string, image: file }       | { message: string }               | Captures and saves the image, processes the book turned into a string, and saves it in the database setting its ImageUrl correctly.         |\n\n### Installation and Running\n\nRead the instructions for launching and installing [the frontend code](https://github.com/OpenClassrooms-Student-Center/P7-Dev-Web-livres).\n\nThe frontend runs on port 3000.\n\nThen:\n\n```\nnpm install\nnpm start\n```\n\nThe backend runs on port 4000.\n\n## Contributing :\n\n_No contribution needed but you can use this repository._\n\n_[How to use Git?](https://docs.github.com/fr/get-started/using-git/about-git)_\n\n## Contact :\n\n[![github](https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/gtcore902)\n[![linkedin](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://linkedin.com/in/ga%C3%ABtan-tremois-a956a91a3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtcore902%2Fp7-backend-nodejs-vieux-grimoire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtcore902%2Fp7-backend-nodejs-vieux-grimoire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtcore902%2Fp7-backend-nodejs-vieux-grimoire/lists"}