Skip to content

message in real time - chat room - private chat - photos

Notifications You must be signed in to change notification settings

CristianPeralta/MessageRealTime

Repository files navigation

MessageRealTime Application

Node.js Express MongoDB Vue.js Sockets CRUD Operations Docker

This project is a web application built with Node.js, Express, MongoDB, and Vue.js. The application provides a login system, group chat, direct messages, contacts, and user profile.

1. Requirements

To run this application, you need to have the following installed on your computer:

  • Node.js [versión 18.18.2]
  • MongoDB [versión 6.0.4]

2. Technologies Used

  • Node.js [18.18.2]
  • Express [4.16.2]
  • MongoDB [6.0.4]
  • Vue.js [2.5.13]

3. Installation

Run the following command to install the dependencies:

npm install

4. Configuration

  1. Copy the .env.example file as .env and configure the necessary environment variables.
  2. If you want to run tests, also copy the .env.example file as .env.test and configure the necessary environment variables for testing.

5. Execution

To run the server, execute the following command in the project root:

npm run start

The server will start on port 3000

And for the client:

npm run watch

The client will start on port 3000

6. Docker

This documentation provides instructions on how to use Docker to build and run the Messages application. It covers building the Docker image, running the image with Docker, and using Docker Compose for more complex setups.

6.1 Prerequisites

Docker should be installed on your system. If you don't have Docker installed, please follow the Docker installation guide.

6.2 Building the Docker Image

To build the Docker image for the Messages application, run the following command:

docker build -t messages-app .

6.3 Running the Docker Container

To run the Docker container with the Messages app image, use the following command:

docker run -p 3000:3000 --network host messages-app

Note: Using the --network host flag allows the container to consume the database from the host machine. If this is not available, consider using Docker Compose as described below.

6.4 Running with Docker Compose

If you prefer to use Docker Compose, follow these steps:

Grant necessary permissions to the data directory for persistent storage:

sudo chmod -R 777 /data/db

Uncomment line 6 and comment line 4 in the .env file:

4. MONGODB_CONNECTION_STRING=mongodb://localhost/messageDb
5. # For docker compose
6. # MONGODB_CONNECTION_STRING=mongodb://mongodb/messageDb

(Optional) If you encounter permission issues or need to customize the UID and GID, uncomment lines 7 and 8 in the .env file:

7. # UID=1000
8. # GID=1000

Ensure that port '27017:27017' is available on your system or modify the port in line 6 of the docker-compose.yml file.

To run the Messages application with Docker Compose, execute the following command:

docker compose up

7. Author

Cristian Peralta

8. License

This project is licensed under the MIT License - see the LICENSE file for details.

About

message in real time - chat room - private chat - photos

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published