A simple Socket.io chat module with PostgreSQL database user authentication for use in larger social media website project
- node.js >= v13.9.0
- PostgreSQL >= v12
- Install node.js module dependencies from project root:
$ npm install
-
Install PostgreSQL, specifying data directory and setting up database configuration. The module uses the login "postgres:password" and database name "chatspike" on "localhost:5432"
-
Start PosgreSQL server and create database:
$ pg_ctl start -D '<PATH_TO_DATA_DIR>'
$ psql -U '<POSTGRES_USERNAME> -c 'CREATE DATABASE "<DATABASE_NAME>"
# Ensure DB Server is Started
$ pg_ctl start -D '<PATH_TO_DATA_DIR>'
# Start App
$ npm start
- https://hackernoon.com/enforcing-a-single-web-socket-connection-per-user-with-node-js-socket-io-and-redis-65f9eb57f66a
- https://itnext.io/build-a-group-chat-app-in-30-lines-using-node-js-15bfe7a2417b
- https://www.tutorialspoint.com/postgresql/index.htm
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.