{"id":25171213,"url":"https://github.com/basemax/productsgraphqlts","last_synced_at":"2026-02-24T00:05:36.430Z","repository":{"id":174060398,"uuid":"649783338","full_name":"BaseMax/ProductsGraphQLTS","owner":"BaseMax","description":"This project is an e-commerce application built with GraphQL and TypeScript using the NestJS framework. It provides various functionalities for managing products, categories, and user authentication. The project includes features such as user registration, login, authentication, logout, product management.","archived":false,"fork":false,"pushed_at":"2026-02-08T06:29:23.000Z","size":236,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T13:11:15.630Z","etag":null,"topics":["graphql","graphql-ts","javascript","js","nest","ts","ts-graphql","typescript","typescript-graphql"],"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-05T16:14:35.000Z","updated_at":"2026-02-08T06:29:19.000Z","dependencies_parsed_at":"2024-09-12T19:39:16.762Z","dependency_job_id":"b9efa01c-1255-42ad-a823-2183ebaccfcc","html_url":"https://github.com/BaseMax/ProductsGraphQLTS","commit_stats":null,"previous_names":["basemax/productsgraphqlts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/ProductsGraphQLTS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FProductsGraphQLTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FProductsGraphQLTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FProductsGraphQLTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FProductsGraphQLTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/ProductsGraphQLTS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FProductsGraphQLTS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29761981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T21:02:23.375Z","status":"ssl_error","status_checked_at":"2026-02-23T20:58:31.539Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["graphql","graphql-ts","javascript","js","nest","ts","ts-graphql","typescript","typescript-graphql"],"created_at":"2025-02-09T09:19:35.393Z","updated_at":"2026-02-24T00:05:36.395Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-Commerce Project with GraphQL and NestJS\n\nThis project is an e-commerce application built with GraphQL and TypeScript using the NestJS framework. It provides various functionalities for managing products, categories, and user authentication. The project includes features such as user registration, login, authentication, logout, product management (including creation, editing, deletion, searching, sorting, pagination), category management (including creation, editing, deletion), and role-based access control.\n\n## Prerequisites\n\nBefore running the application, ensure that the following prerequisites are met:\n\n- Node.js (version \u003e= 12) is installed on your machine.\n- NPM (Node Package Manager) or Yarn is installed.\n- MongoDB or any other compatible database is set up and running.\n\n## Installation\n\nClone the repository:\n  ```bash\n  git clone https://github.com/BaseMax/ProductsGraphQLTS.git\n  ```\n\nInstall the dependencies:\n\n  ```bash\n  cd ProductsGraphQLTS\n  npm install\n  ```\n\n## Configuration\n\nRename the `.env.example` file to `.env` and update the following configuration variables as per your environment:\n```makefile\n# Database configuration\nDB_HOST=\u003cyour-database-host\u003e\nDB_PORT=\u003cyour-database-port\u003e\nDB_NAME=\u003cyour-database-name\u003e\n\n# JWT secret key for token generation\nJWT_SECRET=\u003cyour-secret-key\u003e\n\n# Admin email and password for initial setup\nADMIN_EMAIL=\u003cadmin-email\u003e\nADMIN_PASSWORD=\u003cadmin-password\u003e\n```\n\nAdjust any other necessary configuration settings based on your requirements.\n\n## Usage\nTo start the application, run the following command:\n\n```\nnpm run start\n```\n\nThis will start the server on the specified port (default is 3000). You can access the GraphQL playground by navigating to http://localhost:3000/graphql in your browser.\n\n## API Endpoints\n\nThe API endpoints are defined using GraphQL and can be accessed through the GraphQL playground. Below are the available queries and mutations:\n\n### Authentication\n\n- `register`: Create a new user account.\n- `login`: Authenticate a user and generate an access token.\n- `logout`: Invalidate the access token and log out the user.\n\n### Products\n\n- `getProducts`: Retrieve a list of products.\n- `createProduct`: Create a new product.\n- `editProduct`: Update an existing product.\n- `deleteProduct`: Delete a product.\n- `searchProduct`: Search for products based on a keyword.\n- `filterProducts`: Filter products based on specific criteria (e.g., category, price range, etc.).\n- `paginateProducts`: Retrieve paginated products based on specified page and limit values.\n\n### Categories\n\n- `createCategory`: Create a new category.\n- `editCategory`: Update an existing category.\n- `deleteCategory`: Delete a category.\n- `getProductsByCategory`: Retrieve all products within a specific category.\n\n### Admin-specific\n\n- `getInactiveProducts`: Retrieve all products that are not yet active.\n- `activateProduct`: Activate a product.\n- `deactivateProduct`: Deactivate a product.\n\nNote: Certain mutations and queries may require the user to be authenticated and have the appropriate role (e.g., admin) to access them.\n\n## Examples\n\n### Authentication\n\n**Register**\n\n```graphql\nmutation {\n  register(input: {\n    name: \"John Doe\",\n    email: \"johndoe@example.com\",\n    password: \"password123\"\n  }) {\n    id\n    name\n    email\n    created\n    message\n  }\n}\n```\n\n**Login**\n\n```graphql\nmutation {\n  login(input: {\n    email: \"johndoe@example.com\",\n    password: \"password123\"\n  }) {\n    accessToken\n    message\n  }\n}\n```\n\n### Products\n\n**Get Products**\n\n```graphql\nquery {\n  getProducts {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Create Product**\n\n```graphql\nmutation {\n  createProduct(input: {\n    name: \"Product Name\",\n    price: 29.99,\n    categoryId: \"\u003ccategory-id\u003e\"\n  }) {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Edit Product**\n\n```graphql\nmutation {\n  editProduct(input: {\n    id: \"\u003cproduct-id\u003e\",\n    name: \"New Product Name\",\n    price: 39.99\n  }) {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Delete Product**\n\n```graphql\nmutation {\n  deleteProduct(id: \"\u003cproduct-id\u003e\")\n}\n```\n\n**Search Product**\n\n```graphql\nquery {\n  searchProduct(keyword: \"keyword\") {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Filter Products**\n\n```graphql\nquery {\n  filterProducts(categoryId: \"\u003ccategory-id\u003e\", minPrice: 10, maxPrice: 50) {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Paginate Products**\n\n```graphql\nquery {\n  paginateProducts(page: 1, limit: 10) {\n    totalItems\n    totalPages\n    currentPage\n    products {\n      id\n      name\n      price\n      category {\n        id\n        name\n      }\n    }\n  }\n}\n```\n\n### Categories\n\n**Create Category**\n\n```graphql\nmutation {\n  createCategory(name: \"Category Name\") {\n    id\n    name\n  }\n}\n```\n\n**Edit Category**\n\n```graphql\nmutation {\n  editCategory(id: \"\u003ccategory-id\u003e\", name: \"New Category Name\") {\n    id\n    name\n  }\n}\n```\n\n**Delete Category**\n\n```graphql\nmutation {\n  deleteCategory(id: \"\u003ccategory-id\u003e\")\n}\n```\n\n**Get Products by Category**\n\n```graphql\nquery {\n  getProductsByCategory(categoryId: \"\u003ccategory-id\u003e\") {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n  ### Admin-specific\n\n**Get Inactive Products**\n\n```graphql\nquery {\n  getInactiveProducts {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Activate Product**\n\n```graphql\nmutation {\n  activateProduct(id: \"\u003cproduct-id\u003e\") {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n**Deactivate Product**\n\n```graphql\nmutation {\n  deactivateProduct(id: \"\u003cproduct-id\u003e\") {\n    id\n    name\n    price\n    category {\n      id\n      name\n    }\n  }\n}\n```\n\n\n## Authentication and Authorization\n\nUser authentication is handled using JWT (JSON Web Tokens). When a user successfully logs in, an access token is generated and returned in the response. This access token should be included in the Authorization header for subsequent requests requiring authentication.\n\nThe application implements role-based access control, differentiating between admin and normal users. Admins have additional privileges, such as viewing inactive products.\n\nCopyright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fproductsgraphqlts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fproductsgraphqlts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fproductsgraphqlts/lists"}