{"id":25171529,"url":"https://github.com/basemax/cmsgraphqlts","last_synced_at":"2025-05-05T20:51:57.942Z","repository":{"id":180962753,"uuid":"655093005","full_name":"BaseMax/CMSGraphQLTS","owner":"BaseMax","description":"This is a GraphQL-based project developed in TypeScript. It aims to provide a full-featured Content Management System (CMS) with various functionalities including categories, posts, sliders, FAQs, contact us responses, authentication, and more.","archived":false,"fork":false,"pushed_at":"2025-04-11T19:29:15.000Z","size":268,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T21:45:34.522Z","etag":null,"topics":["cms","cms-graphql","graphql","graphql-cms","javascript","js","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-17T21:37:57.000Z","updated_at":"2025-04-11T19:29:14.000Z","dependencies_parsed_at":"2024-11-26T09:28:13.521Z","dependency_job_id":"a420e8d6-59c9-4339-a4a5-80cb8dd8bae6","html_url":"https://github.com/BaseMax/CMSGraphQLTS","commit_stats":null,"previous_names":["basemax/cmsgraphqlts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FCMSGraphQLTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FCMSGraphQLTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FCMSGraphQLTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FCMSGraphQLTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/CMSGraphQLTS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252576267,"owners_count":21770713,"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":["cms","cms-graphql","graphql","graphql-cms","javascript","js","ts","typescript"],"created_at":"2025-02-09T09:20:49.625Z","updated_at":"2025-05-05T20:51:57.925Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL CMS Project\n\nThis is a GraphQL-based project developed in TypeScript. It aims to provide a full-featured Content Management System (CMS) with various functionalities including categories, posts, sliders, FAQs, contact us responses, authentication, and more.\n\n## Features\n\nThe CMS includes the following features:\n\n- Categories: Allows managing different categories for organizing posts.\n- Posts: Enables creating, reading, updating, and deleting posts.\n- Posts in a Category: Provides the ability to retrieve posts belonging to a specific category.\n- FAQ: Allows creating and managing frequently asked questions.\n- Slider: Offers functionality to create and manage image sliders for the website.\n- Contact Us Response: Provides a mechanism for handling and responding to contact form submissions.\n- Authentication: Enables user authentication for secure access to the CMS.\n- Check Auth: Allows verifying the authentication status of a user.\n- Logout: Provides the ability to log out from the CMS.\n- Create New Admin: Allows creating new administrators for the CMS.\n\n## Technologies Used\n\nThe project utilizes the following technologies and tools:\n\n- GraphQL: A query language for APIs used to define the schema and interact with the CMS.\n- TypeScript: A statically typed superset of JavaScript used for writing the server-side code.\n- Node.js: A JavaScript runtime used as the server environment.\n- Nestjs: A progressive Node.js framework for building efficient, reliable and scalable server-side          applications.to handle HTTP requests.\n- Postgresql: A SQL database used for storing CMS data.\n- Prisma: Prisma is an open-source database toolkit and Object-Relational Mapping (ORM) tool.\n- Apollo Server: A GraphQL server library for Node.js used to create the GraphQL server.\n- JWT: JSON Web Tokens used for authentication and authorization.\n\n## Setup Instructions\n\nTo set up and run the GraphQL CMS project locally, follow these steps:\n\n- Clone the repository: `git clone https://github.com/BaseMax/CMSGraphQLTS.git`\n- Navigate to the project directory: `cd CMSGraphQLTS`\n- Install dependencies: `npm install`\n- Configure the database connection in the `.env` file.\n- Start the development server: `npm run dev`\n- Access the GraphQL playground at http://localhost:3000/graphql in your browser.\n\n## Project Structure\n\nThe project's file structure is organized as follows:\n\n- src/\n- controllers/: Contains the controllers responsible for handling GraphQL operations.\n- models/: Includes the Mongoose models for interacting with the database.\n- resolvers/: Contains the GraphQL resolvers that define how to handle GraphQL queries and mutations.\n- schemas/: Includes the GraphQL schemas that define the types and operations supported by the CMS.\n- utils/: Contains utility functions and modules used throughout the project.\n- index.ts: The entry point of the server.\n\n## GraphQL\n\nHere's a list of the queries and mutations available in the GraphQL CMS project:\n\n### Queries\n\n- `categories`: Retrieve a list of all categories.\n- `category(id: ID!)`: Retrieve a specific category by ID.\n- `posts`: Retrieve a list of all posts.\n- `post(id: ID!)`: Retrieve a specific post by ID.\n- `postsByCategory(categoryId: ID!)`: Retrieve all posts belonging to a specific category.\n- `sliders`: Retrieve a list of all sliders.\n- `slider(id: ID!)`: Retrieve a specific slider by ID.\n- `faqs`: Retrieve a list of all frequently asked questions.\n- `faq(id: ID!)`: Retrieve a specific FAQ by ID.\n- `contactUsResponses`: Retrieve a list of all contact form responses.\n- `contactUsResponse(id: ID!)`: Retrieve a specific contact form response by ID.\n- `checkAuth`: Check if the user is authenticated.\n- `admin(id: ID!)`: Retrieve a specific administrator by ID.\n\n### Mutations\n\n- `createCategory(input: CategoryInput!)`: Create a new category.\n- `updateCategory(id: ID!, input: CategoryInput!)`: Update an existing category.\n- `deleteCategory(id: ID!)`: Delete a category.\n- `createPost(input: PostInput!)`: Create a new post.\n- `updatePost(id: ID!, input: PostInput!)`: Update an existing post.\n- `deletePost(id: ID!)`: Delete a post.\n- `createSlider(input: SliderInput!)`: Create a new slider.\n- `updateSlider(id: ID!, input: SliderInput!)`: Update an existing slider.\n- `deleteSlider(id: ID!)`: Delete a slider.\n- `createFAQ(input: FAQInput!)`: Create a new frequently asked question.\n- `updateFAQ(id: ID!, input: FAQInput!)`: Update an existing frequently asked question.\n- `deleteFAQ(id: ID!)`: Delete a frequently asked question.\n- `createContactUsResponse(input: ContactUsResponseInput!)`: Create a new contact form response.\n- `deleteContactUsResponse(id: ID!)`: Delete a contact form response.\n- `login(input: LoginInput!)`: Log in and generate an authentication token.\n- `logout`: Log out and invalidate the authentication token.\n- `createAdmin(input: AdminInput!)`: Create a new administrator.\n\n## GraphQL Examples\n\n**Retrieve a list of all categories:**\n\n```graphql\nquery {\n  categories {\n    id\n    name\n  }\n}\n```\n\n**Retrieve a specific category by ID:**\n\n```graphql\nquery {\n  category(id: \"CATEGORY_ID\") {\n    id\n    name\n  }\n}\n```\n\n**Retrieve a list of all posts:**\n\n```graphql\nquery {\n  posts {\n    id\n    title\n    content\n  }\n}\n```\n\n**Retrieve a specific post by ID:**\n\n```graphql\nquery {\n  post(id: \"POST_ID\") {\n    id\n    title\n    content\n  }\n}\n```\n\n**Retrieve all posts belonging to a specific category:**\n\n```graphql\nquery {\n  postsByCategory(categoryId: \"CATEGORY_ID\") {\n    id\n    title\n    content\n  }\n}\n```\n\n**Retrieve a list of all sliders:**\n\n```graphql\nquery {\n  sliders {\n    id\n    title\n    images\n  }\n}\n```\n\n**Retrieve a specific slider by ID:**\n\n```graphql\nquery {\n  slider(id: \"SLIDER_ID\") {\n    id\n    title\n    images\n  }\n}\n```\n\n**Retrieve a list of all frequently asked questions:**\n\n```graphql\nquery {\n  faqs {\n    id\n    question\n    answer\n  }\n}\n```\n\n**Retrieve a specific FAQ by ID:**\n\n```graphql\nquery {\n  faq(id: \"FAQ_ID\") {\n    id\n    question\n    answer\n  }\n}\n```\n\n**Retrieve a list of all contact form responses:**\n\n```graphql\nquery {\n  contactUsResponses {\n    id\n    name\n    email\n    message\n  }\n}\n```\n\n**Retrieve a specific contact form response by ID:**\n\n```graphql\nquery {\n  contactUsResponse(id: \"RESPONSE_ID\") {\n    id\n    name\n    email\n    message\n  }\n}\n```\n\n**Check if the user is authenticated:**\n\n```graphql\nquery {\n  checkAuth\n}\n```\n\n**Retrieve a specific administrator by ID:**\n\n```graphql\nquery {\n  admin(id: \"ADMIN_ID\") {\n    id\n    username\n    email\n  }\n}\n```\n\n**Create a new category:**\n\n```graphql\nmutation {\n  createCategory(input: { name: \"New Category\" }) {\n    id\n    name\n  }\n}\n```\n\n**Update an existing category:**\n\n```graphql\nmutation {\n  updateCategory(id: \"CATEGORY_ID\", input: { name: \"Updated Category\" }) {\n    id\n    name\n  }\n}\n```\n\n**Delete a category:**\n\n```graphql\nmutation {\n  deleteCategory(id: \"CATEGORY_ID\")\n}\n```\n\n**Create a new post:**\n\n```graphql\nmutation {\n  createPost(\n    input: { title: \"New Post\", content: \"Lorem ipsum dolor sit amet.\" }\n  ) {\n    id\n    title\n    content\n  }\n}\n```\n\n**Update an existing post:**\n\n```graphql\nmutation {\n  updatePost(\n    id: \"POST_ID\"\n    input: { title: \"Updated Post\", content: \"Lorem ipsum dolor sit amet.\" }\n  ) {\n    id\n    title\n    content\n  }\n}\n```\n\n**Delete a post:**\n\n```graphql\nmutation {\n  deletePost(id: \"POST_ID\")\n}\n```\n\n**Create a new slider:**\n\n```graphql\nmutation {\n  createSlider(\n    input: { title: \"New Slider\", images: [\"image1.jpg\", \"image2.jpg\"] }\n  ) {\n    id\n    title\n    images\n  }\n}\n```\n\n**Update an existing slider:**\n\n```graphql\nmutation {\n  updateSlider(\n    id: \"SLIDER_ID\"\n    input: { title: \"Updated Slider\", images: [\"image3.jpg\", \"image4.jpg\"] }\n  ) {\n    id\n    title\n    images\n  }\n}\n```\n\n**Delete a slider:**\n\n```graphql\nmutation {\n  deleteSlider(id: \"SLIDER_ID\")\n}\n```\n\n**Create a new frequently asked question:**\n\n```graphql\nmutation {\n  createFAQ(\n    input: {\n      question: \"What is GraphQL?\"\n      answer: \"GraphQL is a query language for APIs.\"\n    }\n  ) {\n    id\n    question\n    answer\n  }\n}\n```\n\n**Update an existing frequently asked question:**\n\n```graphql\nmutation {\n  updateFAQ(\n    id: \"FAQ_ID\"\n    input: {\n      question: \"What is GraphQL?\"\n      answer: \"GraphQL is a powerful query language for APIs.\"\n    }\n  ) {\n    id\n    question\n    answer\n  }\n}\n```\n\n**Delete a frequently asked question:**\n\n```graphql\nmutation {\n  deleteFAQ(id: \"FAQ_ID\")\n}\n```\n\n**Create a new contact form response:**\n\n```graphql\nmutation {\n  createContactUsResponse(\n    input: {\n      name: \"John Doe\"\n      email: \"johndoe@example.com\"\n      message: \"Hello, I have a question.\"\n    }\n  ) {\n    id\n    name\n    email\n    message\n  }\n}\n```\n\n**Delete a contact form response:**\n\n```graphql\nmutation {\n  deleteContactUsResponse(id: \"RESPONSE_ID\")\n}\n```\n\n**Log in and generate an authentication token:**\n\n```graphql\nmutation {\n  login(input: { username: \"admin\", password: \"password\" }) {\n    token\n  }\n}\n```\n\n**Log out and invalidate the authentication token:**\n\n```graphql\nmutation {\n  logout\n}\n```\n\n**Create a new administrator:**\n\n```graphql\nmutation {\n  createAdmin(\n    input: {\n      username: \"newadmin\"\n      email: \"newadmin@example.com\"\n      password: \"password\"\n    }\n  ) {\n    id\n    username\n    email\n  }\n}\n```\n\nPlease note that you need to replace the placeholder values like CATEGORY_ID, POST_ID, etc., with actual IDs or data when making requests to the GraphQL API.\n\n## License\n\nThe GraphQL CMS project is licensed under the GPL-3.0 License. You can find the license information in the LICENSE file.\n\nCopyright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fcmsgraphqlts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fcmsgraphqlts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fcmsgraphqlts/lists"}