This project uses Feathers. An open source framework for building APIs and real-time applications.
-
Install your dependencies
cd path/to/project npm install -
Start your app
npm run migrate # Run migrations to set up the database npm start
- Install homebrew
- Update brew
brew update
- Install postgres
brew install postgresql
- Use the command as follows to start running the service.
brew services start postgresql
- Run the following command to configure the postgres database server
psql postgres
- Run the following commands to setup database on psql (Press enter after every command):
CREATE ROLE postgres WITH LOGIN PASSWORD 'password';ALTER ROLE postgres superuser;
\qpsql postgres -U postgres;CREATE DATABASE db_name;
- Set up the connection on any database client such as pgAdmin or DBeaver etc using the following configuration:
database = db_name username = postgres password = password
Run npm test and all your tests in the test/ directory will be run.
This app comes with a powerful command line interface for Feathers. Here are a few things it can do:
$ npx feathers help # Show all commands
$ npx feathers generate service # Generate a new Service
src/views:- Every route should be added to
routes.js. - Every subfolder should handle only one route and its subroutes for example
/profilewill be handled byprofilesubfolder. - Every subfolder can have at most these two files:
*.controller.jsand*.handlebars. - Every route should be registered in
index.js.
- Every route should be added to
The project uses Auth0 for all authentication and authorization purposes.
- Use
/loginroute to login. - Use
/logoutroute to logout. - Use
req.oidc.isAuthenticated()to check if the user is authenticated. - Use
req.oidc.userto fetch the details of logged in user. - Use
requiresAuth()fromexpress-oidc-connectpackage as middleware to protect routes. (Example:src/views/profile).
For more information on all the things you can do with Feathers visit docs.feathersjs.com.