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.
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]
- Node.js [18.18.2]
- Express [4.16.2]
- MongoDB [6.0.4]
- Vue.js [2.5.13]
Run the following command to install the dependencies:
npm install
- Copy the
.env.example
file as.env
and configure the necessary environment variables. - If you want to run tests, also copy the
.env.example
file as.env.test
and configure the necessary environment variables for testing.
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
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.
Docker should be installed on your system. If you don't have Docker installed, please follow the Docker installation guide.
To build the Docker image for the Messages application, run the following command:
docker build -t messages-app .
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.
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
This project is licensed under the MIT License - see the LICENSE file for details.