A simple MERN stack application that allows users to upload Excel or CSV files, parse them, and display the data with pagination (50 rows at a time).
- Upload Excel (.xlsx, .xls) or CSV files
- Parse files with 4 columns: sample_id, class_name, method_name, code_sample
- Display data in a clean, paginated format (25 rows per page)
- Copy all 25 rows at once to clipboard in formatted text
- Navigate between pages with Previous/Next buttons
- Responsive UI design
csv script/
├── backend/
│ ├── controllers/
│ │ └── uploadController.js
│ ├── routes/
│ │ └── uploadRoutes.js
│ ├── uploads/ (created automatically)
│ ├── package.json
│ └── server.js
├── frontend/
│ ├── public/
│ │ └── index.html
│ ├── src/
│ │ ├── components/
│ │ │ ├── Upload.js
│ │ │ ├── Upload.css
│ │ │ ├── Display.js
│ │ │ └── Display.css
│ │ ├── App.js
│ │ ├── App.css
│ │ ├── index.js
│ │ └── index.css
│ └── package.json
└── README.md
- Node.js (v14 or higher)
- npm or yarn
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Start the backend server:
npm startOr for development with auto-restart:
npm run devThe backend server will run on http://localhost:5000
- Open a new terminal and navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the React development server:
npm startThe frontend will open automatically at http://localhost:3000
- Open your browser and go to
http://localhost:3000 - Click on the file upload area or "Choose a file..." button
- Select an Excel (.xlsx, .xls) or CSV file with the following format:
- Column A: sample_id
- Column B: class_name
- Column C: method_name
- Column D: code_sample
- Click "Upload & Parse" button
- View the parsed data (first 25 rows)
- Click "Copy All 25 Rows" to copy current page data to clipboard
- Use "Next 25" and "Previous 25" buttons to navigate through pages
- Click "Back to Upload" to upload a new file
Upload and parse Excel/CSV file
- Request: multipart/form-data with file
- Response:
{
"message": "File uploaded and parsed successfully",
"totalRows": 673
}Get paginated data
- Query Parameters:
page(optional, default: 1)
- Response:
{
"data": [...],
"currentPage": 1,
"totalPages": 27,
"totalRows": 673,
"hasMore": true
}- Express.js - Web framework
- Multer - File upload handling
- xlsx - Excel/CSV parsing
- cors - Cross-origin resource sharing
- React - UI library
- Axios - HTTP client
- CSS3 - Styling
- Data is stored in memory. For production, consider using a database (MongoDB)
- Uploaded files are automatically deleted after parsing
- Maximum 25 rows displayed per page
- Copy button copies all 25 rows in formatted text
- Supports Excel (.xlsx, .xls) and CSV formats
ISC