Summary
Monitor Inside is a fullstack web application that provides real-time information about your server and where you can also manage users who can see or edit other users.
The main focus of this application is nodejs' native library, child_process. In the application I opened a child process with the child_process fork method and created a new thread to monitor the server and the main thread was in charge of the user crud api.
The child thread (that monitors the server's state) is in charge of reading the server's state and send it in real time through a socket server, where every 1 second it sends the data to all connected clients, and every 5 seconds it saves the state in the mongodb.
There is also Seq, an application for visualization of application errors, where we can see when the error occurs when monitoring, saving something in mongo or an error in the application.
Details
1️⃣ Databases:
- The mysql database saves the user data (password, name, email...)
- The mongo database saves the server status every 5 seconds
- Docker MySQL container already configured in
docker-composewith a service defined asmysql. - Docker Mongo container already configured in
docker-composewith a service defined asmongo.
2️⃣ Back-end:
- It runs on port
3001. - Nodejs Docker container already configured in
docker-composewith a service defined asnode-server.
3️⃣ Front-end:
- It runs on port
8081. - Nodejs (Vue) connected in Nginx Web server and container already configured in
docker-composewith a service defined asvue_client.
- User login, both for common users and administrators.
- Real time visualization (one second delay) of the server state that is running the application
- Register, edit and remove users. Only available for administrator users
To run the project locally, follow the steps below.
- Check that your machine has the minimum configuration for the project to run;
- Unix Distribution Operating System;
- Docker;
- Docker-compose version equal to or greater than
1.29.2.
- Clone the repository;
git clone https://github.com/RuhamLeal/monitor-inside-app.git
- Navigate to the root of the project;
cd ./monitor-inside-app
-
In the ./backend folder create an .env file from scratch with the contents of env.example
-
Run command to create the containers
docker-compose up -d --build
docker exec -it node_server sh
- Inside the server container run:
npx prisma db push
npm run seed
-
Open your browser and paste the url http://localhost:8081#/login
-
Open Seq Application in http://localhost:5341
-
Log in with:
password: AdminPass,
email: admin@admin.com
password: user,
email: user001@user.com,
- Data modeling with Prisma and Typescript.
- Application of the MSC (Model-Service-Controller) and DDD (Domain Driven Design) software architecture concept.
- Configuring Dockerfiles for back-end and front-end.
- Application of Object Oriented Paradigm (OOP) principles.
- Applying SOLID principles.
Ruham Leal
Email: ruhamxlpro@hotmail.com