{"id":22404406,"url":"https://github.com/devdbrandy/ireporter","last_synced_at":"2026-03-09T23:04:35.337Z","repository":{"id":48273307,"uuid":"158228091","full_name":"devdbrandy/iReporter","owner":"devdbrandy","description":"iReporter app enables users (citizen) to bring any form of corruption to the notice of appropriate authorities and the general public","archived":false,"fork":false,"pushed_at":"2021-08-03T19:13:13.000Z","size":3970,"stargazers_count":3,"open_issues_count":22,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-19T02:45:05.779Z","etag":null,"topics":["citizen","citizen-participation","corruption","development","intervention","notice","rest-api"],"latest_commit_sha":null,"homepage":"https://irepot.herokuapp.com","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/devdbrandy.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}},"created_at":"2018-11-19T13:30:39.000Z","updated_at":"2024-11-05T05:14:27.000Z","dependencies_parsed_at":"2022-08-23T15:21:40.338Z","dependency_job_id":null,"html_url":"https://github.com/devdbrandy/iReporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devdbrandy/iReporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devdbrandy%2FiReporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devdbrandy%2FiReporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devdbrandy%2FiReporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devdbrandy%2FiReporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devdbrandy","download_url":"https://codeload.github.com/devdbrandy/iReporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devdbrandy%2FiReporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30316003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["citizen","citizen-participation","corruption","development","intervention","notice","rest-api"],"created_at":"2024-12-05T10:13:01.264Z","updated_at":"2026-03-09T23:04:35.316Z","avatar_url":"https://github.com/devdbrandy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eiReporter\u003ch1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/devdbrandy/iReporter.svg?branch=develop\"\u003e\n    \u003cimg src=\"https://travis-ci.org/devdbrandy/iReporter.svg?branch=develop\" /\u003e\u003c/a\u003e\n  \u003ca class=\"badge-align\" href=\"https://www.codacy.com/app/devdbrandy/iReporter?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=devdbrandy/iReporter\u0026amp;utm_campaign=Badge_Grade\"\u003e\n  \u003cimg src=\"https://api.codacy.com/project/badge/Grade/af41b75a4052458888f44cd39007295a\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://codeclimate.com/github/devdbrandy/iReporter/maintainability\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/d7a820f64a5fb926de6a/maintainability\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://codeclimate.com/github/devdbrandy/iReporter/test_coverage\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/d7a820f64a5fb926de6a/test_coverage\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-brightgreen.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Overview\n\niReporter app enables users (citizen) to bring any form of corruption to the notice of appropriate authorities and the general public. Visit iReporter live demo: [https://devdbrandy.github.io/iReporter](https://devdbrandy.github.io/iReporter).\n\n\u003eDemo Users\n\u003e\n\u003e| Username  | Password | Access       |\n\u003e|-----------|----------|--------------|\n\u003e| `admin`   | `secret` | Admin Access |\n\u003e| `user123` | `secret` | User Access  |\n\n\u003c!-- TOC depthFrom:2 --\u003e\n\n- [Overview](#overview)\n  - [1. :rocket: Getting Started](#1-rocket-getting-started)\n    - [1.1 Prerequisites](#11-prerequisites)\n    - [1.2. Run locally](#12-run-locally)\n    - [1.3. Building](#13-building)\n    - [1.4. Test Locally](#14-test-locally)\n    - [1.5. Running Test](#15-running-test)\n  - [2. :lock: Authentication](#2-lock-authentication)\n  - [3. API Versioning](#3-api-versioning)\n  - [4. HTTP Requests](#4-http-requests)\n  - [5. HTTP Response Codes](#5-http-response-codes)\n  - [:bookmark: 6. Resources](#bookmark-6-resources)\n    - [6.1. Authentication](#61-authentication)\n    - [6.2. API Routes](#62-api-routes)\n  - [7. :pencil: License](#7-pencil-license)\n\n\u003c!-- /TOC --\u003e\n\n## 1. :rocket: Getting Started\n\n### 1.1 Prerequisites\n\nEnsure that you have the following installed on your local machine:\n\n- [NodeJS](https://nodejs.org/en/download/)\n- [PostgreSQL](https://www.postgresql.org/download/)\n\n### 1.2. Run locally\n\n- To run app locally, make sure you have `nodejs`, `postgres` installed.\n- Clone repository or clone your own fork\n\n  ```bash\n    git clone https://github.com/devdbrandy/iReporter.git\n    cd iReporter\n    cp .env.example .env\n    npm install\n  ```\n\n- Create a PostgreSQL database for the project via `pgAdmin` or run the below command on your terminal:\n\n    ```bash\n      createdb -h localhost -p 5432 -U postgres ireporter\n    ```\n\n- Configure `.env` environment variable with your credentials\n- Run migration `npm run migrate`\n- (Optional) Seed dummy data `npm run db:seed`\n- Two npm scripts are availiable to spin up the app server:\n  - `npm run dev` spin up the server without watching for any file changes\n  - `npm run watch` watches for any file changes and reloads the server\n\n### 1.3. Building\n\n`npm run build`\n\n### 1.4. Test Locally\n\nTo test or consume api locally, you can make use of [*Postman*](https://www.getpostman.com) or [*Insomnia*](https://insomnia.rest/download/)\n\n### 1.5. Running Test\n\nTest specs are implemented using [*mocha*](https://mochajs.org) + [*chai*](https://chiajs.com) + [*sinon*](https://sinonjs.org).\n\nMake a duplicate of `.env` and rename to `.env.test`, then configure your test credentials.\n\nTwo npm scripts are available to run the test suite:\n\n1. `npm run mocha` or `npm run mocha:watch` - The later watches for any file changes and runs the full test suite (without code coverage)\n2. `npm test` - Performs a single full test suite run, including instanbul code coverage reporting. Summary coverage reports are written to stdout, and detailed HTML reports are available in `/coverage/index.html`\n\n## 2. :lock: Authentication\n\nAccess to restricted API endpoints requires an access token, iReporter uses access tokens to associate API requests with your account. To obtain your access token, make a request along with `username` and `password` credentials to `https://irepot.herokuapp.com/auth/login`\n\n**Sample Response:**\n\n```http\nPOST https://irepot.herokuapp.com/auth/login\nHTTP/1.1\nAccept: application/json\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n  \"status\": 200,\n  \"data\": [\n    {\n      \"token\": \"...\",\n      \"user\": {}\n    }\n  ]\n}\n```\n\n## 3. API Versioning\n\nThe second part of the URI specifies the API version you wish to access in the format `v{version_number}`.\nFor example, version 1 of the API (most current) is accessible via:\n\n```http\n  https://irepot.herokuapp.com/api/v1\n```\n\n## 4. HTTP Requests\n\nAll API requests are made by sending  asecure HTTPS request using one of the following methods, depending on the being taken:\n\n- `POST` Create a resource\n- `PATCH` Update a resource\n- `GET` Get a resource or list of resources\n- `DELETE` Delete a resource\n\nFor `POST` and `PATCH` requests, the body of your request may include a JSON payload.\n\n## 5. HTTP Response Codes\n\nEach response will be returned with one of the following HTTP status codes:\n\n- `200` `OK` The request was successful\n- `400` `Bad Request` There was a problem with the request (security, malformed)\n- `401` `Unauthorized` The supplied API credentials are invalid\n- `403` `Forbidden` The credentials provided do not have permissions to access the requested resource\n- `404` `Not Found` An attempt was made to access a resource that does not exist in the API\n- `500` `Server Error` An error on the server occurred\n\n## :bookmark: 6. Resources\n\n### 6.1. Authentication\n\n  | URI                                                        | HTTP Method | Description    |\n  |------------------------------------------------------------|:-----------:|----------------|\n  | [\u003ccode\u003e**/auth/signup**\u003c/code\u003e](/docs/auth/POST_signup.md) | `POST`      | Create new account |\n  | [\u003ccode\u003e**/auth/login**\u003c/code\u003e](/docs/auth/POST_login.md)   | `POST`      | Login into account  |\n\n### 6.2. API Routes\n\n  | URI | HTTP Method | Description |\n  |-----|:-----------:|-------------|\n  | [\u003ccode\u003e**/api/v1/users**\u003c/code\u003e](/docs/users/GET_list.md)                           | `GET`       | Fetch all users |\n  | [\u003ccode\u003e**/api/v1/users/{id}**\u003c/code\u003e](/docs/users/GET_id.md)                        | `GET`       | Fetch a single user by ID |\n  | [\u003ccode\u003e**/api/v1/users/{id}**\u003c/code\u003e](/docs/users/PUT_id.md)                        | `PUT`       | Update entire user resource |\n  | [\u003ccode\u003e**/api/v1/records**\u003c/code\u003e](/docs/records/GET_list.md)                           | `GET`       | Fetch all records |\n  | [\u003ccode\u003e**/api/v1/red-flags**\u003c/code\u003e](/docs/red_flags/GET_list.md)                           | `GET`       | Fetch all red-flag records |\n  | [\u003ccode\u003e**/api/v1/red-flags/{id}**\u003c/code\u003e](/docs/red_flags/GET_id.md)                        | `GET`       | Fetch a single red-flag by ID record |\n  | [\u003ccode\u003e**/api/v1/red-flags**\u003c/code\u003e](/docs/red_flags/POST_create.md)                        | `POST`      | Create a new red-flag record |\n  | [\u003ccode\u003e**/api/v1/red-flags/{id}/location**\u003c/code\u003e](/docs/red_flags/PATCH_location.md)       | `PATCH`     | Update a red-flag's location |\n  | [\u003ccode\u003e**/api/v1/red-flags/{id}/comment**\u003c/code\u003e](/docs/red_flags/PATCH_comment.md)         | `PATCH`     | Update a red-flag's comment |\n  | [\u003ccode\u003e**/api/v1/red-flags/{id}**\u003c/code\u003e](/docs/red_flags/DELETE_id.md)                     | `DELETE`    | Delete a red-flag by ID |\n  | [\u003ccode\u003e**/api/v1/interventions**\u003c/code\u003e](/docs/interventions/GET_list.md)                     | `GET`       | Fetch all intervention records |\n  | [\u003ccode\u003e**/api/v1/interventions/{id}**\u003c/code\u003e](/docs/interventions/GET_id.md)                  | `GET`       | Fetch all intervention records |\n  | [\u003ccode\u003e**/api/v1/interventions**\u003c/code\u003e](/docs/interventions/POST_create.md)                  | `POST`      | Create a new intervention record |\n  | [\u003ccode\u003e**/api/v1/interventions/{id}/location**\u003c/code\u003e](/docs/interventions/PATCH_location.md) | `PATCH`     | Update an intervention's location |\n  | [\u003ccode\u003e**/api/v1/interventions/{id}/comment**\u003c/code\u003e](/docs/interventions/PATCH_comment.md)   | `PATCH`     | Update an intervention's comment |\n  | [\u003ccode\u003e**/api/v1/interventions/{id}**\u003c/code\u003e](/docs/interventions/DELETE_id.md)               | `DELETE`    | Delete an intervention by ID |\n\n## 7. :pencil: License\n\nThe iReporter REST API is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevdbrandy%2Fireporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevdbrandy%2Fireporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevdbrandy%2Fireporter/lists"}