Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derekwheee/pallies
hapi user management
https://github.com/derekwheee/pallies
hapi hapijs user-management
Last synced: 27 days ago
JSON representation
hapi user management
- Host: GitHub
- URL: https://github.com/derekwheee/pallies
- Owner: derekwheee
- Created: 2019-12-13T20:19:44.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2024-05-15T20:13:09.000Z (8 months ago)
- Last Synced: 2024-11-05T17:52:43.006Z (about 2 months ago)
- Topics: hapi, hapijs, user-management
- Language: JavaScript
- Homepage: https://frxnz.github.io/pallies/
- Size: 2.81 MB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Pallies
[![Build Status](https://travis-ci.org/frxnz/pallies.svg?branch=master)](https://travis-ci.org/frxnz/pallies)
[![Coverage Status](https://coveralls.io/repos/github/frxnz/pallies/badge.svg?branch=master)](https://coveralls.io/github/frxnz/pallies?branch=master)Pallies is a user management plugin for [hapi](https://hapi.dev/), designed to work best with
[hapipal](https://github.com/hapipal).### Resources
* [API documentation](https://frxnz.github.io/pallies/)### Features
* Supports hapi v18+
* Built-in support for user invite and forgot password tokens
* Powerful configuration using [Confidence](https://github.com/hapijs/confidence)
* Strong password encryption using [Argon2](https://www.npmjs.com/package/argon2)
* Use any database supported by [Knex](http://knexjs.org/) and [Objection](https://vincit.github.io/objection.js/)### Getting Started
This guide assumes you've already created a hapi project using hpal
Looking for a starting point? Check the [Pallies Demo Repo](https://github.com/frxnz/pallies-demo-api).
#### Install the Pallies module from npm
```bash
npm install --save pallies
```#### Configure Pallies
Create a configuration file at `server/.palliesrc.js`[Example Pallies configuration](https://github.com/frxnz/pallies/blob/master/server/.palliesrc.js)
#### Update Your Manifest
```js
// Register Pallies as a plugin in `lib/plugins/pallies.js
'use strict';const PalliesConfig = require('../../server/.palliesrc');
const User = require('../models/user');module.exports = (server, options) => ({
plugins: {
options: {
isDev : options.isDev,
...PalliesConfig
}
}
});
``````js
// Register Schwifty in server/manifest.js
{
plugin: 'schwifty',
options: {
$filter: { $env: 'NODE_ENV' },
$default: {},
$base: {
migrateOnStart: true,
knex: {
client: 'pg',
connection: {
host: { $env: 'DB_HOST' },
user: { $env: 'DB_USER' },
password: { $env: 'DB_PASSWORD' },
database: { $env: 'DB_DATABASE' }
},
migrations: {
stub: 'Schwifty.migrationsStubPath'
}
}
},
production: {
migrateOnStart: false
}
}
}
```#### Update `knexfile.js`
Add the Pallies migration directory to your migrations configuration
```js
// ...
migrations: {
directory: [
'node_modules/pallies/lib/migrations',
Path.relative(process.cwd(), PluginConfig.migrationsDir)
]
}
//...
```#### Apply database migrations
```bash
npx knex migrate:latest
```