Loganalyzer is a web application consisting of a frontend and a backend connected to a MongoDB database. This project is designed to analyze logs and visualize the data in a user-friendly interface.
- β
Parses Linux log files (
/var/log/syslog
) - β Stores logs in MongoDB
- β
Provides a REST API:
/logs
: Endpoint for retrieving log data/upload
: Endpoint for uploading logs
- π Provide a REST API
/logs/:id
for retrieving individual log entries - π AI-powered issue detection & fixes (Potential integration with OpenAI or Gemini)
- π Real-time log streaming via WebSockets
- π Dashboard route for visualizing log data (date, time, count, etc.)
frontend
: The frontend of the web application, built with a modern JavaScript framework.backend
: The backend API that serves the data to the frontend, using Node.js and MongoDB.db
: MongoDB container used to store the logs data.
Before you begin, ensure you have the following installed on your local machine:
Follow these steps to get the project running locally:
git clone https://github.com/dineshsutihar/Log-Analyzer.git
cd Log-Analyzer
You can use Docker Compose to build and start the containers. In your terminal, run the following:
docker-compose up --build
This will build the images for the frontend, backend, and database, and then start the services.
- Frontend: Open your browser and go to
http://localhost:5173
to access the web application. - API: The backend API is available at
http://localhost:3000
.
To stop the containers, you can run:
docker-compose down
This will stop and remove the containers but preserve the data in the MongoDB volume.
Here is the folder structure of the project:
/
βββ backend/ # Backend API code
β βββ ...
βββ frontend/ # Frontend application code
β βββ ...
βββ docker-compose.yml # Docker Compose file to manage containers
βββ README.md # This file
If you face any issues while running the application, here are some common checks:
- Ensure Docker and Docker Compose are correctly installed.
- Check container logs using:
For example, to view frontend logs:
docker-compose logs <service-name>
docker-compose logs web
To develop locally on your machine, follow these steps:
Also, to set up individually, you may require a .env
file with some required data.
-
Install dependencies for the frontend and backend:
# For the frontend cd frontend npm install # For the backend cd ../backend npm install
-
Start the frontend and backend services separately (if not using Docker Compose):
# Start the backend npm run dev # Start the frontend npm run dev
The project uses a Docker volume for MongoDB to persist data. You can view the volume with:
docker volume ls
To remove the volume (if needed):
docker volume rm mongodb_data
Feel free to fork the repository and submit pull requests for new features or bug fixes. Please make sure to write clear commit messages and follow the project's coding standards.
This project is licensed under the MIT License - see the LICENSE file for details.