A Feathers starter project including the Sequelize ORM for PostgreSQL.
This project uses
- Feathers (v4.3.11) – an open source web framework for building modern real-time applications.
- Sequelize – a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.
It is based on the chat application in The Feathers guide. Instead of the file-system based database NeDB in the guide's example, this project utilizes Sequelize/PostgreSQL.
-
Feathers with (local) authentication,
-
Sequelize + PostgreSQL database adapter,
-
Database migrations and seeding,
-
A basic frontend written in HTML/CSS and (Vanilla) JavaScript.
-
Install your dependencies
$ cd path/to/feathers-postgresql-starter $ npm install
-
Start your app
$ npm start
Or run npm run dev
during development, and the app will restart after any change in the source code.
-
Have a PostgreSQL database up and running.
-
Set the database connection string in the
.env
file (see.env-example
). -
Run the app with
npm start
odernpm run dev
.
This project is already configured to use migrations for any change in the database structure. For an initial database setup just run
$ node_modules/.bin/sequelize db:migrate
This will run the scripts in migrations/scripts
, which create a users
and a comments
table.
You can seed the database with the command
$ node_modules/.bin/sequelize db:seed:all
This seeder will insert two users in the users
table: jon@example.com
and jane@example.com
. Both passwords are secret
.
Simply run npm test
and all your tests in the test/
directory will be run.
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