{"id":15392476,"url":"https://github.com/duanedave/cms_api","last_synced_at":"2026-06-05T21:31:14.073Z","repository":{"id":210720251,"uuid":"727287571","full_name":"DuaneDave/CMS_API","owner":"DuaneDave","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-07T14:54:31.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T06:44:40.537Z","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/DuaneDave.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":"2023-12-04T15:06:40.000Z","updated_at":"2023-12-04T15:53:26.000Z","dependencies_parsed_at":"2024-10-19T00:12:48.143Z","dependency_job_id":"ba371a17-9ad0-439c-b263-6df28672b3dc","html_url":"https://github.com/DuaneDave/CMS_API","commit_stats":{"total_commits":88,"total_committers":1,"mean_commits":88.0,"dds":0.0,"last_synced_commit":"50e62d35812570efd00eaceb908f8a1c281207c9"},"previous_names":["duanedave/cms_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuaneDave%2FCMS_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuaneDave%2FCMS_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuaneDave%2FCMS_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuaneDave%2FCMS_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DuaneDave","download_url":"https://codeload.github.com/DuaneDave/CMS_API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241152513,"owners_count":19918631,"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-01T15:14:56.490Z","updated_at":"2026-06-05T21:31:13.783Z","avatar_url":"https://github.com/DuaneDave.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📖 CMS_API \u003ca name=\"about-project\"\u003e\u003c/a\u003e\n\n**CMS_API** is a solution to the take home assignment given and a solution to the problem was done using popular design pattern in the industry such as MVC and the well known Repository design pattern.\n\n## 🛠 Built With \u003ca name=\"built-with\"\u003e\u003c/a\u003e\n\n### Tech Stack \u003ca name=\"tech-stack\"\u003e\u003c/a\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eServer\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003eNode Js\u003c/li\u003e\n    \u003cli\u003eExpress\u003c/li\u003e\n    \u003cli\u003eSocket.io\u003c/li\u003e\n    \u003cli\u003eJWT\u003c/li\u003e\n    \u003cli\u003eGoogle OAuth\u003c/li\u003e\n    \u003cli\u003eetc..\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDatabase\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003eMongo DB\u003c/li\u003e\n    \u003cli\u003eMongoose ODM\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003c!-- Features --\u003e\n\n### Key Features \u003ca name=\"key-features\"\u003e\u003c/a\u003e\n\n- **Authentication strategy using JWT and Google OAuth**\n- **Real-time activities feed on the admin route**\n- **CRUD operation on the post route**\n- **CRUD operations on the category route**\n- **CRUD operations on the user**\n- **Database relationship**\n- **Proper error handling of all requests**\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## API-Documentation \u003ca name=\"api-documentation\"\u003e\u003c/a\u003e\n\n- [Link To Documentation](https://documenter.getpostman.com/view/24263371/2s9YkgBjfH)\n\n\n## 💻 Getting Started \u003ca name=\"getting-started\"\u003e\u003c/a\u003e\n\nTo get a local copy up and running, follow these steps.\n\n### Prerequisites\n\nIn order to run this project you need:\n\n- [Node.js](https://nodejs.dev/en/) installed\n- VsCode or any other code editor installed\n- Postman or any other API testing tool installed\n\n### Setup\n\nClone this repository to your desired folder:\n\n```sh\n  cd my-folder\n  git clone https://github.com/DuaneDave/CMS_API.git\n```\n\n```sh\n  create a .env file in the root directory and add the following variables\n\n  PORT = 8080\n  NODE_ENV = DEVELOPMENT\n  DB_URI = your mongo db URI\n\n\n  JWT_EXPIRES_TIME = 3d\n  JWT_SECRET = bdjbbiugiuwehohfibifhhwioufgwftu\n  COOKIE_EXPIRES_TIME = 3\n  RESET_PASSWORD_EXPIRES_TIME = 10\n\n  MAIL_USERNAME = your gmail address\n  MAIL_PASSWORD = your gmail password\n  OAUTH_CLIENTID = your google oauth client id\n  OAUTH_CLIENT_SECRET = your google oauth client secret\n  OAUTH_REFRESH_TOKEN = your google oauth refresh token\n  OAUTH_FROM_EMAIL = noreply@afrobean.com\n  OAUTH_FROM_NAME = CMS_API\n```\n\n### Install\n\nInstall this project with:\n\n```sh\n  cd CMS_API\n\n  npm install\n```\n\n### Usage\n\nTo run the project, execute the following command:\n\n```sh\n  npm run dev to run the project in development mode\n  npm run prod to run the project in production mode\n```\n\n### Run checks on the activiy feed\n\n\u003cp\u003e\nYou can utilize postman for hooking up with the socket at the backend. To do this, you need to send a post request to the following route\n\u003c/p\u003e\n\n```sh\n  http://localhost:8080/api/v1/admin\n```\n\n\u003cp\u003e\nOnce the connection is successful, you can hook up on the following events\n\u003c/p\u003e\n\n```sh\n  postDeleted\n  postCreated\n  postUpdated\n  categoryCreated\n  categoryUpdated\n  categoryDeleted\n  userCreated\n  userUpdated\n```\n\n## ❓ FAQ (OPTIONAL) \u003ca name=\"faq\"\u003e\u003c/a\u003e\n\n- **Why did you use repository design pattern?**\n\n  \u003cp\u003e Repository Pattern introduces an additional layer of abstraction, the benefits it provides in terms of maintainability, testability, and adaptability often outweigh the overhead. It's especially beneficial in larger applications where clear separation of concerns becomes crucial for long-term maintainability.\n  Reasons includes:\n  \u003c/p\u003e\n\n  \u003cul\u003e\n      \u003cli\u003eSeparation of Concerns: \n      - Following design patterns like the Repository Pattern aligns with best practices for structuring maintainable and scalable software. It makes your codebase more readable and easier for other developers to understand.\n    \u003c/li\u003e\n      \u003cli\u003eTestability: \n      - The Repository Pattern makes it easier to mock dependencies for testing. This is especially useful in unit testing, where you want to isolate the system under test from its dependencies.\n    \u003c/li\u003e\n      \u003cli\u003eAdaptability: \n      - The Repository Pattern makes it easier to swap out data sources. For example, you can easily replace a repository that fetches data from a remote server with one that uses a local database instead. This is especially useful when you want to write tests that don't touch the network or a database.\n    \u003c/li\u003e\n      \u003cli\u003eMaintainability: \n      - The Repository Pattern makes it easier to maintain your codebase. For example, if you want to change the way you fetch data from a remote server, you only need to change the implementation of the repository. The rest of your codebase can remain the same.\n    \u003c/li\u003e\n  \u003c/ul\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduanedave%2Fcms_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduanedave%2Fcms_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduanedave%2Fcms_api/lists"}