A web app that enables citizens to bring corruption or crisis to the notice of the appropriate authorities and the general public.
Make sure you have NodeJS (>8.12.0), NPM (>6.4.1)
git clone https://github.com/chingsley/ireporter.git && cd ireporter
npm install
create a file named .env
. Include in it the variable: PORT=[YOUR CHOICE OF PORT]
npm start
Endpoint | Functionality | Notes |
---|---|---|
POST /auth/signup | Registers a User | |
POST /auth/login | login a User | |
POST /red-flags | create a new record | |
GET /red-flags | Get all records | |
GET /red-flags/:id | Get a particular record | |
PATCH /red-flags/:id/location | Edit a record's location | A user can only edit his own record, and no one else's |
PATCH /red-flags/:id/comment | Edit a redflag's comment | A user can only edit his own record, and no one else's |
PATCH /red-flags/:id/comment | Edit a redflag's comment | A user can only edit his own record, and no one else's |
DELETE /red-flags/:id | Delete a record | A user can only delete his own record, and no one else's |
----------------------------- | ---------------------- | --------------------------------------------------------- |
POST /interventions | create a new record | |
GET /interventions | Get all records | |
GET /interventions/:id | Get a particular record | |
PATCH /interventions/:id/location | Edit location | A user can only edit his own record, and no one else's |
PATCH /interventions/:id/comment | Edit comment | A user can only edit his own record, and no one else's |
DELETE /interventions/:id | Delete a record | A user can only delete his own record, and no one else's |
POST /api/v1/auth/signup
{
"firstname": "User's first name [required a minimum of 2 characters]",
"email": "User's valid email [required]",
"password": "User's password [required, a minimum of 6 characters ]",
"phoneNumber": "User's phoneNumber [required]",
"lastnames": "User's last name",
"othernames": "User's other names",
"username": "Preferred username",
}
*POST /api/v1/red-flags
{
"location": "latitude,longitude [required]",
"comment": "User's comment [required]",
"Image": ["array of uploaded images"],
"Video": ["array of uploaded videos"]
}
*POST /api/v1/interventions
{
"location": "latitude,longitude",
"comment": "User's comment",
"Image": ["array of uploaded images"],
"Video": ["array of uploaded videos"]
}
PATCH /red-flags/:id/location
{
"location": "latitude,longitude, [required]"
}
PATCH /red-flags/:id/commet
{
"comment": "some valid comment [required]"
}
PATCH /interventions/:id/location
{
"location": "latitude,longitude, [required]"
}
PATCH /interventions/:id/commet
{
"comment": "some valid comment [required]"
}
PATCH /interventions/:id/status
{
"status": "under-investigation"
}
PATCH /red-flags/:id/status
{
"status": "resolved"
}
-
DELETE /redflags/:id
-
DELETE /interventions/:id
npm test
... from the command line
-
UI Templates => GitHub Pages
-
Heroku => heroku link
-
Apiary => Apiary link