All Projects â†’ JKHeadley â†’ Appy Backend

JKHeadley / Appy Backend

Licence: mit
A user system to bootstrap your app.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Appy Backend

Rest Hapi
🚀 A RESTful API generator for Node.js
Stars: ✭ 1,102 (+1047.92%)
Mutual labels:  api, rest, swagger, mongoose, mongodb, hapi
Securing Restful Apis With Jwt
How to secure a Nodejs RESTful CRUD API using JSON web tokens?
Stars: ✭ 301 (+213.54%)
Mutual labels:  api, mongoose, mongodb, authentication, authorization
Jianshu
仿矀äčŠnx+nodejs+nestjs6+express+mongodb+angular8+çˆŹè™«
Stars: ✭ 296 (+208.33%)
Mutual labels:  api, swagger, restful-api, mongoose, mongodb
Appkernel
API development made easy: a smart Python 3 API framework
Stars: ✭ 152 (+58.33%)
Mutual labels:  api, rest, restful-api, api-server, mongodb
Express Graphql Mongodb Boilerplate
A boilerplate for Node.js apps / GraphQL-API / Authentication from scratch - express, graphql - (graphql compose), mongodb (mongoose).
Stars: ✭ 288 (+200%)
Mutual labels:  api, mongoose, mongodb, authentication, authorization
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (+85.42%)
Mutual labels:  api, rest, swagger, restful-api, api-server
Nodejs Restful Api
How to create a RESTful CRUD API using Nodejs?
Stars: ✭ 285 (+196.88%)
Mutual labels:  api, rest, mongoose, mongodb
Bookmarks.dev
Bookmarks and Code Snippets Manager for Developers & Co
Stars: ✭ 218 (+127.08%)
Mutual labels:  api, rest, mongoose, mongodb
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+10977.08%)
Mutual labels:  api, rest, restful-api, api-server
Hapi Openapi
Build design-driven apis with OpenAPI (formerly swagger) 2.0 and hapi.
Stars: ✭ 196 (+104.17%)
Mutual labels:  api, rest, swagger, hapi
Grant
OAuth Proxy
Stars: ✭ 3,509 (+3555.21%)
Mutual labels:  hapi, server, authentication, authorization
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (+0%)
Mutual labels:  rest, swagger, mongoose, mongodb
Kratos
Next-gen identity server (think Auth0, Okta, Firebase) with Ory-hardened authentication, MFA, FIDO2, profile management, identity schemas, social sign in, registration, account recovery, and IoT auth. Golang, headless, API-only - without templating or theming headaches.
Stars: ✭ 4,684 (+4779.17%)
Mutual labels:  login, registration, user-management, users
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+3491.67%)
Mutual labels:  api, rest, swagger, server
Buji Pac4j
pac4j security library for Shiro: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 444 (+362.5%)
Mutual labels:  mongodb, authentication, authorization, login
Play Pac4j
Security library for Play framework 2 in Java and Scala: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 375 (+290.63%)
Mutual labels:  mongodb, authentication, authorization, login
Cerberus
A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
Stars: ✭ 482 (+402.08%)
Mutual labels:  rest, restful-api, authentication, authorization
Php Auth
Authentication for PHP. Simple, lightweight and secure.
Stars: ✭ 713 (+642.71%)
Mutual labels:  authentication, authorization, login, registration
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (+88.54%)
Mutual labels:  api, rest, restful-api, api-server
Blog Service
blog service @nestjs
Stars: ✭ 188 (+95.83%)
Mutual labels:  api, api-server, mongoose, mongodb

appy logo

A user system leveraging rest-hapi to bootstrap your app.

appy-backend is the server portion of the appy project. It provides a boilerplate user system that leverages the powerful rest-hapi API generator. Inspired by the frame user system, the goal of appy-backend is to provide an easy to use user API that is also capable of supporting a wide range of applications. appy-backend is a great resource for starting almost any app. By leveraging rest-hapi, adding new endpoints is as simple as defining a new model, and model associations are a snap. Bootstrapping your app has never been easier!

Features

  • Registration and account activation flows
  • Login system with forgot password and reset password
  • Social login
  • Abusive login attempt detection
  • User permissions based on roles and groups
  • Three optional authentication strategies
  • Websocket chat via @hapi/nes
  • File upload api
  • Endpoint validation and query support
  • Swagger docs for easy endpoint access

Technologies

appy-backend implements a hapi framework server. appy-backend's RESTful API endpoints are generated through rest-hapi, which means models are based off of mongoose and data is stored in MongoDB.

Demos

View the swagger docs for the live demo:

https://api.appyapp.io

Starting appy-backend

appy_start

Logging in

appy_login

GET /users

appy_get_users

Filter Query and Populate Relationship

appy_permissions_filter

Readme contents

Requirements

Just Docker

OR

You need Node.js installed (>=12.14.1) and you'll need MongoDB installed and running.

Back to top

Getting Started

Download from GitHub:

$ git clone https://github.com/JKHeadley/appy-backend.git
$ cd appy-backend

Installation

Using Docker

None required.

Without Docker

$ npm install

Back to top

Configuration

appy configuration follows frame's configuration flow:

Simply edit config/index.js. The configuration uses confidence which makes it easy to manage configuration settings across environments. Don't store secrets in this file or commit them to your repository.

Instead, access secrets via environment variables. We use dotenv to help make setting local environment variables easy (not to be used in production).

Using Docker

Simply copy .env-docker-sample to .env-docker and edit as needed. Don't commit .env-docker to your repository.

Without Docker

Simply copy .env-sample to .env and edit as needed. Don't commit .env to your repository.

First time setup

WARNING: This will clear all data in the MongoDB database defined in restHapiConfig.mongo.URI (default mongodb://localhost/appy).

If you would like to seed your database with some data, run:

Using Docker

$ sh seed_data.sh

Without Docker

$ npm run seed

NOTE: The password for all seed users is root.

Back to top

Running appy-backend

To quickly run the app locally, simply run:

Using Docker

$ sh run_server.sh

Without Docker

$ npm start

Once the app is running point your browser to http://localhost:8080/ to view the Swagger docs.

Back to top

Wiki

For detailed explanations on many of the topics covered in this readme, including authentication, authorization, and logging in and testing endpoints, please refer to the wiki pages.

Back to top

Swagger documentation

Swagger documentation is automatically generated for all endpoints and can be viewed by pointing a browser at the server URL. By default this will be http://localhost:8080/. The swagger docs provide quick access to testing your endpoints along with model schema descriptions and query options.

Back to top

Authentication

There are three optional authentication strategies in appy and each make use of javascript web tokens (JWT) and the hapi-auth-jwt2 scheme. The three strategies are:

  1. Standard token
  2. Session
  3. Session with refresh token

The strategy used is determined by the restHapiConfig.authStrategy config property.

For a more in-depth description of these strategies, please view the wiki.

Back to top

Authorization

Authorization in appy is enforced via the hapi scope endpoint property. Endpoints generated through rest-hapi come prepopulated with scope values. See the rest-hapi docs for more info.

User scope values are populated based on appy's permission system. User's gain permissions based on three associations:

  1. User defined permissions
  2. Group defined permissions
  3. Role defined permissions

Users must belong to at least one role and can belong to multiple groups. Each permission association carries with it a state property that can be set to Included, Excluded, or Forbidden. This property allows permissions to override each other based on priority. User permissions have the highest priority, followed by Group permissions and lastly Role permissions:

User->Group->Role

This allows easy and specific configuration of user endpoint access. In general, a user will gain the majority of it's permissions through it's role. Those permissions will be further defined by any groups the user belongs to. Finally a user might have a few specific permissions assigned directly to them. A user's scope final scope is a combination of the user's role, groups, and effective permissions. See below for an example:

User: '[email protected]' Role: 'Admin' Role Permissions:

[
  { name:'readUser', state:'Included' },
  { name:'updateUser', state:'Included' },
  { name:'addUserPermissions', state:'Included' },
  { name:'removeUserPermissions', state:'Included' }
]

User's Groups: ['Managers'] Group Permissions:

[
  { name:'updateUser', state:'Excluded' },
]

User Permissions:

[
  { name:'removeUserPermissions', state:'Excluded' },
]

Final User Scope:

['Admin','Managers','readUser','addUserPermissions']

For a more in-depth description of authorization within appy, please view the wiki

Back to top

License

MIT

Back to top

Questions?

If you have any questions/issues/feature requests, please feel free to open an issue. We'd love to hear from you!

Back to top

Contributing

Please reference the contributing doc: https://github.com/JKHeadley/appy-backend/blob/master/CONTRIBUTING.md

Back to top

Thanks!

We hope you enjoy appy-backend!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].