Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mediacomem/one-chat-room

Real-time Node.js/Vue/Socket.io demo application
https://github.com/mediacomem/one-chat-room

chat chatroom node nodejs real-time realtime socket-io socketio vue vuejs

Last synced: 3 months ago
JSON representation

Real-time Node.js/Vue/Socket.io demo application

Awesome Lists containing this project

README

        

# One Chat Room

A real-time demo application written with [Node.js](https://nodejs.org/en/), [Vue](https://vuejs.org/) and [Socket.io](https://socket.io/):
one chat room where anyone can post messages.

- [Installation](#installation)
- [Requirements](#requirements)
- [Setup](#setup)
- [Run in development mode](#run-in-development-mode)
- [Run in production mode](#run-in-production-mode)
- [Configuration](#configuration)

## Installation

### Requirements

* [Node.js](https://nodejs.org) 12+
* [Installation](https://nodejs.org/en/download/package-manager/)
* [MongoDB](https://www.mongodb.com/) 3+
* [Installation](https://docs.mongodb.com/manual/administration/install-community/)

### Setup

* Clone the repository
* Install dependencies

```
cd /path/to/repo
npm install
```
* Set up environment variables for [configuration](#configuration) if needed.

### Run in development mode

```
cd /path/to/application
npm run dev
```

### Run in production mode

```
cd /path/to/application
npm start
```

## Configuration

The following environment variables can be set to customize the application's behavior:

Variable | Default value | Description
:--- | :--- | :---
`BASE_URL` | *none* | Base URL at which the application is deployed.
`DATABASE_URL` | `mongodb://localhost/one-chat-room` | [MongoDB connection string](https://docs.mongodb.com/manual/reference/connection-string/).
`MONGODB_URI` | *none* | Same as and takes precedence over `DATABASE_URL`.
`MAX_MESSAGE_LENGTH` | 500 | Maximum number of characters allowed in a message.
`MAX_MESSAGES` | 10000 | Maximum number of messages the application will store before deleting the oldest ones.
`PORT` | 3000 | Port on which to listen to.