Skip to content

A Feathers starter project including the Sequelize ORM for PostgreSQL.

Notifications You must be signed in to change notification settings

satyasahoo210/feathers-postgresql-starter

 
 

Repository files navigation

feathers-postgresql-starter

A Feathers starter project including the Sequelize ORM for PostgreSQL.

About

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.

Features:

  • Feathers with (local) authentication,

  • Sequelize + PostgreSQL database adapter,

  • Database migrations and seeding,

  • A basic frontend written in HTML/CSS and (Vanilla) JavaScript.

Getting Started

  1. Make sure you have NodeJS and npm installed.

  2. Install your dependencies

    $ cd path/to/feathers-postgresql-starter
    $ npm install
    
  3. Start your app

    $ npm start
    

Or run npm run dev during development, and the app will restart after any change in the source code.

Database Setup

  1. Have a PostgreSQL database up and running.

  2. Set the database connection string in the .env file (see .env-example).

  3. Run the app with npm start oder npm run dev.

Database Migrations and Seeding

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.

Testing

Simply run npm test and all your tests in the test/ directory will be run.

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

About

A Feathers starter project including the Sequelize ORM for PostgreSQL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 53.6%
  • JavaScript 45.0%
  • HTML 1.4%