https://github.com/gitegob/broadcaster-server
BroadCaster server
https://github.com/gitegob/broadcaster-server
Last synced: 2 months ago
JSON representation
BroadCaster server
- Host: GitHub
- URL: https://github.com/gitegob/broadcaster-server
- Owner: gitegob
- Created: 2020-07-03T20:11:27.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-03-03T11:25:54.000Z (about 2 years ago)
- Last Synced: 2025-01-24T20:19:54.241Z (4 months ago)
- Language: JavaScript
- Size: 1.87 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BroadCaster
[](https://codeclimate.com/github/gitego-brian/BroadCaster-server/maintainability)
Broadcaster enables any/every citizen to bring any form of corruption to the notice of appropriate authorities and the general public. Users can also report on things that need government intervention.

## [Documentation](https://documenter.getpostman.com/view/8741834/SW7Z48w7)
# API Endpoints included
- **POST /auth/signup:** Create an account
- **POST /auth/login:** Log into your account
- **POST /records/:** Create a new record
- **GET /records/:recordID:** Fetch a single record
- **GET /records:** Fetch all records
- **GET /records/red-flags:** Fetch all red-flag records
- **GET /records/interventions:** Fetch all intervention records
- **PATCH /records/:recordID:** Update a record
- **DELETE /records/:recordID:** Delete a record# Installation and Environment Setup
**Clone the repository from [Github](https://github.com/gitego-brian/BroadCaster).**
( You will need **Git** for this if you are running a Windows PC, Get it [HERE](https://git-scm.com/) )
```
git clone https://github.com/gitego-brian/BroadCaster.git
```**To Install all dependencies:**
```
npm install
```**To run the tests:**
```
npm run test
```**Now to start the app:**
```
npm run start
```**To start the app in development mode:**
( You need **nodemon** installed for this, run `npm i -g nodemon` to install it )
```
npm run dev
```Test the endpoints in your favorite API client, I strongly recommend [Postman](https://www.getpostman.com/) though :ok_hand:
## Sample Request
### Request body for sign up
```js
{
"firstName": "John",
"lastName": "Smith",
"email": "[email protected]",
"password": "complicatedPswd@111",
"userName": "jsmith",
"phone": "+112233445566"
}
```### Response body for signup
```js
{
"status": 201,
"message": "User created successfully",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiZmlyc3ROYW1lIjoiQmVuIiwibGFzdE5hbWUiOiJHaXNhIiwiZW1haWwiOiJnaXRlZ29iN0B5YWhvby5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNTc0MTczOTk1fQ.aEsCstbsBKGiGCGhF5GrShADpbxnTpq6wSBKXLlhIU"
}
}
```# Tools used
- Server-Side Framework: **Node/Express**
- Linter: **ESLint**
- Style Guide: **Airbnb**
- Testing framework: **Mocha/Chai**# More Tools
- Continuous integration: **[Travis-Ci](travis-ci.org)**
- ES6 Transpiler: **[Babel](babeljs.io)**
- Test coverage: **[nyc](https://www.npmjs.com/package/nyc)**
- Maintainability: **[Code climate](https://codeclimate.com)**
- Deployment: **[Heroku](https://www.heroku.com)** and **[Github pages](https://pages.github.com)**# Deployments
- The UI template is hosted on Github pages at https://gitego-brian.github.io/BroadCaster/UI
- The API is hosted on Heroku at http://brian-broadcaster.herokuapp.com/
# Contribute
If you ever have an idea on how you might help improve the app, yo are welcome to contribute your changes to the repository, Just follow the steps below:
Assumming you have the repo cloned on your PC,
- Pull the latest changes to the remote repo by running:
```
git pull origin develop
```NB: You need to be on the develop branch when you do this
- Create & switch the new branch where you will add your changes by running:
```
git checkout -b yournewbranchname
```- After adding your changes, commit and push them then create a pull request for against the develop branch. I will review and merge them if they are helpful.
# Author:
**Brian GITEGO**