{"id":18863582,"url":"https://github.com/beto-ouverney/blogs-api-node-js","last_synced_at":"2026-04-09T23:51:37.483Z","repository":{"id":54914827,"uuid":"522741027","full_name":"beto-ouverney/blogs-api-node-js","owner":"beto-ouverney","description":"Blogs API NODE.JS with DOCKER, SEQUELIZE, MYSQL, JWT, SOLID and MSC Architecture","archived":false,"fork":false,"pushed_at":"2022-08-09T01:19:02.000Z","size":253,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T11:46:26.063Z","etag":null,"topics":["express","jwt","msc","mysql","node","nodejs","sequelize","solid-principles"],"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/beto-ouverney.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}},"created_at":"2022-08-08T23:46:10.000Z","updated_at":"2022-08-10T22:44:56.000Z","dependencies_parsed_at":"2022-08-14T06:31:00.855Z","dependency_job_id":null,"html_url":"https://github.com/beto-ouverney/blogs-api-node-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beto-ouverney/blogs-api-node-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beto-ouverney%2Fblogs-api-node-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beto-ouverney%2Fblogs-api-node-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beto-ouverney%2Fblogs-api-node-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beto-ouverney%2Fblogs-api-node-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beto-ouverney","download_url":"https://codeload.github.com/beto-ouverney/blogs-api-node-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beto-ouverney%2Fblogs-api-node-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266691580,"owners_count":23969182,"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":["express","jwt","msc","mysql","node","nodejs","sequelize","solid-principles"],"created_at":"2024-11-08T04:37:56.597Z","updated_at":"2026-04-09T23:51:32.441Z","avatar_url":"https://github.com/beto-ouverney.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blogs API NODE.JS with DOCKER, SEQUELIZE, MYSQL, JWT, SOLID and MSC Architecture #\n\nDevelopment of an API and DATABASE for a blog using JWT for security\n\n# Other Versions of this project with other languages #\n\n[Blogs API GO LANG with DOCKER, MYSQL, JWT, SOLID and Clean Architecture Version](https://github.com/beto-ouverney/blogs-api-golang)\n\n## Table of contents\n\n- [General view](#general-view)\n  - [The Challenge](#the-challenge)\n- [The development process](#the-development-process)\n  - [Tools used](#tools-used)\n  - [Lessons learned](#lessons-learned)\n- [Usage](#usage)\n- [Author](#author)\n\n## General view\n\n### The challenge\n\nBlogs API NODE.JS with DOCKER, SEQUELIZE ORM, MYSQL, JWT, SOLID and MSC Architecture\n\n**The users must be capable of**\n\n- endpoint POST /login \n  -\u003e The request return status 200 and a token if login is success\n  -\u003e The body of the request should follow the format below:\n  \n   ```json\n   {\n     \"email\": \"beto.ouverney@email.com\",\n     \"password\": \"123456\"\n   }\n   ```\n -\u003e The validation rules are:\n\n    the email field is mandatory;\n    the email field must have a valid email address;\n    the password field is mandatory;\n    the password field must be at least 6 characters long.\n\n- endpoint POST /user\n  -\u003e The request return status 200 and a token if user was created with success\n  -\u003e The body of the request should follow the format below:\n  \n   ```json\n   {\n     \"displayName\": \"Carol\",\n     \"email\": \"carol@email.com\",\n     \"password\": \"123456\",\n     \"image\": \"http://4.bp.blogspot.com/_YA50adQ-7vQ/S1gfR_6ufpI/AAAAAAAAAAk/1ErJGgRWZDg/S45/brett.png\"\n   }\n   ```\n\n- endpoint GET /user\n  -\u003e The request return status 200 and all users in database\n  -\u003e The request header must be contains a valid token\n  \n- endpoint GET /user/:id\n  -\u003e Return a user according to id\n  -\u003e The request header must be contains a valid token\n  \n- endpoint POST /categories\n  -\u003e Add a category.\n  -\u003e The body of the request should follow the format below:\n  \n  ```json\n  {\n    \"name\": \"Go Lang\"\n  }\n  ```\n   -\u003e The validation rules are:\n\n    the name field is mandatory;\n    \n- endpoint GET /categories\n  -\u003e Return all categories.\n  -\u003e The request header must be contains a valid token\n  \n- endpoint POST /post\n  -\u003e Add a blog post\n  -\u003e The request header must be contains a valid token\n  -\u003e The body of the request should follow the format below:\n  \n  ```json\n  {\n    \"title\": \"Latest updates, August 1st\",\n    \"content\": \"The whole text for the blog post goes here in this key\",\n    \"categoryIds\": [1, 2]\n  }\n  ```\n  \n- endpoint GET /post\n  -\u003e Return all blogs post, user owner of it and database categories\n  -\u003e The request header must be contains a valid token\n  \n- endpoint GET /post/:id\n  -\u003e Return a blog post, user owner of it and database categories according to id\n  -\u003e The request header must be contains a valid token\n  \n- endpoint PUT /post/:id\n  -\u003e Update a blog post\n  -\u003e The request header must be contains a valid token\n  -\u003e The body of the request should follow the format below:\n  \n  ```json\n  {\n    \"title\": \"Latest updates, August 1st\",\n    \"content\": \"The whole text for the blog post goes here in this key\"\n  }\n  ```\n\n- endpoint DELETE /post/:id\n  -\u003e Delete a blog post\n  -\u003e The request header must be contains a valid token\n  -\u003e Only the blog post creator can delete it\n  \n- endpoint DELETE /user/me\n  -\u003e Delete you from the database, based on the id in your token\n  -\u003e The request header must be contains a valid token\n  \n- endpoint GET /post/search?q=:searchTerm\n  -\u003e Return an array of blog posts that contain in their title or content the term passed in the URL\n  -\u003e The request header must be contains a valid token\n  -\u003e The query params of the request should follow the format below:\n     \n     http://localhost:PORT/post/search?q=wow\n  \n  \n## The development process\n\n### Tools used\n\n#### Back-end\n\n- Node.Js\n\n### Lessons learned\n\nIn this project I could improve my knowledge in back-end, by:\n\n- Express\n- Using SOLID principles and MSC Architecture\n- Docker\n- Sequelize\n- Mysql\n- JWT\n\n## Usage\n\n- You will have access to various scripts, that will help you achieving what you want to do.\n  - Before you start, your docker-compose needs to be at version 1.29 or higher\n  - docker-compose up -d --build\n  \n- Then execute the command below to access the terminal of container:\n  - docker exec -it blogs_api bash \n\n- Install all dependencies\n  - npm install\n  \n## Author\n\n- LinkedIn - [Alberto Ouverney Paz](https://www.linkedin.com/in/beto-ouverney-paz/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeto-ouverney%2Fblogs-api-node-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeto-ouverney%2Fblogs-api-node-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeto-ouverney%2Fblogs-api-node-js/lists"}