- Overview
- Folder Structure
- Prerequisites
- Running the Project with Docker Compose
- Accessing the Application
- Stopping the Services
- Troubleshooting
- Additional Information
- Contact
This project consists of two backend APIs built with NestJS and a frontend application developed using Vite and React. The backend services manage phishing attempts and simulations, while the frontend provides a user interface for interacting with these services.
project-root/
│
├── backend/
│ ├── phishing-attempt-management/ # NestJS API for managing phishing attempts
│ └── phishing-simulation/ # NestJS API for phishing simulations
│
├── frontend/ # Vite React frontend application
│
├── docker-compose.yml # Docker Compose configuration
│
└── README.md # Project documentation
Before running the project using Docker Compose, ensure you have the following installed on your machine:
Docker Compose simplifies the process of running multiple Docker containers for your application. Follow the steps below to start the project using Docker Compose.
Create a .env
file in directory of the projects with the following environment variables:
# Frontend - /frontend/.env
VITE_BASE_URL=http://localhost:3000
# Phishing Attempt Management Service - /backend/phishing-attempt-management/.env
JWT_SECRET=security_key
SEND_EMAIL_URI=http://localhost:3001/phishing/send
MONGO_URI=mongodb://localhost:27017/local
NODE_ENV=DEVELOPMENT
PHISHING_LINK=http://localhost:3000/phishing-attempts/
# Phishing Simulation Service - /backend/phishing-simulation/.env
NODE_ENV=DEVELOPMENT
JWT_SECRET=security_key
MONGO_URI=mongodb://localhost:27017/local
EMAIL_HOST=smtp.example.email
EMAIL_PORT=587
EMAIL_USER=[email protected]
EMAIL_USER_PASSWORD=SOME_PASSWORD
# Database
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=adminpassword
Note: Ensure that sensitive information like
JWT_SECRET
andEMAIL_USER_PASSWORD
are secured and not exposed in public repositories. Consider using Docker secrets or environment variable management tools for enhanced security in production environments.
From the root directory of the project, run:
docker-compose up --build
This command will build the Docker images and start all the services defined in the docker-compose.yml
file.
Once all services are up and running, you can access the application as follows:
- Frontend Application: http://localhost
- Phishing Attempt Management API: http://localhost:3000
- Phishing Simulation API: http://localhost:3001
Adjust the ports as defined in your
docker-compose.yml
if they differ.
To stop all running services, press Ctrl + C
in the terminal where Docker Compose is running. To remove the containers, networks, and volumes created by Docker Compose, run:
docker-compose down
If you encounter errors about ports being already in use, ensure that no other applications are running on the same ports. You can modify the ports in the docker-compose.yml
file if necessary.
Ensure that MongoDB is running correctly and that the MONGO_URI
is correctly configured. Check the logs for the MongoDB container using:
docker-compose logs mongo
- Verify that the SMTP credentials are correct.
- Ensure that the credentials provided in the
.env
file are valid.
- Ensure that all dependencies are correctly installed.
- Rebuild the Docker images with:
docker-compose build --no-cache
- Set up CI/CD pipelines to automate testing and deployment processes.
- Utilize platforms like GitHub Actions, GitLab CI, or Jenkins.
For any issues or inquiries, please contact [email protected].
This README was generated to assist in setting up and running the Phishing Management and Simulation Project using Docker Compose.