This web application is designed to use for club task, to provide a usable web application for environmental monitoring.
The Environmental Data Monitoring System is a web application that allows users to monitor real-time environmental data. The application supports data visualization and efficient data handling. It is built using the MERN (MongoDB, Express.js, React, Node.js) stack and features a user-friendly interface with robust backend support to ensure smooth and accurate data management.
The deployed appliction can be found from aws ec2:
http://ec2-34-230-50-244.compute-1.amazonaws.com/
(some of the project in backend is written in python, because initially use python flask beside node.js, and some of the imported file are in .py, but i use nodejs to make it a larger web applications to avoid some issues.)
- Data Visualization: Interactive charts and graphs for better data analysis.
- Data Logs: View historical environmental data logs.
- Log Entry: USer can submit, edit, delete new log through the website (in case it didn't, refresh the website after submitting it)
- Responsive Design: User-friendly interface compatible with various devices.
- Dynamic Components: Real-time data updates using React and Socket.IO.
Follow these steps to set up the project on your computer if you want to run it locally for development and testing:
- Node.js and npm installed.
- MongoDB installed locally on your machine.
- MongoDB Compass (optional) for managing your local database.
git clone https://github.com/Crepopcorn/environmental_data_monitoring.git
cd environmental_data_monitoring
npm install
cd client
npm install
Create a .env
file in the root directory with the following variables:
MONGO_URI=mongodb://localhost:27017/your-database-name
PORT=4000
Note: Replace
your-database-name
with the name of the MongoDB database you want to use (e.g.,environmental_data
).
Open a terminal and run:
mongod
If you haven't already created the database, open another terminal, run the MongoDB shell using:
mongo
Then, execute the following commands to create the database and collection:
use your-database-name // Replace with your chosen database name
db.createCollection('environmental_data') // Replace with your collection name if needed
Go back to the root directory and run:
npm start
Navigate to http://localhost:3000
in your browser to access the application.
- View Data: Monitor current and historical data trends on the dashboard.
server.js
: Main server file.client/
: Contains the React frontend code.routes/
: Backend API routes for handling data and user requests.models/
: Mongoose schemas for database management.public/
: Static files for the frontend..env
: Environment variables for configuration.
- React for frontend development.
- Express.js for server-side logic.
- MongoDB for local database management.
- Socket.IO for real-time data communication.