Feathers server with basic user management and role based access control.
This project was bootstrapped with Feathers Generator.
Getting up and running is simple.
Make sure you have NodeJS, npm and PostgreSQL installed.
npm install
npm start
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=
In the project directory, you can run the following scripts.
Runs the app in the development mode with nodemon sets the NODE_ENV
to development and adds formatting to bunyan logs.
Runs the app in the production mode sets the NODE_ENV
to production and adds formatting to bunyan logs.
Runs the sequelize cli and migrates the database models to upgrade to the generated migration up scripts in src/database/migrations/scripts/
.
Runs the sequelize cli and migrates the database models to downgrade to the generated migration down scripts in src/database/migrations/scripts/
.
[use carefully]
Runs the prettier formatter on the src/
directory and formats your files.
Runs the eslint configurations on the src/
directory and lint your files.
Runs all your tests in the test/
directory.
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
Thin communication layer for helper/utility methods. Helpers have same design as services and can be accessed using app.helper("<name>")
app.helper("request")
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.
app.integration("sendgrid")
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
For more information on all the things you can do with Feathers visit docs.feathersjs.com.