{"id":13591005,"url":"https://github.com/mudroljub/programming-quotes-api","last_synced_at":"2025-04-08T14:32:19.967Z","repository":{"id":43296959,"uuid":"119674725","full_name":"mudroljub/programming-quotes-api","owner":"mudroljub","description":"Programming Quotes API for open source projects.","archived":false,"fork":false,"pushed_at":"2024-02-13T10:15:08.000Z","size":946,"stargazers_count":450,"open_issues_count":2,"forks_count":63,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-12T12:08:10.252Z","etag":null,"topics":["api","backend-api","c-sharp","quotes-api"],"latest_commit_sha":null,"homepage":"","language":"C#","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/mudroljub.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,"publiccode":null,"codemeta":null}},"created_at":"2018-01-31T10:51:04.000Z","updated_at":"2024-06-04T09:56:38.891Z","dependencies_parsed_at":"2024-06-04T10:10:16.044Z","dependency_job_id":null,"html_url":"https://github.com/mudroljub/programming-quotes-api","commit_stats":null,"previous_names":["skolakoda/programming-quotes-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudroljub%2Fprogramming-quotes-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudroljub%2Fprogramming-quotes-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudroljub%2Fprogramming-quotes-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudroljub%2Fprogramming-quotes-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mudroljub","download_url":"https://codeload.github.com/mudroljub/programming-quotes-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247860915,"owners_count":21008382,"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","backend-api","c-sharp","quotes-api"],"created_at":"2024-08-01T16:00:52.648Z","updated_at":"2025-04-08T14:32:19.956Z","avatar_url":"https://github.com/mudroljub.png","language":"C#","readme":"# Programming Quotes API\n\n**Programming Quotes API for open source projects.**\n\nVisit: [programming-quotes-api.azurewebsites.net](https://programming-quotes-api.azurewebsites.net)\n\nGithub repo: [github.com/mudroljub/programming-quotes-api](https://github.com/mudroljub/programming-quotes-api)\n\nFeel free to get involved, suggest or implement new features.\n\n## API Documentation\n\n### Public Routes  \n\n#### GET [`/api/quotes/random`](/api/quotes/random)\n- **Description**: Fetches a random programming quote.  \n\n#### GET [`/api/quotes?author=Edsger_W._Dijkstra`](/api/quotes?author=Edsger_W._Dijkstra) \n#### GET [`/api/quotes?page=1\u0026quotesPerPage=20`](/api/quotes?page=1\u0026quotesPerPage=20) \n#### GET [`/api/quotes`](/api/quotes) \n- **Description**: Retrieves quotes, with optional query parameters:  \n  - `page`: The page number (default: 1).  \n  - `quotesPerPage`: Number of quotes per page (default: 20).  \n  - `author`: Filter quotes by a specific author.  \n\n#### GET `/api/quotes/:id`  \n- **Description**: Retrieves a single quote by its unique ID.  \n\n---\n\n### Protected Routes  \n\nAccess to these routes requires a valid token.  \n\n#### POST `/api/quotes/favorite/:id`\n- **Description**: Add quote to favorites\n\n#### POST `/api/quotes/vote/:id`\n- **Description**: Votes for a specific quote. \n- **Required Parameters** (in JSON body): \n  - `newVote`: A numeric value (1–5). \n\n#### POST `/api/quotes`  \n- **Description**: Adds a new quote.  \n- **Required Parameters** (in JSON body):  \n  - `author`: The name of the author (should match a Wikipedia entry).  \n  - `text`: The quote text.  \n- **Optional Parameters**:  \n  - `source`: The source or context of the quote.  \n\n#### PUT `/api/quotes/:id`  \n- **Description**: Updates an existing quote by ID.  \n- **Parameters** (in JSON body):  \n  - `author`, `text`, or `source`.  \n\n#### DELETE `/api/quotes/:id`  \n- **Description**: Deletes a quote by its unique ID.  \n\n---\n\n### Authentication  \n\n#### POST `/api/auth/token`  \n- **Description**: Logs in or registers a new user.  \n- **Required Parameters** (in JSON body):  \n  - `email`: The user's email address.  \n  - `password`: The user's password.  \n- **Returns**: A JWT token.  \n\n**Token Usage**: For all subsequent requests, include the token in the `Authorization` header as follows:  \n```\nAuthorization: Bearer \u003ctoken\u003e\n```  \n\n---\n\n## Development\n\n### Prerequisites\n\n- Install Node.js\n- Set environment variables\n\n### Setup database\n\nImport json file into local MongoDB database (replace with real values):\n\n```\nmongoimport --db quotes --collection quotes --file quotes.json --jsonArray --username quotes --password quotes\n```\n\n### Env variables\n\nCreate `.env` file proper values (this is an example):\n\n```\n# database credentials (obtain from MongoDB)\nCONNECTION_STRING=mongodb://quotes:quotes@localhost:27017/quotes\n\n# whatever random string you like\nJWT_SECRET=BILO ŠTA SAMO DA JE TAJNA\n\n# use development for local testing\nNODE_ENV=development \n```\n\n### Start\n\n```\nnpm i\nnpm run dev\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudroljub%2Fprogramming-quotes-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmudroljub%2Fprogramming-quotes-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudroljub%2Fprogramming-quotes-api/lists"}