Awesome
Feathers-Scss-Postgres-Chat-App
A chat app styled with Scss and Served with a Restful and Websocket API built using feathersjs and sequelize with postgresql (or heroku postgres in production). In this particular example, I showcase how to:
- send private message events only to the target recipient and sender and public ones only to authenticated users.
- disable ssl verification for Heroku Postgres
- styling with Sassy Css (Scss - Syntactically Awesome Style Sheet)
About
This project uses Feathers. An open source web framework for building modern real-time applications. I decided to style the UI with Sassy CSS (Scss - Syntactically Awesome Style Sheet) to appeal to the taste of any UI developer regardless of the Framework or UI technology they are using.
- Here is why I did not go Css
- Still wanted the css feel though, so I chose Scss and not Sass
- Click here to check it out in production.
W0uld you rather run it locally?
Getting up and running is as easy as 1, 2, 3,4.
- Make sure you have installed:
-
Install your dependencies
cd path/to/chat-app-postgres yarn
-
Configure the app to run locally
- create a database and take note of its: user, password, databasename
- create a .env file in the project root and defile the environment variables below
POSTGRES = postgres://youruser:yourpassword@localhost:5432/yourdatabasename
- go to the
migrations/config.js
andsrc/sequelize.js
files and comment out the followingssl configuration block
as below:
dialectOptions: { /** ssl:{ sslStrict: false, // turning off sslStrict mode rejectUnauthorized: false, // disabling its ability to reject Unauthorised connections } **/ }
(This was added for production to disable ssl verification since herokupostgres database does not allow clients that are not ssl verified. We did not configure SSL for our production app since its just a demo)
-
run the app locally
yarn dev
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
Help
For more information on all the things you can do with Feathers visit docs.feathersjs.com.