{"id":25171771,"url":"https://github.com/basemax/bookstoregraphqlts","last_synced_at":"2026-04-10T01:02:44.622Z","repository":{"id":179222079,"uuid":"627970086","full_name":"BaseMax/BookstoreGraphQLTS","owner":"BaseMax","description":"This is a TypeScript-based GraphQL API for a bookstore that allows users to browse books and manage their accounts. The API is built using Apollo Server, and it uses Redis for caching and PostgreSQL as the database. Docker is used to automatically install PostgreSQL and the GraphQL tools.","archived":false,"fork":false,"pushed_at":"2024-06-18T10:09:48.000Z","size":750,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T17:08:04.266Z","etag":null,"topics":["api","graphql","javascript","js","postgresql","psql","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}},"created_at":"2023-04-14T15:49:40.000Z","updated_at":"2024-10-02T06:45:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a890e4b-223a-41b5-838e-1db280e364fd","html_url":"https://github.com/BaseMax/BookstoreGraphQLTS","commit_stats":null,"previous_names":["basemax/bookstoregraphqlts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookstoreGraphQLTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookstoreGraphQLTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookstoreGraphQLTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookstoreGraphQLTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/BookstoreGraphQLTS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247080366,"owners_count":20880252,"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":["api","graphql","javascript","js","postgresql","psql","ts","typescript"],"created_at":"2025-02-09T09:22:00.470Z","updated_at":"2025-12-30T22:39:52.163Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript GraphQL API for Bookstore\n\nThis is a TypeScript-based GraphQL API for a bookstore that allows users to browse books and manage their accounts. The API is built using Apollo Server, and it uses Redis for caching and PostgreSQL as the database. Docker is used to automatically install PostgreSQL and the GraphQL tools.\n\n## Features\n\n- Browse books: users can query for a list of all books or search for a book by its ID.\n- Manage accounts: users can create, update, and delete their accounts, as well as purchase books.\n- Browse genres: users can query for a list of all genres.\n- Caching: the API uses Redis to cache the books query for at least a day, the users query for 3 hours, and the genres query for 1 week.\n\n## Technologies\n\n- TypeScript\n- Apollo Server\n- Redis\n- PostgreSQL\n- Docker\n\n## Getting Started\n\nTo get started with the project, follow these steps:\n\nClone the repository:\n\n```bash\ngit clone https://github.com/BaseMax/BookstoreGraphQLTS\n```\n\nInstall dependencies:\n```bash\ncd BookstoreGraphQLTS\nnpm install\n```\n\nStart the PostgreSQL and Redis servers using Docker:\n```bash\ndocker-compose up -d\n```\n\nStart the server:\n```bash\nnpm run start\n```\n\nVisit http://localhost:4000/graphql to interact with the API using the GraphQL Playground.\n\n## Testing\n\nTo run the tests, use the following command:\n\n```shell\nnpm run test:e2e\n```\n\nThis will execute the test suite and provide the test results.\n\n## Background\n\nYou are tasked with building a GraphQL API for a bookstore that will allow users to browse books and manage their accounts. The API should be built using TypeScript and Apollo Server, and it should use Redis for caching and PostgreSQL as the database. Docker should be used to automatically install PostgreSQL and the GraphQL tools.\n\n## Requirements\n\nThe GraphQL API should have the following types:\n- Book: a book has an ID, title, author, ISBN, and an array of genres.\n- User: a user has an ID, name, email, password, and an array of books they have purchased.\n- Genre: a genre has an ID and a name.\n\n\nThe API should have the following queries and mutations.\n\n### Queries:\n\n- books: returns a list of all books. This query should be cached in Redis for at least a day.\n```graphql\nquery {\n  books {\n    id\n    title\n    author\n    ISBN\n    genre {\n      name\n    }\n  }\n}\n```\n\n- book: returns a book by its ID.\n```graphql\nquery {\n  book(id: id) {\n    id\n    title\n    author\n    ISBN\n    genre {\n      name\n    }\n  }\n}\n```\n\n- users: returns a list of all users.\n```graphql\nquery {\n  users {\n    id\n    name\n    email\n    books\n  }\n}\n```\n\n- user: returns a user by their ID.\n```graphql\nquery($id: ID!) {\n  user(id: $id) {\n    id\n    name\n    email\n    books\n  }\n}\n```\n\n- genres: returns a list of all genres. This query should be cached in Redis for 1 week.\n```graphql\nquery {\n  genres {\n    id\n    name\n  }\n}\n```\n\n### Mutations\n\n- createBook: creates a new book.\n```graphql\nmutation {\n  createBook(createBookInput) {\n    id\n    title\n    author\n    ISBN\n    genres\n  }\n}\n```\n\n- updateBook: updates a book by its ID.\n\n```graphql\nmutation {\n  updateBook(updateBookInput) {\n    id\n    title\n    author\n    ISBN\n    genres\n  }\n}\n```\n\n- deleteBook: deletes a book by its ID.\n\n```graphql\nmutation {\n  removeBook(id: id) {\n    id\n    title\n    author\n    ISBN\n    genres\n  }\n}\n```\n\n- purchaseBook: adds a book to a user's list of purchased books.\n\n```graphql\nmutation {\n  purchaseBook(userId: $userId, bookId: $bookId) {\n    id\n    name\n    email\n    books\n  }\n}\n```\n\n- createUser: creates a new user.\n```graphql\nmutation() {\n  createUser(createUserInout) {\n    id\n    name\n    email\n  }\n}\n```\n\n- updateUser: updates a user by their ID.\n\n```graphql\nmutation {\n  updateUser(updateUserInput) {\n    id\n    name\n    email\n    books\n  }\n}\n```\n\n- deleteUser: deletes a user by their ID.\n\n```graphql\nmutation() {\n  deleteUser(id: $id) {\n    id\n    name\n    email\n    books\n  }\n}\n```\n\nThe API should use Redis to cache the books query for at least a day, the users query for 3 hours, and the genres query for 1 week.\n\nThe API should use PostgreSQL as the database for storing and retrieving data.\n\nDocker should be used to automatically install PostgreSQL and the GraphQL tools.\n\n## Deliverables\n\n- Instructions for running the API using Docker.\n\n- A brief write-up explaining any design decisions and assumptions made during the development process.\n\nNote: This is just an example assignment and you can customize it based on your specific requirements and needs.\n\n## Contributions\n\nContributions are welcome! If you find a bug or would like to suggest a new feature, please open an issue or a pull request.\n\nCopyright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fbookstoregraphqlts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fbookstoregraphqlts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fbookstoregraphqlts/lists"}