{"id":20793773,"url":"https://github.com/aldotestino/hackernews-clone","last_synced_at":"2026-04-16T10:34:00.136Z","repository":{"id":116350122,"uuid":"346705317","full_name":"aldotestino/hackernews-clone","owner":"aldotestino","description":"Hackernews server made with graphql and prisma","archived":false,"fork":false,"pushed_at":"2021-03-12T09:54:09.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T01:24:36.900Z","etag":null,"topics":["apollo-server","graphql","nodejs","prisma","sqlite","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/aldotestino.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":"2021-03-11T13:08:06.000Z","updated_at":"2021-03-12T09:54:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"503d04a6-6de8-4ee9-b24e-e48fd9be5e94","html_url":"https://github.com/aldotestino/hackernews-clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aldotestino/hackernews-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotestino%2Fhackernews-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotestino%2Fhackernews-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotestino%2Fhackernews-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotestino%2Fhackernews-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldotestino","download_url":"https://codeload.github.com/aldotestino/hackernews-clone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotestino%2Fhackernews-clone/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265281176,"owners_count":23739868,"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":["apollo-server","graphql","nodejs","prisma","sqlite","typescript"],"created_at":"2024-11-17T16:11:25.479Z","updated_at":"2026-04-16T10:34:00.064Z","avatar_url":"https://github.com/aldotestino.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## hackernews clone\n\n### Stack\n* Typescript\n* Graphql\n* Apollo-server\n* Prisma\n* Sqlite\n\n### Configuration\n* Install all the dependencies\n  ```shell\n  npm i\n  ```\n* Migrate the database with prisma\n  ```shell\n  npm run migrate\n  ```\n* Generate prisma client and types\n  ```shell\n  npm run generate\n  ```\n  \n### Usage\n* Start the dev server\n  ```shell\n  cd server\n  npm run dev\n  ```\n* Go to `http://localhost:4000`\n\n### Examples\n#### Mutation\n* Signup\n  ```graphql\n  mutation {\n    signup(email: \"at@email.com\", password: \"aw3some\", name: \"at\") {\n      token\n      user {\n        name\n        email\n      }\n    }\n  }\n  ```\n* Login\n  ```graphql\n  mutation {\n    login(email: \"at@email.com\", password: \"aw3some\") {\n      token\n      user {\n        name\n        email\n      }\n    }\n  }\n  ```\n* Change name\n  ```graphql\n  mutation {\n    cahngeName(name: \"Aldo\") {\n      id\n      name\n    }\n  }\n  ```\n  * Headers\n    ```graphql   \n    {\n      \"Authorization\": \"Bearer YOUR_TOKEN\"\n    }\n    ```\n* Post a Link\n  ```graphql\n  mutation {\n    post(url: \"www.github.com/aldotestino\", description: \"my GitHub page\") {\n      id\n      url\n      description\n    }\n  }\n  ```\n  * Headers\n    ```graphql   \n    {\n      \"Authorization\": \"Bearer YOUR_TOKEN\"\n    }\n    ```\n* Delete a Link\n  ```graphql\n  mutation {\n    deleteLink(id: \"3\") {\n      id\n      url\n      description\n    }\n  }\n  ```\n  * Headers\n    ```graphql   \n    {\n      \"Authorization\": \"Bearer YOUR_TOKEN\"\n    }\n    ```\n* Vote a Link\n  ```graphql\n  mutation {\n    vote(linkId: \"3\") {\n      id\n      link {\n        url\n      }\n      user {\n        name\n      }\n    }\n  }\n  ```\n  * Headers\n    ```graphql   \n    {\n      \"Authorization\": \"Bearer YOUR_TOKEN\"\n    }\n    ```\n\n#### Query\n* Get all the Links\n  ```graphql\n  query {\n    feed {\n      url\n      description\n      postedBy {\n        name\n      } \n    }\n  }\n  ```\n  * Params:\n    * filter\n    * skip\n    * take\n    * orderBy\n      * createdAt\n      * url\n      * description\n* Get a Link\n  ```graphql\n  query {\n    link(id: \"3\") {\n      url\n      description\n      postedBy {\n        name\n      } \n    }\n  }\n  ```\n* Get all the Users\n  ```graphql\n  query {\n    users {\n      name\n      email\n      links {\n        url\n        description\n      } \n    }\n  }\n  ```\n    * Params:\n    * filter\n    * skip\n    * take\n    * orderBy\n      * name\n      * email\n* Get a User\n  ```graphql\n  query {\n    user(id: \"1\") {\n      name\n      email\n      links {\n        url\n        description\n      } \n    }\n  }\n  ```\n\n#### Subscription\n* Subscribe to new links\n  ```graphql\n  subscription {\n    newLink {\n      id\n      url\n      description\n      postedBy {\n        name\n      }\n    }\n  }\n  ```\n  * Headers\n    ```graphql   \n    {\n      \"Authorization\": \"Bearer YOUR_TOKEN\"\n    }\n    ```\n* Subscribe to new votes\n  ```graphql\n  subscription {\n    newVote {\n      id\n      link {\n        id\n        url\n        description\n        postedBy {\n          name\n        }\n      }\n      user {\n        id\n        name\n      }\n    }\n  }\n  ```\n  * Headers\n    ```graphql   \n    {\n      \"Authorization\": \"Bearer YOUR_TOKEN\"\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldotestino%2Fhackernews-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldotestino%2Fhackernews-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldotestino%2Fhackernews-clone/lists"}