Install the following packages:
npm install -g standard
npm install -g npm-check-updates
npm install -g nodemon
Rename .env.sample to .env with your configurations.
Testing is conducted using using jasmine
with istanbul
for code coverage.
npm install -g istanbul
npm install -g jasmine
Available defined tasks:
npm run dev
- Starts development server.npm run lint
- Runsstandard
.npm test
- Runs api testing.
It is using mongodb with mongoose.
- User can login with
username
oremail
. - After successful login, a
jwt
token will be generated. - After logout, logged out token in stored in
blacklisted_tokens
table until theexpiredAt
value is less than the current unix time. There is a timer that will run every 24h.
- Username type can be configured with a regex.
- Password strength can be configured with a regex.
- Required fields are
username
,email
, andpassword
. username
andemail
is unique.- After registration, a
secret
will be given for user activation. - Register user from social login by submitting a social user id and a social source eg. facebook, twitter etc.
- A
secret
will be given when user wants to reset password. User will also be deactivated. - Use this
secret
when submitting a newpassword
.
- User data can be retrieved by
id
,username
, andemail
.