This project is a MEVN (MongoDB, Express, Vue.js, Node.js) backend authentication system. It provides a backend built with Node.js and Express.js, using MongoDB as the database. This setup allows for easy user authentication and management.
- Node.js: A JavaScript runtime built on Chrome's V8 JavaScript engine.
- Express.js: A web application framework for Node.js, designed for building web applications and APIs.
- MongoDB: A NoSQL database that uses a document-oriented data model.
- Docker: A platform for developing, shipping, and running applications in containers.
This project includes the following Docker containers:
- Node: Runs the Node.js application.
- MongoDB: The NoSQL database for storing user data.
- Mailhog: An email testing tool for capturing and displaying outgoing emails.
- Mongo Express: A web-based MongoDB administration interface for managing the database.
To set up the project using Docker, follow these steps:
-
Clone the Repository:
git clone <repository_url> cd <project_directory>
-
cp .env_sample .env
-
Fill in the Environment Variables: Edit the .env file and fill in the necessary values for MongoDB connection, ports, and any other required settings.
-
Build and Run the Containers: Execute the following command to build and start the containers:
docker-compose up -d --build
-
Install Dependencies and Start the Node Server: After the containers are running, execute the following command to install npm packages inside the Node container and start the server:
docker exec -it mevn_auth_node npm install docker exec -it mevn_auth_node node server.js
-
Access the Application:
- Node.js API: http://localhost:8085
- Mongo Express: http://localhost:8081
- Mailhog: http://localhost:8025
To set up the project without using Docker, follow these steps:
-
Clone the Repository:
git clone <repository_url> cd <project_directory>
-
cp .env_sample .env
-
Fill in the Environment Variables: Edit the .env file and fill in the necessary values for MongoDB connection, ports, and any other required settings.
-
Install Dependencies: Ensure you have Node.js and MongoDB installed. Run the following command to install the necessary packages:
npm install
-
Run MongoDB: Start the MongoDB service. Ensure it's running and accessible.
-
Start the Node.js Application: Run the following command to start the server:
node server.js
-
Access the Application:
- Node.js API: http://localhost:5000