{"id":28974844,"url":"https://github.com/plcoster/fcc_qa_project3","last_synced_at":"2026-05-19T14:35:16.976Z","repository":{"id":299016096,"uuid":"533879676","full_name":"PLCoster/fcc_qa_project3","owner":"PLCoster","description":"FreeCodeCamp Quality Assurance Project 3: Personal Library","archived":false,"fork":false,"pushed_at":"2022-09-08T06:49:10.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T06:32:58.237Z","etag":null,"topics":["express","mocha-chai"],"latest_commit_sha":null,"homepage":"https://fcc-qa-project3.plcoster.repl.co/","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/PLCoster.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}},"created_at":"2022-09-07T17:57:00.000Z","updated_at":"2022-09-07T18:02:23.000Z","dependencies_parsed_at":"2025-06-14T06:33:01.491Z","dependency_job_id":"c0feb8f0-1be2-45ac-a64c-ee8d4736f132","html_url":"https://github.com/PLCoster/fcc_qa_project3","commit_stats":null,"previous_names":["plcoster/fcc_qa_project3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PLCoster/fcc_qa_project3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLCoster","download_url":"https://codeload.github.com/PLCoster/fcc_qa_project3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261669008,"owners_count":23192362,"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":["express","mocha-chai"],"created_at":"2025-06-24T12:07:08.708Z","updated_at":"2026-05-19T14:35:16.936Z","avatar_url":"https://github.com/PLCoster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Code Camp: Quality Assurance Project 3 - Personal Library\n\n## Personal Library\n\nThe aim of this project was to build a small web app with functionality similar to: https://personal-library.freecodecamp.rocks\n\n- **HTML**\n- **JavaScript** with **[Node.js](https://nodejs.org/en/) / [NPM](https://www.npmjs.com/)** for package management.\n- **[Express](https://expressjs.com/)** web framework to build the web API.\n- **[mongodb](https://www.npmjs.com/package/mongodb)** for interacting with a **[MongoDB Atlas](https://www.mongodb.com/atlas/database)** database.\n- **[Bootstrap](https://getbootstrap.com/)** for styling with some custom **CSS**.\n- **[FontAwesome](https://fontawesome.com/)** for icons.\n- **[Mocha](https://mochajs.org/)** test framework with **[Chai](https://www.chaijs.com/)** assertions for testing.\n- **[nodemon](https://nodemon.io/)** for automatic restarting of server during development.\n\n### Project Requirements:\n\n- **User Story #1:** You can send a `POST` request to `/api/books` with `title` as part of the form data to add a book. The returned response will be an object with the `title` and a unique `_id` as keys. If `title` is not included in the request, the returned response should be the string `missing required field title`.\n\n- **User Story #2:** You can send a `GET` request to `/api/books` and receive a JSON response representing all the books. The JSON response will be an array of objects with each object (book) containing `title`, `_id`, and `commentcount` properties.\n\n- **User Story #3:** You can send a `GET` request to `/api/books/{_id}` to retrieve a single object of a book containing the properties `title`, `_id`, and a `comments` array (empty array if no comments present). If no book is found, return the string `no book exists`.\n\n- **User Story #4:** You can send a `POST` request containing `comment` as the form body data to `/api/books/{_id}` to add a comment to a book. The returned response will be the books object similar to `GET /api/books/{_id}` request in an earlier test. If `comment` is not included in the request, return the string `missing required field comment`. If no book is found, return the string `no book exists`.\n\n- **User Story #5:** You can send a `DELETE` request to `/api/books/{_id}` to delete a book from the collection. The returned response will be the string `delete successful` if successful. If no book is found, return the string `no book exists`.\n\n- **User Story #6:** You can send a `DELETE` request to `/api/books` to delete all books in the database. The returned response will be the string `complete delete successful` if successful.\n\n- **User Story #7:** 11 Functional Tests covering all routes and methods with valid and invalid input are complete and passing:\n\n  - Create a Book with a valid title: `POST /api/books`\n  - Create a Book with no title given: `POST /api/books`\n  - Get all Books: `GET /api/books`\n  - Get a single Book's details with valid id: `GET /api/books/:id`\n  - Get a single Book's details with invalid id: `GET /api/books/:id`\n  - Add a Comment to a Book with valid id and comment: `POST /api/books/:id`\n  - Add a Comment to a Book with valid id and no comment: `POST /api/books/:id`\n  - Add a Comment to a Book with invalid id: `POST /api/books/:id`\n  - Delete a Book with valid id: `DELETE /api/books/:id`\n  - Delete a Book with invalid id: `DELETE /api/books/:id`\n  - Delete all Books: `DELETE /api/books/:id`\n\n### Project Writeup:\n\nThe third Free Code Camp: Quality Assurance Project is a simple Personal Library App and API. Users can:\n\n- Add Books to the Library by submitting the relevant form on the API / UI view, or by sending a POST request to `/api/books` with a body containing a url encoded `title` field - the title of the book.\n\n- Add Comments to a Book by submitting the relevant form on the API / UI view, or by sending a POST request to `/api/books/\u003cBOOK _id\u003e`, with a body containing a url encoded field of 'comment' - the comment for the book.\n\n- View all Books in the library by using the UI view or sending a GET request to `/api/books`.\n\n- View a single Book's details (title, \\_id and comments) using the UI view or by sending a GET request to `/api/books/\u003cBOOK _id\u003e`.\n\n- Delete a Book using the UI view or by sending a DELETE request to `/api/books/\u003cBOOK _id\u003e`.\n\n- Delete all Books using the UI view or by sending a DELETE request to `/api/books`.\n\nA test suite has been written for the app:\n\n- `tests/2_functional-tests.js` contains functional tests of the application routes (GET, POST and DELETE requests to `/api/books/:book_id?`).\n\n### Project Files:\n\n- `server.js` - the main entry point of the application, an express web server handling the routes defined in the specification.\n\n- `/routes/api.js` - contains the major API routes for the express web app.\n\n- `/controllers` - contains the `bookController.js` and `commentController.js` middleware, with methods to carry out the Create, Read and Delete operations on Books / Comments as requested.\n\n- `public/` - contains static files for the web app (stylesheet, logo, favicons etc), served by express using `express.static()`.\n\n  - `client.js` contains `jQuery` scripts for handling updates to the UI view of the app, and is loaded by `index.html`.\n\n- `views/` - contains the single html page for the web app, `index.html`, which is served by express on `GET` requests to `/\n\n- `tests/` - contains the test suite for the application.\n\n### Usage:\n\nRequires Node.js / NPM in order to install required packages. After downloading the repo, install required dependencies with:\n\n`npm install`\n\nTo run the app locally, a valid MongoDB database URI and a database name are required to be entered as environmental variables (`MONGO_URI`, `DB_NAME`), which can be done via a `.env` file (see sample.env). One possible MongoDB service is **[MongoDB Atlas](https://www.mongodb.com/atlas/database)**.\n\nA development mode (with auto server restart on file save), can be started with:\n\n`npm run dev`\n\nThe application can then be viewed at `http://localhost:3000/` in the browser.\n\nTo start the server without auto-restart on file save:\n\n`npm start`\n\n# Personal Library BoilerPlate\n\nThe initial boilerplate for this app can be found at https://github.com/freeCodeCamp/boilerplate-project-library\n\nInstructions for building the project can be found at https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/personal-library\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_qa_project3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplcoster%2Ffcc_qa_project3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_qa_project3/lists"}