This project is a web-based LAS file viewer that allows users to upload and view LAS files directly in the browser. The application is built using React.js, Next.js, MongoDB, Node.js, and Express.
Before Upload File
After Upload File
Video Demo
Untitled.design.mp4
Project Structure
/las-file-viewer
├── /client # Frontend (Next.js)
│ ├── /pages
│ │ └── index.js # Main page of the frontend
│ ├── /styles
│ │ └── globals.css # Global CSS styles
│ └── .env.local # Environment variables for React
├── /uploads # Directory for storing uploaded files
├── server.js # Backend server
├── .env # Environment variables for Node.js
├── .gitignore # Git ignore file
└── README.md # Project READMEInstallation
- Clone the Repository:
git clone https://github.com/logusivam/Las-Viewer.git
cd las-file-viewer- Install Dependencies:
Navigate to the root directory and install backend dependencies:
npm installNavigate to the /client directory and install frontend dependencies:
cd client
npm install-
Create the
uploadsFolder:- In the root directory of the project, create a folder named
uploads. - This folder will be used to store the LAS files uploaded through the application.
- In the root directory of the project, create a folder named
-
Create a MongoDB Atlas Account:
- Sign up at MongoDB Atlas.
- Create a new cluster.
-
Set Up Your Database:
- Create a new database in your cluster.
- Create a new collection named
lasfilesto store the uploaded LAS files.
-
Get Your MongoDB Connection String:
- Navigate to your cluster in MongoDB Atlas.
- Click on "Connect" and choose "Connect your application".
- Copy the connection string provided.
-
Configure Environment Variables:
- In the root directory of your project, you’ll find a file named
.env.example. - Rename this file to
.envand replaceyour-mongodb-connection-string-herewith your actual MongoDB connection string:
- In the root directory of your project, you’ll find a file named
MONGO_URI=your-mongodb-connection-string-here
Note: The .env file is included in .gitignore to ensure sensitive information is not exposed in the repository.
Running the Project
-
Start the Backend Server:
- In the root directory, run the following command:
npm start- The backend server will run on
http://localhost:5000.
-
Start the Frontend Server:
- Navigate to the
/clientdirectory:
- Navigate to the
cd client- Run the following command:
npm run dev- The frontend will run on
http://localhost:3000.
-
Access the Application:
- Open your web browser and go to
http://localhost:3000. - You can now upload LAS files and view them in the browser.
- Open your web browser and go to
-
Uploading LAS Files:
- Click on the "Upload File" button.
- Select one or more LAS files from your computer.
- The uploaded files will be listed, and you can click on a file name to view its contents.
-
Viewing LAS Files:
- The selected LAS file will be displayed in the browser with the content formatted for easy viewing.
-
Customization:
- You can customize the background color, viewer styles, button colors, and other UI elements by modifying the
globals.cssfile in the/client/styles/ directory.
- You can customize the background color, viewer styles, button colors, and other UI elements by modifying the
- Environment Variables: The
.envfile is excluded from the repository using.gitignorefor security reasons. Ensure that you create and configure this file locally using the provided.env.example file. - File Uploads: Uploaded LAS files are stored in the
/uploadsdirectory on the server. - Development Mode: For development, you can use VS Code with MongoDB for VS Code extension to manage database connections and interact with your MongoDB Atlas instance.