Skip to content

Commit

Permalink
Merge 71bd9c1 into bb3d156
Browse files Browse the repository at this point in the history
  • Loading branch information
nedssoft committed Feb 8, 2019
2 parents bb3d156 + 71bd9c1 commit 1a8221f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
44 changes: 38 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ Politico enables citizens give their mandate to politicians running for differen
* git checkout develop
* npm install
* touch .env && cp .env.example .env
* Added the postgress connectionString
* Add the postgress connectionString

### To get connectionString
* Visit https://www.elephantsql.com/
* create an account and then create two database instances one for test and dev
* In the .env, assign the connectionString above each for DB_TEST and DB_DEV

### Migration
# To generate the database tables run,
- npm run migrate && npm run migrate:seed

# To drop the tables, run
- npm run migrate:reset

### How to run the automated test
* npm run test

Expand All @@ -52,11 +61,34 @@ The UI is hosted on gh-pages
- Admin or Electoral Board can create political parties
- Admin can create political offices
- Admin can approve or rejects aspirants application requests
- Users can view all political parties and political offices
- Users can view candidates contesting for a given political office
- Users can vote
- Users can view the results of a concluded election
- Users can file petitions for an unsatisfied election result
- Admin can delete political parties
- Admin can edit political parties
- Admin can register candidates for a given political office
- Users/Admin can view all political parties and political offices
- Users/Admin can view candidates contesting for a given political office
- Users/Admin can vote
- Users/Admin can view the results of a concluded election
- Users/Admin can sign up
- Users/Admin can log in
- Users/Politicans can file petitions for an unsatisfied election result


### Endpoints
- Sign up [POST] https://oriechinedu-politico.herokuapp.com/api/v1/auth/signup
- Login [POST] https://oriechinedu-politico.herokuapp.com/api/v1/auth/login
- Create Political Office [POST] https://oriechinedu-politico.herokuapp.com/api/v1/offices/
- Get single political office [GET] https://oriechinedu-politico.herokuapp.com/api/v1/offices/<officeId>
- Get all political offices [GET] https://oriechinedu-politico.herokuapp.com/api/v1/offices/
- Create a political party [POST] https://oriechinedu-politico.herokuapp.com/api/v1/parties
- Get a political party [GET] https://oriechinedu-politico.herokuapp.com/api/v1/parties/<partyId>
- Edit a political party [PATCH] https://oriechinedu-politico.herokuapp.com/api/v1/parties/<partyId>
- Delete a political party [DELETE] https://oriechinedu-politico.herokuapp.com/api/v1/parties/<partyId>
- Get all political party [GET] https://oriechinedu-politico.herokuapp.com/api/v1/parties
- Register a candidate [POST] https://oriechinedu-politico.herokuapp.com/api/v1/office/<userId>/register
- Vote a candidate [POST] https://oriechinedu-politico.herokuapp.com/api/v1/vote
- View Election Result [GET] https://oriechinedu-politico.herokuapp.com/api/v1/office/<officeId>/result
- View Candidates [GET] https://oriechinedu-politico.herokuapp.com/api/v1/candidates


### How to contribute
Detail coming soon
1 change: 0 additions & 1 deletion UI/assets/css/util.css
Original file line number Diff line number Diff line change
Expand Up @@ -876,4 +876,3 @@ select:hover{
width: 30vw;
}
}
}
4 changes: 2 additions & 2 deletions UI/assets/js/login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const signIn = document.getElementById('sign-in');

signIn.addEventListener('click', (e) => {
e.preventDefault();
window.location = 'profile.html';
e.preventDefault();
window.location = 'profile.html';
});
4 changes: 2 additions & 2 deletions UI/assets/js/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
const signUp = document.getElementById('sign-up');

signUp.addEventListener('click', (e) => {
e.preventDefault();
window.location = 'login.html';
e.preventDefault();
window.location = 'login.html';
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
},
"homepage": "https://github.com/oriechinedu/Politico#readme",
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.2.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-runtime": "^6.26.0",
"coveralls": "^3.0.2",
Expand All @@ -39,6 +38,7 @@
"nyc": "^13.1.0"
},
"dependencies": {
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/core": "^7.2.2",
"@babel/node": "^7.2.2",
"@babel/polyfill": "^7.2.5",
Expand Down

0 comments on commit 1a8221f

Please sign in to comment.