Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Joyce-O/politico-react-app

Repository files navigation

politico-react-app

Politico enables citizens give their mandate to politicians running for different government offices while building trust in the process through transparency.

View live here

Build StatusCoverage Status Maintainability

Proposed Features

  • Users can sign up
  • Users can login
  • Admin (electoral body) can create political parties
  • Admin (electoral body) can delete a political party
  • Admin (electoral body) can create different ​ political offices
  • Users can vote for only one politician per ​ political office
  • Users can see the results of election
  • User can reset password
  • A politician can create a ​ petition​ against a concluded political office election

HTTP VERBAPI ENDPOINTDESCRIPTIONINPUTOUTPUT
POST api/v1/signup Signup user {
firstname: "string",
lastname: "string",
othername: "string",
email: "string",
phone: "string",
passportUrl: "string",
password: "string"
}
{
message: "string"}
POST api/v1/login Login user {
email: "string",
password: "string"
}
{
message: "string"}
POST /api/v1/parties Create a political party {
name: "string",
hqAddress: "string",
logoUrl: "string",
email: "string",
phone: "string"
}
{
message: "string"
party: {object}
}
GET /api/v1/parties/:partyId Fetch a specific ​ political party​ record {
message: "string",
party: {object}}
GET /api/v1/parties/ Fetch all ​ political parties​ records {
message: "string",
allParties: {object}
}
PATCH /api/v1/parties/:partyId/name Edit the name of a specific ​ political party partyId: "Number" {
message: "string",
foundParty: {object}
}
DELETE /api/v1/parties/:partyId> Delete a specific ​ political party partyId: "Number" {message: {object}}
POST /api/v1/offices Create a ​ political office {
name: "string",
type: "string",
candidateAge: "string",
qualification: "string"}
{
message: "string,"
office: {object}
}
GET api/v1/offices Fetch all ​ political offices​ records {
message: "string"
allOffices: {object}
}
GET api/v1/offices/:officeId Fetch a specific political office record officeId: "Number" {
message: "string",
office: {object}}

Technologies Used

  • Node.js - A runtime environment based off of Chrome's V8 Engine for writing Javascript code on the server.
  • Babel - Javascript transpiler.
  • Eslint - Javascript linter.
  • Express.js - Web framework based on Node.js.
  • Airbnb and style guide was followed.
  • React.js - A JavaScript library for building user interfaces

Testing tools

  • Mocha - A Javascript test framework.
  • Chai - Assertion library.

Installation

  1. Install NodeJs
npm install node
  1. Clone this repository using
git clone https://github.com/Joyce-O/politico.git
  1. Open the repository in terminal and Install dependencies by running:
npm install
  1. Run "npm start" to start the app

  2. Navigate to localhost:5700/api/v1 in your browser to access the application

  3. Use Postman to test all endpoints

Tests

  • The tests were written using Mocha and Chai-http
  • To run tests, navigate to the project's root directory
  • After installation, run the following command
    • npm run test

Author

  • Joyce Obi

About

Politico enables citizens give their mandate to politicians running for different government offices while building trust in the process through transparency.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors