Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#167313387 Configure Postgres and Sequelize #4

Merged
merged 1 commit into from
Jul 31, 2019

Conversation

habinezadalvan
Copy link
Contributor

What does this PR do?

  • Configures Authors Haven to use PostgreSQL as DB Engine and Sequelize.

  • Configures babel

Description of Task to be completed?

  • Created the src folder with config, migrations, models, seeds folders

  • installed sequelize, pg, pg-hstore

  • Created authors-heaven database

  • Configured the Postgres

  • Created User model and run migrations to conform that tables are being created in authors heaven database

How should this be manually tested?

  • Clone the repo, run , create "authors-heaven" db, create .env file and include credentials as specified in the config.js inside config folder, the run
    Screenshot

Screen Shot 2019-07-30 at 22 02 21

What are the relevant pivotal tracker stories?
#167313387

@mikeanguandia @minega25 @salviosage @nshutijonathan @nkalyesubula @Mnickii

@@ -0,0 +1,14 @@
'use strict';
module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,14 @@
'use strict';
module.exports = (sequelize, DataTypes) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
'module' is not defined.

@@ -0,0 +1,14 @@
'use strict';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the function form of "use strict".

db[model.name] = model;
});

Object.keys(db).forEach(modelName => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');
})
.forEach(file => {
const model = sequelize['import'](path.join(__dirname, file));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

import fs from 'fs';
import path from 'path';
import Sequelize from 'sequelize';
const basename = path.basename(__filename);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

import 'dotenv/config';
import fs from 'fs';
import path from 'path';
import Sequelize from 'sequelize';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,37 @@
import 'dotenv/config';
import fs from 'fs';
import path from 'path';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,37 @@
import 'dotenv/config';
import fs from 'fs';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,37 @@
import 'dotenv/config';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch from beaa0dd to 1904176 Compare July 30, 2019 21:43
}
});
},
down: (queryInterface, Sequelize) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,38 @@
module.exports = {
up: (queryInterface, Sequelize) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

@@ -0,0 +1,35 @@
import 'dotenv/config'

const {DB_USER, DB_PASSWORD, DB_PORT} = process.env;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'destructuring binding' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -0,0 +1,35 @@
import 'dotenv/config'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').
Missing semicolon.

Copy link
Contributor

@minega25 minega25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In src/config/config.js I would suggest the database name for the test environment to match one used in travis which is authorsheaven_test.

const User = sequelize.define('User', {
firstname: DataTypes.STRING,
lastname: DataTypes.STRING,
username: DataTypes.STRING,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please allow null as false from here? yesterday at the sync patrick. minega suggested about that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About constraints, as a team, I remember that we agreed on that whoever going to need User model will be the one to mention all the constraints, columns necessary. For now, the User model is a dummy just for confirming that the tables are being created in the database whenever we run the migration. Thank you

Copy link
Collaborator

@salviosage salviosage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work, however, could you please try to extract most of config var in .env instead of statically type it .like for example database, host.., like that variables are going to change from time to time so you don't have to be specific for them.

Copy link
Contributor

@nkalyesubula nkalyesubula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Christian. I suggest though that you change the port to 5432 every time you push as leaving it as 5433 will cause issues when running tests on Travis. Also, consider creating global variables in the .env file for the database name, and host

@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch from 1904176 to e58fd8a Compare July 31, 2019 09:40
email: DataTypes.STRING,
password: DataTypes.STRING
}, {});
User.associate = function(models) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'models' is defined but never used no-unused-vars

@@ -0,0 +1,13 @@
module.exports = (sequelize, DataTypes) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined no-undef

@@ -0,0 +1,37 @@
import 'dotenv/config';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

}
});
},
down: (queryInterface, Sequelize) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Sequelize' is defined but never used no-unused-vars

@@ -0,0 +1,38 @@
module.exports = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined no-undef

@@ -0,0 +1,33 @@
import 'dotenv/config'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

@minega25 minega25 self-requested a review July 31, 2019 09:45
@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch from e58fd8a to e306106 Compare July 31, 2019 09:53
.babelrc Outdated
{
"presets": ["@babel/preset-env"],
"plugins": [["@babel/transform-runtime"]]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.sequelizerc Outdated
'migrations-path': path.resolve('src', 'migrations'),
'models-path': path.resolve('src', 'models'),
'seeders-path': path.resolve('src', 'seeders'),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

port: DB_PORT,
seederStorage: 'sequelize'
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// associations can be defined here
};
return User;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new line

@salviosage salviosage self-requested a review July 31, 2019 10:19
@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch 2 times, most recently from b5402c2 to 39a75b8 Compare July 31, 2019 11:37
@@ -0,0 +1,17 @@
module.exports = (sequelize, DataTypes) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined no-undef

@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch 2 times, most recently from 1cf24ab to ee73bff Compare July 31, 2019 11:42
type: Sequelize.DATE
}
}),
down: (queryInterface, Sequelize) => queryInterface.dropTable('Users')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Sequelize' is defined but never used no-unused-vars

@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch from ee73bff to 0b5ece0 Compare July 31, 2019 13:30
@@ -0,0 +1,34 @@
module.exports = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'module' is not defined no-undef

Instlled sequelize
created src folder with config, migrations, models, seeds folders
configured postgres
created User model
Configured babel

[Finishes #167313387]
[Finishes #167595103]
@habinezadalvan habinezadalvan force-pushed the ch-setup-postgres-sequelize-167313387 branch from 0b5ece0 to 7c0138b Compare July 31, 2019 16:26
@Mnickii Mnickii merged commit 0714f36 into develop Jul 31, 2019
Mnickii added a commit that referenced this pull request Aug 29, 2019
* [[Start #167319073] started dotenv.

* [Finishes:#167319073]rearranged envirables.

* chore(updated readme):added secret env variable[finishes #167319073]

* chore(updated readme):added port value[finishes #167319073]

* chore(updated readme):added secret key[finishes #167319073]

* #167313388 configure eslint  (#2)

* chore(eslint) add eslint dev dependencies

add eslint config airbnbbase and eslint import pligin dependencies

[Start #167313388]

* chore(eslint) add .eslintrc file

[Continue #167313388]

* chore(eslint) delete unwanted folders

[Continue #167313388]

* chore(eslint) delete unwanted files

[Continue #167313388]

* chore(eslint) add eslint dev dependencies

add eslint config airbnbbase and eslint import pligin dependencies

[Start #167313388]

* chore(eslint) add .eslintrc file

[Continue #167313388]

* chore(eslint) delete unwanted files

[Continue #167313388]

* #167313386 Integrate TravisCI with readme badge (#3)

* chore(setup-travis-ci):Integrate TravisCI with readme badge [Finishes #167313386]

* chore(setup-travis-ci):Fix the failing travis [Finishes #167313386]

* chore(setup-travis-ci):Integrate travis CI with README  [Finishes #167313386]

* chore(setup-travis-ci):Change npm install to npm ci  [Finishes #167313386]

* chore(setup-travis-ci):Update the lock file  [Finishes #167313386]

* chore(configure postgres and sequelize): (#4)

Instlled sequelize
created src folder with config, migrations, models, seeds folders
configured postgres
created User model
Configured babel

[Finishes #167313387]
[Finishes #167595103]

* #167313394 Setup API documentation using swagger (#6)

* chore(api-doc): Setup API documentation using swagger

* chore(api documentation): Setup api documentation using swagger

  - create entry point of application in src/app.js
  - create swagger specification implementation in src/swagger.js
  - create api documentation endpoint in src/routes/api/inde.route.js
  - create 404 error route handler
  - create 500 error route handler
  - create pull request template

[Finishes #167313394]

* #167313389 Integrated HoundCi  (#5)

* chore(houndci):added .hound.yml[finished#1167313389]

* chore(houndci):added houndci badge[finishes#1167313389]

* chore(houndci):added added new line .hound.yml[finishes#1167313389]

* Ch api test setup 167313391 (#7)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* Update package.json

* modify test script to report coverage

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* modify test script to report coverage

* #167313389 Integrated HoundCi  (#5)

* chore(houndci):added .hound.yml[finished#1167313389]

* chore(houndci):added houndci badge[finishes#1167313389]

* chore(houndci):added added new line .hound.yml[finishes#1167313389]

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* Update package.json

* modify test script to report coverage

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* modify test script to report coverage

* chore(coveralls):added coveralls badge[Finishes #167313393]

* add coveralls badge, change to use expect for assetion and fix typo

* remove duplicate application title

* remove duplicate title and improve index route test

* #167313390 deploy base application to heroku  (#8)

* chore(heroku) add app.json file

to enable heroku to review each open pull request so that we can test app on heroku before merging branch to develop
[Starts #167313390]

* chore(heroku) add procfile
[Continue  #167313390]

* chore(heroku) add app.json file

to enable heroku to review each open pull request so that we can test app on heroku before merging branch to develop
[Starts #167313390]

* chore(heroku) add procfile
[Continue  #167313390]

* chore(heroku) add index.js to test
[Continue  #167313390]

* chore(heroku) add index.js to test
[Continue  #167313390]

* chore(heroku) rebase from develop
[Continue  #167313390]

* chore(heroku) finish heroku configuration
[Finishes  #167313390]

* fix covaralls badge (#9)

* #167313396 Build out Admin REST endpoints for resources(CRUD) (#10)

* updated develop branch

* feature(apis):implemented crud operations[finishes:167313396]

* feature(users):added username fields[finished:167313396]

* feature(code-refactoring):fixed-eslint[Finish:167313396]

* feature(tests):added tests[Finishes:167313396]

* feature(testing):added tests[Finishes:#167313396]

* feature(testing):fixed travis[Finishes:167313396]

* #167313398 Users should receive descriptive signup/Registration validation errors (#11)

* feature(signup-validations):Users should receive descriptive signup/Registration validation errors [Finishes 167313398]

* (signup-validation):Refactor validations [Finishes #167313398]

* (signup-validation):Refactor signup validations [Finishes #167313398]

* #167313399 User should be able to sign out (#12)

* feature(signout): add user signout logic

* feature(logout): add user can logout functionality

* feature(email verification): Email should be verified before a registered user gets access to different routes [Finishes #167313397] (#13)

* bg(heroku) rename Procfile file (#15)

* bg(heroku) rename Procfile file

[Starts #167804454]

* bg(heroku) rebasing

[Finishes  #167804454]

* bg(coveralls): add coverage script (#16)

* chore(improve test coverage): improves the test coverage [Finishes 167815352] (#17)

* feature(reset password): add user reset password functionality [Finishes #167313400] (#18)

* Ft api social login 167313401 (#14)

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* Purpose

  Add social login feature

Tasks to be accomplished

  - Enable social login via twitter, google and facebook
  - Add creation of new users from social accounts on login
  - Document routes

How can this feature be tested manualy

  - In the browser address bar, enter the url https://codepirates-ah-backend.herokuapp.com/login/<social>,
where social can be facebook, google or twitter
  - In the resulting window, enter your credentials for the given social platform
  - If your account exists with this app, you should be logged in and your details and a token displayed in the browser
  - If your account does not exist, you will get a message in the broswer asking to creat an account
  - Enter https://codepirates-ah-backend.herokuapp.com/signup/social in the browser address bar and hit enter
  - You will get a message that your account has been created and a verification email sent along with your details and an access token

Pivotal tracker story

  [finishes #167313401]

* disable failing tests for further inspection

* resolve merge conflict

* Purpose of this commit:

  Resolve build failure

Story ID

  [finished #167313401](https://www.pivotaltracker.com/story/show/167313401)

* fix history packag-lock error

* work around twitter account security concern

* work around twitter account security concern

* pp

* twitter security

* twitter security

* twitter security

* Update test-socialLogin.js

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* Purpose

  Add social login feature

Tasks to be accomplished

  - Enable social login via twitter, google and facebook
  - Add creation of new users from social accounts on login
  - Document routes

How can this feature be tested manualy

  - In the browser address bar, enter the url https://codepirates-ah-backend.herokuapp.com/login/<social>,
where social can be facebook, google or twitter
  - In the resulting window, enter your credentials for the given social platform
  - If your account exists with this app, you should be logged in and your details and a token displayed in the browser
  - If your account does not exist, you will get a message in the broswer asking to creat an account
  - Enter https://codepirates-ah-backend.herokuapp.com/signup/social in the browser address bar and hit enter
  - You will get a message that your account has been created and a verification email sent along with your details and an access token

Pivotal tracker story

  [finishes #167313401]

* disable failing tests for further inspection

* resolve merge conflict

* Purpose of this commit:

  Resolve build failure

Story ID

  [finished #167313401](https://www.pivotaltracker.com/story/show/167313401)

* fix history packag-lock error

* work around twitter account security concern

* work around twitter account security concern

* pp

* twitter security

* twitter security

* twitter security

* Update test-socialLogin.js

* respond to feedback

* fix merge error

* feature(social auth): add social authentication functionality

* #167313409 Users should be able to follow each other (#20)

* rebase

* feature(follow-users):Users should be able to follow each other [Finishes #167313409]

* feature(follow-users):Improve follow user tests[Finishes #167313409]

* feature(create articles): user can create, read, update, and delete an article [Finishes #167313403] (#19)

* #167313402  user profile CRUD operation (#22)

*  controller business logic

* adding testing and validation

[Continue #167313402]

* remove unwanted dependency

* feature(rate article): add user should be able to give a rating to an article [Finishes 167313404] (#21)

*  updated develop (#23)

* feature(view authors' profiles): user can view the profiles of all authors [Finishes #167313413] (#24)

* feature(commentes):added comment controllers-167313407 (#26)

* bug(improve api doc): make api documentation more readable and interactive (#28)

[Finishes #167942825]

* Ft like dislike article 167313408 (#29)

* add migration models

* routes

* docummentation

* feature(read time): add users should be able to see time it takes to read an article functinality (#30)

[Finishes #167313415]

* bug(fixing create article mocking tests):Only cloudinary function is mocked instead of the whole creating article route [Finishes #168000401] (#31)

* unhandled sendgrid error fix (#34)

* #167313412 pagination support for articles (#33)

* feauture(pagination) start paggination  to an article

[Starts #167313412]

* add business logic for pagination support

* finishing pagination

[Finishes #167313412]

* feature(search functionality): you can search article by title, keyword from description, tags, author [Finishes #167313414] (#32)

* #167313410 Users should be able to receive notifications (#35)

*  updated develop

* User should get notifications

* feature(notifications): User should be able to get notifications [Finishes #167313410]

* feature(notifications):Remove unnecessary files [Finishes #167313410]

* feature(notifications):Remove all unnecessary files [Finishes #167313410]

* feature(notifications):Remove nodemailer files [Finishes #167313410]

* bg(mock fail): add mock test for interaction with external I/O services (#42)

* #167313411 Authenticated users should be able to tag articles (#37)

* #167313411 Users should be able to tag articles

* remove console.log

* enable all tests

* #167313418 report article (#43)

* ft(report) add table and migration file

[Starts #167313418]

* adding business logic

* feature(report) add routing and middleware

[Continue #167313418]

* finish reporting functionality

* reporting(testing) add testing for reporting article endpoint

[Contimue #167313418]

* reporting(rebasing) rebasing from develop

[Continue #167313418]

* worked on feedback

* #167313417 Users should be able to bookmark articles for later reading (#44)

* feature(create articles): user can create, read, update, and delete an article [Finishes #167313403]

* basic bookmarking

* #167313417 user should be able to bookmark articles

* fix error in package-lock

* add package lock to git ignore

* correct status codes and refactor

* remove cascsede update for user to article association

* feature(highlight text in the article): user can highlight a content in the article, comment on the highlight, and share the highlight on different social platforms [Finishes #167313423] (#47)

* feature(package.lock):deleted[finished:167313424] (#45)

* #167313416 Users should be able to share articles across different channels (#46)

* save changes

* feature(share-articles): Users should be able to share articles across different channels [Finishes #167313416]

* feature(share-articles): Use util helper fuctions [Finishes #167313416]

* reset to previous commit

* Updated doc.yml file
minega25 pushed a commit that referenced this pull request Aug 30, 2019
Instlled sequelize
created src folder with config, migrations, models, seeds folders
configured postgres
created User model
Configured babel

[Finishes #167313387]
[Finishes #167595103]
Mnickii added a commit that referenced this pull request Sep 2, 2019
* #167313388 configure eslint  (#2)

* chore(eslint) add eslint dev dependencies

add eslint config airbnbbase and eslint import pligin dependencies

[Start #167313388]

* chore(eslint) add .eslintrc file

[Continue #167313388]

* chore(eslint) delete unwanted folders

[Continue #167313388]

* chore(eslint) delete unwanted files

[Continue #167313388]

* chore(eslint) add eslint dev dependencies

add eslint config airbnbbase and eslint import pligin dependencies

[Start #167313388]

* chore(eslint) add .eslintrc file

[Continue #167313388]

* chore(eslint) delete unwanted files

[Continue #167313388]

* #167313386 Integrate TravisCI with readme badge (#3)

* chore(setup-travis-ci):Integrate TravisCI with readme badge [Finishes #167313386]

* chore(setup-travis-ci):Fix the failing travis [Finishes #167313386]

* chore(setup-travis-ci):Integrate travis CI with README  [Finishes #167313386]

* chore(setup-travis-ci):Change npm install to npm ci  [Finishes #167313386]

* chore(setup-travis-ci):Update the lock file  [Finishes #167313386]

* chore(configure postgres and sequelize): (#4)

Instlled sequelize
created src folder with config, migrations, models, seeds folders
configured postgres
created User model
Configured babel

[Finishes #167313387]
[Finishes #167595103]

* #167313394 Setup API documentation using swagger (#6)

* chore(api-doc): Setup API documentation using swagger

* chore(api documentation): Setup api documentation using swagger

  - create entry point of application in src/app.js
  - create swagger specification implementation in src/swagger.js
  - create api documentation endpoint in src/routes/api/inde.route.js
  - create 404 error route handler
  - create 500 error route handler
  - create pull request template

[Finishes #167313394]

* #167313389 Integrated HoundCi  (#5)

* chore(houndci):added .hound.yml[finished#1167313389]

* chore(houndci):added houndci badge[finishes#1167313389]

* chore(houndci):added added new line .hound.yml[finishes#1167313389]

* Ch api test setup 167313391 (#7)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* Update package.json

* modify test script to report coverage

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* modify test script to report coverage

* #167313389 Integrated HoundCi  (#5)

* chore(houndci):added .hound.yml[finished#1167313389]

* chore(houndci):added houndci badge[finishes#1167313389]

* chore(houndci):added added new line .hound.yml[finishes#1167313389]

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* Update package.json

* modify test script to report coverage

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* modify test script to report coverage

* chore(coveralls):added coveralls badge[Finishes #167313393]

* add coveralls badge, change to use expect for assetion and fix typo

* remove duplicate application title

* remove duplicate title and improve index route test

* #167313390 deploy base application to heroku  (#8)

* chore(heroku) add app.json file

to enable heroku to review each open pull request so that we can test app on heroku before merging branch to develop
[Starts #167313390]

* chore(heroku) add procfile
[Continue  #167313390]

* chore(heroku) add app.json file

to enable heroku to review each open pull request so that we can test app on heroku before merging branch to develop
[Starts #167313390]

* chore(heroku) add procfile
[Continue  #167313390]

* chore(heroku) add index.js to test
[Continue  #167313390]

* chore(heroku) add index.js to test
[Continue  #167313390]

* chore(heroku) rebase from develop
[Continue  #167313390]

* chore(heroku) finish heroku configuration
[Finishes  #167313390]

* fix covaralls badge (#9)

* #167313396 Build out Admin REST endpoints for resources(CRUD) (#10)

* updated develop branch

* feature(apis):implemented crud operations[finishes:167313396]

* feature(users):added username fields[finished:167313396]

* feature(code-refactoring):fixed-eslint[Finish:167313396]

* feature(tests):added tests[Finishes:167313396]

* feature(testing):added tests[Finishes:#167313396]

* feature(testing):fixed travis[Finishes:167313396]

* #167313398 Users should receive descriptive signup/Registration validation errors (#11)

* feature(signup-validations):Users should receive descriptive signup/Registration validation errors [Finishes 167313398]

* (signup-validation):Refactor validations [Finishes #167313398]

* (signup-validation):Refactor signup validations [Finishes #167313398]

* #167313399 User should be able to sign out (#12)

* feature(signout): add user signout logic

* feature(logout): add user can logout functionality

* feature(email verification): Email should be verified before a registered user gets access to different routes [Finishes #167313397] (#13)

* bg(heroku) rename Procfile file (#15)

* bg(heroku) rename Procfile file

[Starts #167804454]

* bg(heroku) rebasing

[Finishes  #167804454]

* bg(coveralls): add coverage script (#16)

* chore(improve test coverage): improves the test coverage [Finishes 167815352] (#17)

* feature(reset password): add user reset password functionality [Finishes #167313400] (#18)

* Ft api social login 167313401 (#14)

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* Purpose

  Add social login feature

Tasks to be accomplished

  - Enable social login via twitter, google and facebook
  - Add creation of new users from social accounts on login
  - Document routes

How can this feature be tested manualy

  - In the browser address bar, enter the url https://codepirates-ah-backend.herokuapp.com/login/<social>,
where social can be facebook, google or twitter
  - In the resulting window, enter your credentials for the given social platform
  - If your account exists with this app, you should be logged in and your details and a token displayed in the browser
  - If your account does not exist, you will get a message in the broswer asking to creat an account
  - Enter https://codepirates-ah-backend.herokuapp.com/signup/social in the browser address bar and hit enter
  - You will get a message that your account has been created and a verification email sent along with your details and an access token

Pivotal tracker story

  [finishes #167313401]

* disable failing tests for further inspection

* resolve merge conflict

* Purpose of this commit:

  Resolve build failure

Story ID

  [finished #167313401](https://www.pivotaltracker.com/story/show/167313401)

* fix history packag-lock error

* work around twitter account security concern

* work around twitter account security concern

* pp

* twitter security

* twitter security

* twitter security

* Update test-socialLogin.js

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* Purpose

  Add social login feature

Tasks to be accomplished

  - Enable social login via twitter, google and facebook
  - Add creation of new users from social accounts on login
  - Document routes

How can this feature be tested manualy

  - In the browser address bar, enter the url https://codepirates-ah-backend.herokuapp.com/login/<social>,
where social can be facebook, google or twitter
  - In the resulting window, enter your credentials for the given social platform
  - If your account exists with this app, you should be logged in and your details and a token displayed in the browser
  - If your account does not exist, you will get a message in the broswer asking to creat an account
  - Enter https://codepirates-ah-backend.herokuapp.com/signup/social in the browser address bar and hit enter
  - You will get a message that your account has been created and a verification email sent along with your details and an access token

Pivotal tracker story

  [finishes #167313401]

* disable failing tests for further inspection

* resolve merge conflict

* Purpose of this commit:

  Resolve build failure

Story ID

  [finished #167313401](https://www.pivotaltracker.com/story/show/167313401)

* fix history packag-lock error

* work around twitter account security concern

* work around twitter account security concern

* pp

* twitter security

* twitter security

* twitter security

* Update test-socialLogin.js

* respond to feedback

* fix merge error

* feature(social auth): add social authentication functionality

* #167313409 Users should be able to follow each other (#20)

* rebase

* feature(follow-users):Users should be able to follow each other [Finishes #167313409]

* feature(follow-users):Improve follow user tests[Finishes #167313409]

* feature(create articles): user can create, read, update, and delete an article [Finishes #167313403] (#19)

* #167313402  user profile CRUD operation (#22)

*  controller business logic

* adding testing and validation

[Continue #167313402]

* remove unwanted dependency

* feature(rate article): add user should be able to give a rating to an article [Finishes 167313404] (#21)

* feature(view authors' profiles): user can view the profiles of all authors [Finishes #167313413] (#24)

* feature(commentes):added comment controllers-167313407 (#26)

* bug(improve api doc): make api documentation more readable and interactive (#28)

[Finishes #167942825]

* Ft like dislike article 167313408 (#29)

* add migration models

* routes

* docummentation

* feature(read time): add users should be able to see time it takes to read an article functinality (#30)

[Finishes #167313415]

* bug(fixing create article mocking tests):Only cloudinary function is mocked instead of the whole creating article route [Finishes #168000401] (#31)

* unhandled sendgrid error fix (#34)

* #167313410 Users should be able to receive notifications (#35)

*  updated develop

* User should get notifications

* feature(notifications): User should be able to get notifications [Finishes #167313410]

* feature(notifications):Remove unnecessary files [Finishes #167313410]

* feature(notifications):Remove all unnecessary files [Finishes #167313410]

* feature(notifications):Remove nodemailer files [Finishes #167313410]

* bg(mock fail): add mock test for interaction with external I/O services (#42)

* #167313411 Authenticated users should be able to tag articles (#37)

* #167313411 Users should be able to tag articles

* remove console.log

* enable all tests

* #167313417 Users should be able to bookmark articles for later reading (#44)

* feature(create articles): user can create, read, update, and delete an article [Finishes #167313403]

* basic bookmarking

* #167313417 user should be able to bookmark articles

* fix error in package-lock

* add package lock to git ignore

* correct status codes and refactor

* remove cascsede update for user to article association

* feature(highlight text in the article): user can highlight a content in the article, comment on the highlight, and share the highlight on different social platforms [Finishes #167313423] (#47)

* feature(package.lock):deleted[finished:167313424] (#45)

* #167313416 Users should be able to share articles across different channels (#46)

* save changes

* feature(share-articles): Users should be able to share articles across different channels [Finishes #167313416]

* feature(share-articles): Use util helper fuctions [Finishes #167313416]

* reset to previous commit

* Updated doc.yml file

* feature(like comment): add user can like a specific comment [Finishes #167313419] (#48)

* #167313420 A user should be able to see their reading statistics (#49)

* 167313420 a user should be able to view their reading stats

[WIP #167313420]

* 167313420 user should be able to view their stats

[(Needs review) #167313420]

* rebase and incorporate latest changes

* 167313420 rebase and rename stats test to run before other stats populating test request

* resolve conflict in articles controller

* reolve conflict in articles ctrler

* reolve conflict in articles ctrler

* resolve merge conflict

* #167313406 refactoring and pagintion for rating  article (#50)

* rating(paginating) paginate and refactor rating

[Starts #167313406]

* rating(refactor) add testing for rating and its pagination

[Finishes #167313406]

* #168213200 change setError to setSuccess upon success execution (#52)

* save changes

* feature(share-articles): Users should be able to share articles across different channels [Finishes #167313416]

* feature(share-articles): Use util helper fuctions [Finishes #167313416]

* reset to previous commit

* Updated doc.yml file

* fix setError to setSuccess

* Fix setError to setSucess in comments file

* Remove duplicate code due to rebasing
salviosage pushed a commit that referenced this pull request Oct 17, 2019
…ofiles (#64)

* #167313388 configure eslint  (#2)

* chore(eslint) add eslint dev dependencies

add eslint config airbnbbase and eslint import pligin dependencies

[Start #167313388]

* chore(eslint) add .eslintrc file

[Continue #167313388]

* chore(eslint) delete unwanted folders

[Continue #167313388]

* chore(eslint) delete unwanted files

[Continue #167313388]

* chore(eslint) add eslint dev dependencies

add eslint config airbnbbase and eslint import pligin dependencies

[Start #167313388]

* chore(eslint) add .eslintrc file

[Continue #167313388]

* chore(eslint) delete unwanted files

[Continue #167313388]

* #167313386 Integrate TravisCI with readme badge (#3)

* chore(setup-travis-ci):Integrate TravisCI with readme badge [Finishes #167313386]

* chore(setup-travis-ci):Fix the failing travis [Finishes #167313386]

* chore(setup-travis-ci):Integrate travis CI with README  [Finishes #167313386]

* chore(setup-travis-ci):Change npm install to npm ci  [Finishes #167313386]

* chore(setup-travis-ci):Update the lock file  [Finishes #167313386]

* chore(configure postgres and sequelize): (#4)

Instlled sequelize
created src folder with config, migrations, models, seeds folders
configured postgres
created User model
Configured babel

[Finishes #167313387]
[Finishes #167595103]

* #167313394 Setup API documentation using swagger (#6)

* chore(api-doc): Setup API documentation using swagger

* chore(api documentation): Setup api documentation using swagger

  - create entry point of application in src/app.js
  - create swagger specification implementation in src/swagger.js
  - create api documentation endpoint in src/routes/api/inde.route.js
  - create 404 error route handler
  - create 500 error route handler
  - create pull request template

[Finishes #167313394]

* #167313389 Integrated HoundCi  (#5)

* chore(houndci):added .hound.yml[finished#1167313389]

* chore(houndci):added houndci badge[finishes#1167313389]

* chore(houndci):added added new line .hound.yml[finishes#1167313389]

* Ch api test setup 167313391 (#7)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* Update package.json

* modify test script to report coverage

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* modify test script to report coverage

* #167313389 Integrated HoundCi  (#5)

* chore(houndci):added .hound.yml[finished#1167313389]

* chore(houndci):added houndci badge[finishes#1167313389]

* chore(houndci):added added new line .hound.yml[finishes#1167313389]

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* Update package.json

* modify test script to report coverage

* What does this PR do?

 Setup unit testing for the backend

Tasks to be accomplished

  - Add required dependancies for running tests
  - Create test directory with general test setup module
  - Update test running script
  - Test the index route

How to test the test setup

  - Clone this repo and run git checkout -b ch-api-test-setup-167313391
  - Run git pull ch-api-test-setup-167313391
  - Run npm test

Usage

  To add tests,
  - Open/Create a file for the given tests in the test directory, es test users
  - Import {chai, app} from ./test-setuo
  - Ensure that required modules/functions not in the test-setup package are imported from their respective sources
  - Write the test suite(s)/cases

Pivotal tracker story

  [finishes #167313391](https://www.pivotaltracker.com/story/show/167313391)

* rename imported server

* fix index route response property name error and stream line server name

* Update package.json

* modify test script to report coverage

* chore(coveralls):added coveralls badge[Finishes #167313393]

* add coveralls badge, change to use expect for assetion and fix typo

* remove duplicate application title

* remove duplicate title and improve index route test

* #167313390 deploy base application to heroku  (#8)

* chore(heroku) add app.json file

to enable heroku to review each open pull request so that we can test app on heroku before merging branch to develop
[Starts #167313390]

* chore(heroku) add procfile
[Continue  #167313390]

* chore(heroku) add app.json file

to enable heroku to review each open pull request so that we can test app on heroku before merging branch to develop
[Starts #167313390]

* chore(heroku) add procfile
[Continue  #167313390]

* chore(heroku) add index.js to test
[Continue  #167313390]

* chore(heroku) add index.js to test
[Continue  #167313390]

* chore(heroku) rebase from develop
[Continue  #167313390]

* chore(heroku) finish heroku configuration
[Finishes  #167313390]

* fix covaralls badge (#9)

* #167313396 Build out Admin REST endpoints for resources(CRUD) (#10)

* updated develop branch

* feature(apis):implemented crud operations[finishes:167313396]

* feature(users):added username fields[finished:167313396]

* feature(code-refactoring):fixed-eslint[Finish:167313396]

* feature(tests):added tests[Finishes:167313396]

* feature(testing):added tests[Finishes:#167313396]

* feature(testing):fixed travis[Finishes:167313396]

* #167313398 Users should receive descriptive signup/Registration validation errors (#11)

* feature(signup-validations):Users should receive descriptive signup/Registration validation errors [Finishes 167313398]

* (signup-validation):Refactor validations [Finishes #167313398]

* (signup-validation):Refactor signup validations [Finishes #167313398]

* #167313399 User should be able to sign out (#12)

* feature(signout): add user signout logic

* feature(logout): add user can logout functionality

* feature(email verification): Email should be verified before a registered user gets access to different routes [Finishes #167313397] (#13)

* bg(heroku) rename Procfile file (#15)

* bg(heroku) rename Procfile file

[Starts #167804454]

* bg(heroku) rebasing

[Finishes  #167804454]

* bg(coveralls): add coverage script (#16)

* chore(improve test coverage): improves the test coverage [Finishes 167815352] (#17)

* feature(reset password): add user reset password functionality [Finishes #167313400] (#18)

* Ft api social login 167313401 (#14)

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* Purpose

  Add social login feature

Tasks to be accomplished

  - Enable social login via twitter, google and facebook
  - Add creation of new users from social accounts on login
  - Document routes

How can this feature be tested manualy

  - In the browser address bar, enter the url https://codepirates-ah-backend.herokuapp.com/login/<social>,
where social can be facebook, google or twitter
  - In the resulting window, enter your credentials for the given social platform
  - If your account exists with this app, you should be logged in and your details and a token displayed in the browser
  - If your account does not exist, you will get a message in the broswer asking to creat an account
  - Enter https://codepirates-ah-backend.herokuapp.com/signup/social in the browser address bar and hit enter
  - You will get a message that your account has been created and a verification email sent along with your details and an access token

Pivotal tracker story

  [finishes #167313401]

* disable failing tests for further inspection

* resolve merge conflict

* Purpose of this commit:

  Resolve build failure

Story ID

  [finished #167313401](https://www.pivotaltracker.com/story/show/167313401)

* fix history packag-lock error

* work around twitter account security concern

* work around twitter account security concern

* pp

* twitter security

* twitter security

* twitter security

* Update test-socialLogin.js

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* feature(social login): user has to login with social platforms [Finishes #167313401]

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* Purpose of this PR

  Add social login

Tasks to be acomplished

  - Login from social account if user exists
  - Create user and login if social user does not exist

How to test manually

  - In a browser enter the url http://<base url>/login/<social account>
    - Get the base URL in the documentation
    - social account is facebook or google for the respective logins
  - Follow the prompts and observe the response in the browser

Related PT story

  [WIP #167313401](https://www.pivotaltracker.com/story/show/167313401)

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* feature(api-social-login):remove twitter [#167313401

* Purpose

  Add social login feature

Tasks to be accomplished

  - Enable social login via twitter, google and facebook
  - Add creation of new users from social accounts on login
  - Document routes

How can this feature be tested manualy

  - In the browser address bar, enter the url https://codepirates-ah-backend.herokuapp.com/login/<social>,
where social can be facebook, google or twitter
  - In the resulting window, enter your credentials for the given social platform
  - If your account exists with this app, you should be logged in and your details and a token displayed in the browser
  - If your account does not exist, you will get a message in the broswer asking to creat an account
  - Enter https://codepirates-ah-backend.herokuapp.com/signup/social in the browser address bar and hit enter
  - You will get a message that your account has been created and a verification email sent along with your details and an access token

Pivotal tracker story

  [finishes #167313401]

* disable failing tests for further inspection

* resolve merge conflict

* Purpose of this commit:

  Resolve build failure

Story ID

  [finished #167313401](https://www.pivotaltracker.com/story/show/167313401)

* fix history packag-lock error

* work around twitter account security concern

* work around twitter account security concern

* pp

* twitter security

* twitter security

* twitter security

* Update test-socialLogin.js

* respond to feedback

* fix merge error

* feature(social auth): add social authentication functionality

* #167313409 Users should be able to follow each other (#20)

* rebase

* feature(follow-users):Users should be able to follow each other [Finishes #167313409]

* feature(follow-users):Improve follow user tests[Finishes #167313409]

* feature(create articles): user can create, read, update, and delete an article [Finishes #167313403] (#19)

* #167313402  user profile CRUD operation (#22)

*  controller business logic

* adding testing and validation

[Continue #167313402]

* remove unwanted dependency

* feature(rate article): add user should be able to give a rating to an article [Finishes 167313404] (#21)

* feature(view authors' profiles): user can view the profiles of all authors [Finishes #167313413] (#24)

* feature(commentes):added comment controllers-167313407 (#26)

* bug(improve api doc): make api documentation more readable and interactive (#28)

[Finishes #167942825]

* Ft like dislike article 167313408 (#29)

* add migration models

* routes

* docummentation

* feature(read time): add users should be able to see time it takes to read an article functinality (#30)

[Finishes #167313415]

* bug(fixing create article mocking tests):Only cloudinary function is mocked instead of the whole creating article route [Finishes #168000401] (#31)

* unhandled sendgrid error fix (#34)

* #167313410 Users should be able to receive notifications (#35)

*  updated develop

* User should get notifications

* feature(notifications): User should be able to get notifications [Finishes #167313410]

* feature(notifications):Remove unnecessary files [Finishes #167313410]

* feature(notifications):Remove all unnecessary files [Finishes #167313410]

* feature(notifications):Remove nodemailer files [Finishes #167313410]

* bg(mock fail): add mock test for interaction with external I/O services (#42)

* #167313411 Authenticated users should be able to tag articles (#37)

* #167313411 Users should be able to tag articles

* remove console.log

* enable all tests

* #167313417 Users should be able to bookmark articles for later reading (#44)

* feature(create articles): user can create, read, update, and delete an article [Finishes #167313403]

* basic bookmarking

* #167313417 user should be able to bookmark articles

* fix error in package-lock

* add package lock to git ignore

* correct status codes and refactor

* remove cascsede update for user to article association

* feature(highlight text in the article): user can highlight a content in the article, comment on the highlight, and share the highlight on different social platforms [Finishes #167313423] (#47)

* feature(package.lock):deleted[finished:167313424] (#45)

* #167313416 Users should be able to share articles across different channels (#46)

* save changes

* feature(share-articles): Users should be able to share articles across different channels [Finishes #167313416]

* feature(share-articles): Use util helper fuctions [Finishes #167313416]

* reset to previous commit

* Updated doc.yml file

* feature(like comment): add user can like a specific comment [Finishes #167313419] (#48)

* #167313420 A user should be able to see their reading statistics (#49)

* 167313420 a user should be able to view their reading stats

[WIP #167313420]

* 167313420 user should be able to view their stats

[(Needs review) #167313420]

* rebase and incorporate latest changes

* 167313420 rebase and rename stats test to run before other stats populating test request

* resolve conflict in articles controller

* reolve conflict in articles ctrler

* reolve conflict in articles ctrler

* resolve merge conflict

* #167313406 refactoring and pagintion for rating  article (#50)

* rating(paginating) paginate and refactor rating

[Starts #167313406]

* rating(refactor) add testing for rating and its pagination

[Finishes #167313406]

* #168213200 change setError to setSuccess upon success execution (#52)

* save changes

* feature(share-articles): Users should be able to share articles across different channels [Finishes #167313416]

* feature(share-articles): Use util helper fuctions [Finishes #167313416]

* reset to previous commit

* Updated doc.yml file

* fix setError to setSuccess

* Fix setError to setSucess in comments file

* Remove duplicate code due to rebasing

* chore(maintainability): add code climate badge [Finishes #168243766] (#54)

* addd express social login (#55)

* chore(Raise test coverage): The coverage improvedfrom 91% to 95.78% [Finishes: #168212256] (#58)

* featuture api (enable social signup): Signup social user and return unique random password [finishes #167313352] (#60)

* #169039872 fix backend social login and email verification (#61)

* bug(socialAUth) fix social auth

fix social auth so that it can redirect to a desired page and also fix body parser issues

[Starts #169039872]

* bu(backend) fix  some issues

fixing social login , email verification and bio allowed to be set to empty

[Finish #169039872]

* mend

add a reset link to backend

* mend

add a reset link to backend

* mend

add a reset link to backend

* feature(views and popular articles): get article views and popular articles [Finishes #169124758] (#63)

* bg(search filter): added search and filter functionality [Finishes #169191116]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants