- Project Overview
- Technologies Used
- Project Structure
- Setup and Installation
- Development Workflow
- Key Features
- Areas for Improvement
- Next Steps
- Contributing
- License
Icarus is a high-performance file uploader that leverages the power of Rust, WebAssembly (WASM), Node.js, and React to provide a seamless and efficient file uploading experience. By combining Rust's performance with WASM's browser capabilities, Node.js server, and React's user interface, Icarus offers a unique solution for handling file uploads in web applications.
- Rust: Core logic and performance-critical operations
- WebAssembly (WASM): Browser-side execution of Rust code
- Node.js: Server-side operations and API handling
- React: User interface and component management
- Tailwind CSS: Styling and responsive design
- webpack: Module bundling and development server
- wasm-pack: Tool for building Rust-generated WebAssembly
- Express: Web application framework for Node.js
Icarus uses a hybrid architecture that combines the strengths of Rust/WebAssembly and Node.js/Express:
-
Rust and WebAssembly:
- Handles performance-critical operations like file processing, compression, or encryption.
- Runs on the client-side (in the browser) via WebAssembly, enabling fast, local file operations.
-
Node.js and Express:
- Provides a server-side API for operations that can't be done client-side, such as:
- Handling file uploads to the server
- Interacting with databases or external services
- Managing user sessions and authentication
- Serves the React application and static assets
- Acts as a reverse proxy for the Rust backend if needed
- Provides a server-side API for operations that can't be done client-side, such as:
-
React:
- Builds the user interface
- Integrates with the WASM module for client-side operations
- Communicates with the Express server for server-side operations
This architecture allows us to leverage the performance benefits of Rust/WASM for compute-intensive tasks while using the rich ecosystem of Node.js for server-side operations and API management. The Express server acts as a bridge between the client-side application and any server-side resources or services that may be needed.
icarus/
├── Cargo.toml
├── Cargo.lock
├── src/
│ ├── lib.rs
│ └── utils/
│ └── mod.rs
├── tests/
│ └── web.rs
├── www/
│ ├── client/
│ │ ├── src/
│ │ │ ├── App.js
│ │ │ ├── index.js
│ │ │ └── index.css
│ │ ├── public/
│ │ │ └── index.html
│ │ ├── package.json
│ │ ├── webpack.config.js
│ │ ├── postcss.config.js
│ │ └── tailwind.config.js
│ ├── server/
│ │ └── server.js
│ ├── package.json
│ └── uploads/
└── README.md
-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -
Install wasm-pack:
cargo install wasm-pack -
Install Node.js and npm: Download from nodejs.org
-
Clone the repository:
git clone <repository-url> cd icarus -
Install dependencies:
cargo build cd www && npm install cd client && npm install -
Build the WebAssembly module:
wasm-pack build
-
Start the server and client concurrently:
cd www npm start -
Open your browser and navigate to
http://localhost:8080 -
For production build:
cd www npm run build
- High-performance file processing using Rust and WASM
- Server-side handling with Node.js and Express
- Responsive and intuitive UI with React and Tailwind CSS
- Real-time updates using WebSockets
- Efficient handling of large files
- Cross-platform compatibility
- Implement more robust error handling in Rust, Node.js, and React components
- Expand the range of supported file types and implement specific handling for each
- Add real-time progress tracking for file uploads
- Implement chunk-based uploading for very large files
- Enhance security measures, including file validation and sanitization
- Add capability to queue uploads when offline
- Implement multi-language support
-
Implement Core Rust Functionality
- File:
src/lib.rs - Action: Implement basic file processing functions
- File:
-
Create React File Uploader Component
- File:
www/client/src/components/FileUploader.js - Action: Implement the UI for file uploading
- File:
-
Integrate WASM with React
- Update
www/client/src/App.jsto use the WASM module
- Update
-
Implement File Upload API
- Enhance
www/server/server.jswith RESTful endpoints for file upload
- Enhance
-
Add Tailwind CSS Styling
- Update
www/client/src/index.csswith Tailwind imports
- Update
-
Implement Testing
- Add unit tests in Rust (
tests/web.rs) - Add React component tests
- Add unit tests in Rust (
-
Enhance Documentation
- Add inline documentation to Rust, Node.js, and React code
- Update README with new features and instructions
-
Optimization
- Profile and optimize Rust code for performance
- Optimize React rendering and state management
- Improve Node.js server efficiency
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.