This is the React frontend for the CSV processing application. It provides an intuitive and responsive UI for uploading CSV files, tracking progress, and browsing the processed product data with exchange rate conversions.
- React (Vite) ⚡ - Fast and optimized front-end framework
- TypeScript - Strict typing for maintainability
- TailwindCSS - Modern styling with utility classes
- Axios - API requests for seamless data fetching
- Context API - Lightweight global state management
frontend/
├── src/
│ ├── components/ # UI components (FileUpload, ProductTable)
│ ├── contexts/ # Global state (FileUploadContext)
│ ├── App.tsx # Main application entry
│ ├── index.css # Global styles (Tailwind)
│ ├── main.tsx # React DOM rendering
├── public/ # Static assets
├── .eslintrc # Linting configuration
├── .prettierrc # Code formatting rules
├── package.json # Dependencies
- CSV upload
- Shows real-time progress while processing
- Triggers automatic table update upon completion
- Displays all uploaded products
- Search functionality (filters products by name dynamically)
- Sorting & pagination (name, price, expiration)
- Exchange rate conversions displayed per product
- Implements useCallback & useMemo for optimized rendering
- Lightweight state management with React Context API
- Prevents malicious file uploads (validates CSV format)
- Handles edge cases like duplicate uploads
- Graceful error handling with informative UI messages
1️⃣ User uploads a CSV file
2️⃣ File is validated and processed asynchronously
3️⃣ Products are saved with exchange rate conversions
4️⃣ Product table updates automatically
5️⃣ User can filter, sort, and browse paginated results
git clone https://github.com/flatironsdevelopment/rails_node_test_arthursvpb.git
cd frontend
npm install
npm run dev
The app will be available at http://localhost:5173
.
✅ Vite + React project initialized
✅ TypeScript configured
✅ ESLint + Prettier integration
✅ CSV upload with progress tracking
✅ Auto-refresh product table on completion
✅ Fetch products from backend
✅ Sorting, filtering, and pagination
✅ Displays converted exchange rates
✅ useMemo & useCallback to optimize rendering
✅ Minimal re-renders with Context API
✅ Prevents invalid CSV uploads
✅ Handles backend errors gracefully
✅ Prevents unnecessary API calls
- 🔹 Improve UI/UX – Add better loading indicators & animations
- 🔹 Add Unit & E2E Tests – Jest for unit tests, Cypress for integration tests
- 🔹 Infinite Scroll for Large Datasets – Better pagination experience
- 🔹 Improve Accessibility – Make app keyboard & screen-reader friendly
- 🔹 Integrate React Query for API Requests – Improve server state management and caching