Coder Social home page Coder Social logo

ingeniousambivert / feathers-starter Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 225 KB

Minimal Feathers App with Authentication Management and Role-Based Access Control

JavaScript 77.04% HTML 22.96%
feathersjs nodejs expressjs postgresql sendgrid

feathers-starter's Introduction

Feathers Starter

Feathers server with basic user management and role based access control.

This project was bootstrapped with Feathers Generator.

Getting Started

Getting up and running is simple.

Make sure you have NodeJS, npm and PostgreSQL installed.

npm install
npm start

Configuration

The default configuration is generated automatically using the Feathers Generator.It consists of the default host, pagination options, authentication options. For the app to function correctly, you need to configure the necessary environment variables in your system or in an .env file. The app requires the following environment variables:

# Server Configs
NODE_ENV=
PORT=
CLIENT_URL=

# Postgres Configs
POSTGRES_IP=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=


# Sendgrid Configs
SENDGRID_API_KEY=
SENDGRID_VERIFY=
SENDGRID_VERIFY_DONE=
SENDGRID_RESET=
SENDGRID_RESET_DONE=
SENDGRID_PASSWORD_CHANGE=
SENDGRID_EMAIL_CHANGE=
SENDGRID_INVITE=
FROM_EMAIL=

# Slack Webhook
SLACK_WEBHOOK_URL=

Available Scripts

In the project directory, you can run the following scripts.

npm run dev

Runs the app in the development mode with nodemon sets the NODE_ENV to development and adds formatting to bunyan logs.

npm start

Runs the app in the production mode sets the NODE_ENV to production and adds formatting to bunyan logs.

npm run migrate:up

Runs the sequelize cli and migrates the database models to upgrade to the generated migration up scripts in src/database/migrations/scripts/.

npm run migrate:down

Runs the sequelize cli and migrates the database models to downgrade to the generated migration down scripts in src/database/migrations/scripts/. [use carefully]

npm run format

Runs the prettier formatter on the src/ directory and formats your files.

npm run lint

Runs the eslint configurations on the src/ directory and lint your files.

npm run test

Runs all your tests in the test/ directory.

Extra Configurations

The app is configured with the following module aliases:

  • @app-> ./src/app
  • @channels -> ./src/channels
  • @database -> ./src/database
  • @errors -> ./src/errors
  • @hooks -> ./src/hooks
  • @helpers -> ./src/helpers
  • @integrations -> ./src/integrations
  • @models -> ./src/models
  • @middleware -> ./src/middleware
  • @services -> ./src/services
  • @utils -> ./src/utils

Helpers

Thin communication layer for helper/utility methods. Helpers have same design as services and can be accessed using app.helper("<name>")

Request

app.helper("request")

Integrations

Thin communication layer for external providers. Integrations have same design as services and can be accessed using app.integration("<name>")

All integrations expose several methods common among their channels apart from these mandatory methods:

  • build: Initializes the integration. Integration has to be initialized with required arguments before using them.
Sendgrid

app.integration("sendgrid")

Scaffolding

Feathers has a powerful command line interface. Here are a few things it can do:

npm install -g @feathersjs/cli          # Install Feathers CLI

feathers generate service               # Generate a new Service
feathers generate hook                  # Generate a new Hook
feathers help                           # Show all commands

To setup a remote Postgres Database read the instructions in the file - Database_Setup.md. If the file does not exist read the instructions here - https://betterprogramming.pub/how-to-provision-a-cheap-postgresql-database-in-aws-ec2-9984ff3ddaea

Help

For more information on all the things you can do with Feathers visit docs.feathersjs.com.

feathers-starter's People

Contributors

ingeniousambivert avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.