{"id":26267488,"url":"https://github.com/oslabs-beta/troveql","last_synced_at":"2025-08-05T08:14:33.632Z","repository":{"id":145465527,"uuid":"616596489","full_name":"oslabs-beta/troveql","owner":"oslabs-beta","description":"A server-side caching library for GraphQL written for Express.js with a built-in performance monitoring application","archived":false,"fork":false,"pushed_at":"2023-09-11T18:09:55.000Z","size":685,"stargazers_count":49,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-29T14:06:39.751Z","etag":null,"topics":["caching","graphql","javascript","monitoring","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oslabs-beta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-20T17:41:39.000Z","updated_at":"2025-02-20T20:30:18.000Z","dependencies_parsed_at":"2024-01-26T13:11:17.070Z","dependency_job_id":"e63e73c9-eea3-4032-9dfe-ddf8b3f1a7f2","html_url":"https://github.com/oslabs-beta/troveql","commit_stats":{"total_commits":171,"total_committers":8,"mean_commits":21.375,"dds":0.6432748538011697,"last_synced_commit":"eb14948657f503d3198d43bf4eb602eef1f0b325"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/oslabs-beta/troveql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2Ftroveql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2Ftroveql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2Ftroveql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2Ftroveql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oslabs-beta","download_url":"https://codeload.github.com/oslabs-beta/troveql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2Ftroveql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268859123,"owners_count":24318874,"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-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["caching","graphql","javascript","monitoring","typescript"],"created_at":"2025-03-14T04:17:02.597Z","updated_at":"2025-08-05T08:14:33.606Z","avatar_url":"https://github.com/oslabs-beta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src='/assets/TroveQL-black.svg' style=\"width:100%;\"\u003e\n  \u003ch1\u003eWelcome to TroveQL!\u003c/h1\u003e\n  \u003cp\u003eTroveQL is a cache library for GraphQL APIs on Express.js servers with additional support for TroveMetrics, a cache performance monitoring application.\u003c/p\u003e\n  \u003cp\u003e\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/oslabs-beta/troveql\"\u003e\u003c/p\u003e\n  \u003cimg src=\"https://img.shields.io/badge/npm-CB3837?style=for-the-badge\u0026logo=npm\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/GraphQl-E10098?style=for-the-badge\u0026logo=graphql\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Express.js-000000?style=for-the-badge\u0026logo=express\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Electron-2B2E3A?style=for-the-badge\u0026logo=electron\u0026logoColor=9FEAF9\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Chart.js-FF6384?style=for-the-badge\u0026logo=chartdotjs\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Webpack-8DD6F9?style=for-the-badge\u0026logo=Webpack\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/JavaScript-323330?style=for-the-badge\u0026logo=javascript\u0026logoColor=F7DF1E\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge\u0026logo=html5\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge\u0026logo=css3\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Sass-CC6699?style=for-the-badge\u0026logo=sass\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Jest-C21325?style=for-the-badge\u0026logo=jest\u0026logoColor=white\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/eslint-3A33D1?style=for-the-badge\u0026logo=eslint\u0026logoColor=white\"\u003e\n\u003c/div\u003e\n\n## Features\n- Server-side cache for GraphQL queries using the Advanced Replacement Cache (ARC) algorithm\n- Custom cache configurations with options such as total capacity\n- Cache invalidation logic on GraphQL mutations\n- Support for Node.js/Express.js servers\n- Cache performance monitoring with key metrics such as Hit/Miss Rate and Query Response Time\n\n## Documentation\nVisit \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.troveql.io/\"\u003eour website\u003c/a\u003e to get more information and watch a demo of TroveQL and its performance monitoring application TroveMetrics.\n\n## Table of Contents\n- [Install](#install-troveql)\n- [Set Up](#set-up-troveql-in-express)\n- [Queries and Mutations](#query-or-mutate-your-graphQL-API)\n- [Roadmap](#iteration-roadmap)\n- [Contribute](#contribution-guidelines)\n- [Stack](#stack)\n- [Authors](#authors)\n- [License](#license)\n\n## Install TroveQL\nInstall the Express library via npm\n\n```bash\nnpm install troveql\n```\n\n## Set up TroveQL in Express\n1. Import TroveQLCache\n```javascript\nconst { TroveQLCache } = require('troveql');\n```\n\n2. Set up your TroveQL cache\n```javascript\nconst capacity = 5; // size limit of your cache\nconst graphQLAPI = 'http://localhost:4000/graphql'; // your graphQL URL endpoint\nconst useTroveMetrics = true; // (optional) if you would like to use TroveMetrics - default is false\nconst mutations = {}; // (optional) object where key/value pairs are mutation types/object types mutated (ex. { addMovie: 'movie', editMovie: 'movie', deleteMovie: 'movie' })\nconst cache = new TroveQLCache(capacity, graphQLAPI, useTroveMetrics, mutations);\n```\n\n3. Add the /troveql and, if applicable, /trovemetrics endpoints\n```javascript\n// REQUIRED\napp.use(express.json())\napp.use(express.urlencoded({ extended: true }));\n\n// /troveql to use the cache\napp.use('/troveql', \n  cache.queryCache,\n  (req: Request, res: Response) =\u003e res.status(200).json(res.locals.value)\n);\n\n// /trovemetrics to clear the cache from TroveMetrics\napp.use('/trovemetrics', \n  cache.troveMetrics,\n  (req: Request, res: Response) =\u003e res.status(200).json(res.locals.message)\n);\n```\n\n4. Add your GraphQL endpoint. For example:\n```javascript\nconst { graphqlHTTP } = require(\"express-graphql\");\nconst { schema } = require('./schema');\nconst { resolvers } = require('./resolvers');\n\napp.use('/graphql', \n  graphqlHTTP({\n    schema: schema, \n    rootValue: resolvers,\n    graphiql: true\n  })\n);\n```\n\n5. To use TroveMetrics to monitor the performance of your cache and GraphQL API on your application's server, you can go to \u003ca href=\"https://www.troveql.io/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eour website\u003c/a\u003e and download the desktop application for your OS (macOS, Windows, Linux).\n\n## Query or Mutate your GraphQL API\nSimply send a request to your GraphQL API for queries and mutations as you normally would. For example, a query with variables using the `fetch` syntax could look like:\n```javascript\nfetch('/troveql', {\n  method: 'POST',\n  headers: { \n    'Content-Type': 'application/json' \n  },\n  body: JSON.stringify({\n    query: `query ($id: ID) {\n      movie(id: $id) {\n          id\n          title\n          genre\n          year\n          actors \n            {\n              name\n            }\n      }\n    }`,\n    variables: { id: 10 }\n  })\n})\n.then(response =\u003e response.json())\n.then(response =\u003e {\n  // access the data on the response object with response.data\n})\n```\n## TroveQL Demo\nDownload our TroveQL demo to see how TroveQL is run:\n[troveql-demo](https://github.com/oslabs-beta/troveql-demo/)\n\n## Feature Roadmap\n- Client-side caching\n- Persistent queries to improve the performance and security of client queries to the server\n- Additional cache invalidation logic on mutations\n- Additional cache logic on subscriptions\n- Update cache capacity to reflect memory size (bytes) instead of number of items\n- User authentication for TroveMetrics\n\n## Contribution Guidelines\nIf you would like to contribute to this open-source project, please follow the steps below:\n1. Fork the repository from the `dev` branch\n2. Create a new feature branch (`git checkout -b feature/newFeature`)\n3. Commit your changes with a descriptive comment (`git commit -m 'Added a new feature that ...'`)\n4. Push your changes to the new feature branch (`git push origin feature/newFeature`)\n5. Open a Pull Request on the `dev` branch\n6. We will review your PR and merge the new feature into the `main` branch as soon as possible!\n\nThank you so much!\n\n## Stack\n- GraphQL\n- Node.js / Express.js\n- Electron\n- React.js\n- Chart.js\n- Webpack\n- TypeScript\n- JavaScript\n- HTML\n- CSS / SASS\n- Jest\n\n## Authors\nAlex Klein - [GitHub](https://github.com/a-t-klein) | [LinkedIn](https://www.linkedin.com/in/alex-t-klein-183aa758/)\n\u003cbr\u003e\nErika Jung - [GitHub](https://github.com/erikahjung) | [LinkedIn](https://www.linkedin.com/in/erikahjung)\n\u003cbr\u003e\nSam Henderson - [GitHub](https://github.com/samhhenderson) | [LinkedIn](https://www.linkedin.com/in/samuel-h-henderson/)\n\u003cbr\u003e\nTricia Yeh - [GitHub](https://github.com/triciacorwin) | [LinkedIn](https://www.linkedin.com/in/tricia-yeh/)\n\u003cbr\u003e\n\n## License\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foslabs-beta%2Ftroveql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foslabs-beta%2Ftroveql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foslabs-beta%2Ftroveql/lists"}