{"id":24941846,"url":"https://github.com/steniowagner/cine-tasty-server","last_synced_at":"2025-04-10T03:43:47.546Z","repository":{"id":42956451,"uuid":"231632005","full_name":"steniowagner/cine-tasty-server","owner":"steniowagner","description":"NodeJS + GraphQL API used to serve the CineTasty app","archived":false,"fork":false,"pushed_at":"2024-03-29T09:27:48.000Z","size":2602,"stargazers_count":7,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-03-24T05:01:51.681Z","etag":null,"topics":["api","docker","docker-compose","graphql","javascript","nodejs","redis","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/steniowagner.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}},"created_at":"2020-01-03T17:14:06.000Z","updated_at":"2024-02-22T02:18:15.000Z","dependencies_parsed_at":"2023-11-24T20:22:32.311Z","dependency_job_id":"7c351a61-dbf8-46f1-ae75-c8a13bad0cbf","html_url":"https://github.com/steniowagner/cine-tasty-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steniowagner%2Fcine-tasty-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steniowagner%2Fcine-tasty-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steniowagner%2Fcine-tasty-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steniowagner%2Fcine-tasty-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steniowagner","download_url":"https://codeload.github.com/steniowagner/cine-tasty-server/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154967,"owners_count":21056541,"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","docker","docker-compose","graphql","javascript","nodejs","redis","typescript"],"created_at":"2025-02-02T18:56:48.207Z","updated_at":"2025-04-10T03:43:47.505Z","avatar_url":"https://github.com/steniowagner.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CineTasty-Server\n\nThis is the back-end of the [CineTasty app](https://github.com/steniowagner/cine-tasty-mobile).\n\nThis server is a GraphQL-API that requests data from different REST datasources and return them as graphql-responses to the clients. No data is stored nor generated (for now).\n\n## 🚧 This project is not finished 🚧\n\nThis project is still under development, and you can check the Roadmap of planned features [here](https://github.com/steniowagner/cine-tasty-server/blob/development/README.md#roadmap---future-features).\n\n## Features\n\n### Movies, TV-Shows, Actors and Actresses\n\n- Get details\n- Search\n- Get the latests trends\n\n### Quizes\n\n- Create trivia-questionnaires about Cinema\n\n### News\n\n- Get the latests news about Cinema\n\n## Architecture\n\n![High-level architecture](https://github.com/steniowagner/cine-tasty-server/blob/development/static/architecture-high-level.png)\n_High-level architecture_\n\nThis server lives in docker containers. The clients will send requests to the server and the server will request this data from one of the REST datasources. At the moment, the app requests data from three different datasources:\n\n- [The Movie DB API](https://developer.themoviedb.org/reference/intro/getting-started): Used to search and get details and trends related to Movies, TV-Shows and Actors/Actresses.\n- [Open Trivia DB API](https://opentdb.com/): Used to reate questionnaries about Cinema\n- [News API](https://newsapi.org/): Used to get the latests news about Cinema\n\nDepending on the query, the server will resolve the requested data by fetching the proper datasource.\n\nAlso, Redis is used to cache some of the responses returned by the datasources.\n\n### Request flow\n\n![Request flow](https://github.com/steniowagner/cine-tasty-server/blob/development/static/request-flow.png)\n_Example of request flow - user requesting details about a Movie_\n\n1. The clients will send GraphQL queries to the server\n2. The server will fetch the data requested in the step 2 by requesting the data from the proper REST datasource (In this case, TMDB API)\n3. The REST datasource will return the data to the server\n4. The server will return the data to the user as a graphql-response\n\n### Documentation\n\nYou can check the documentation with the possible queries [here](https://steniowagner.github.io/cine-tasty-server/).\n\nAlso, you can check how to generate it [here](https://github.com/steniowagner/cine-tasty-server/blob/development/README.md#generating-documentation).\n\n## Getting Started\n\n**Cloning the Repository**\n\n```\n$ git clone https://github.com/steniowagner/cine-tasty-server\n\n$ cd cine-tasty-server\n```\n\n### Prerequisites\n\n#### Environement\n\nYou'll only need to have Docker installed in order to have the server up and running.\n\n#### API Keys\n\nThis server uses three environment variables, but only `TMDB API` and `News API` are required in order to run the server.\n\nTMDB and News require that you have a personal key to use their services. You can generate the `TMDB API` key [here](https://developer.themoviedb.org/docs/getting-started) and `News API` key [here](https://newsapi.org/register).\n\nThe `STEP_ZEN_KEY` is used by [spectaql](https://github.com/anvilco/spectaql), the tool that is used to generate the GraphQL documentation, also requires that you have a key to use it, but it's not required to run the app. If you're interested in generate the documentation, you'll have to create your key [here](https://dashboard.stepzen.com/).\n\n#### Setup environment variables\n\nThe [.env.example](https://github.com/steniowagner/cine-tasty-server/blob/development/.env.example) file shows all the enviroment variables that you'll need to set in order to run the app (except for the `STEP_ZEN_KEY`).\n\nTo setup the environment variables, create a new `.env` file and add their respectives values.\n\n### Running\n\nAt this point, you should already have your environment variables declared in a .env file.\n\nTo run the app, you just need start the containers using `docker compose`.\n\n```\n$ docker-compose --env-file .env up --build\n```\n\nYou'll find the app runing at your localhost:\u003cNODEJS_SERVER_PORT\u003e\n\n\u003e I'll be using npm as package-manager to run the tasks described below, but you can use yarn or pnpm.\n\n### Starting the dev-server\n\nTo start the development server, run:\n\n```\n$ npm run start:dev\n```\n\n### Building\n\nTo build the application, run:\n\n```\n$ npm run build\n```\n\n### Running prettier\n\nTo prettify the code, run:\n\n```\n$ npm run prettier:fix\n```\n\n### Running eslint\n\nTo lint the code, run:\n\n```\n$ npm run lint:fix\n```\n\n### Testing\n\nThe tests are divided in `integration` and `unit`. The unit-tests files are the `.test.ts` files and the integration-test files are the `.spec.ts`.\n\nTo only run the unit-tests:\n\n```\n$ npm run test:unit\n```\n\nTo only run the integration-tests:\n\n```\n$ npm run test:integration\n```\n\nTo run all tests:\n\n```\n$ npm run test\n```\n\nTo run all tests in watch mode:\n\n```\n$ npm run test:watch\n```\n\nTo run all tests with code-coverage metrics:\n\n```\n$ npm run test:coverage\n```\n\n### Generating types\n\nThis project uses [graphql-code-generator](https://github.com/dotansimha/graphql-code-generator) to generate the static typescript types of the graphql operations.\n\nTo initiate the graphql-code-generator (it's already initiated):\n\n```\n$ npm run codegen:init\n```\n\nTo generate the types:\n\n```\n$ npm run codegen:generate\n```\n\nThe generated types will be saved at `src/generated/graphql.ts`. If you want to change this location, just modify the [codegen.yml](https://github.com/steniowagner/cine-tasty-server/blob/development/codegen.yml) file.\n\n### Generating documentation\n\nTo generate the documentation (make sure that you have the server running):\n\n```\n$ npm run generate:docs\n```\n\nThe documentation will be generated at the `docs` folder in the root directory. If you want to modify some of the data generated in the generated documentation, please refer to the [spectaql-config.yaml](https://github.com/steniowagner/cine-tasty-server/blob/development/spectaql-config.yaml) file.\n\n## Roadmap - future features\n\nEven with all the interactions with the datasources in place, I would like to add more complexity to this application. At the moment, I'm thinking about the following:\n\n- Add authentication\n- Allow the user to create and manage lists of favorite movies/tv-shows/actors/actresses\n- Allow the user to create and manage lists of movies/tv-shows to watch-later\n- Add reviews of movies and tv-shows\n- Keep a track of the results in the questionnaires\n- Create a ranking of the scores in the questionnaires\n\nTo accomplish this, the project will need to have a database. Due the structure of the data presented by the features, I'll be using [PostgreSQL](https://www.postgresql.org/) as the database.\n\n## About\n\nThis project is part of my personal portfolio. So, I would be happy if you could provide me any feedback about the project, code, structure or anything that you can report that could make me a better developer!\n\nEmail-me: stenio.wagner1@gmail.com\n\nConnect with me at [LinkedIn](https://www.linkedin.com/in/steniowagner/)\n\nAlso, you can use this Project as you wish, be for study, be for make improvements or earn money with it!\n\nIt's free!\n\nThank you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteniowagner%2Fcine-tasty-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteniowagner%2Fcine-tasty-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteniowagner%2Fcine-tasty-server/lists"}