Skip to content

jlabastida0000/icarus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icarus: WebAssembly-Powered File Uploader

Table of Contents

  1. Project Overview
  2. Technologies Used
  3. Project Structure
  4. Setup and Installation
  5. Development Workflow
  6. Key Features
  7. Areas for Improvement
  8. Next Steps
  9. Contributing
  10. License

Project Overview

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.

Technologies Used

  • 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

Architecture Overview

Icarus uses a hybrid architecture that combines the strengths of Rust/WebAssembly and Node.js/Express:

  1. 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.
  2. 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
  3. 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.

Project Structure

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

Setup and Installation

  1. Install Rust:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  2. Install wasm-pack:

    cargo install wasm-pack
    
  3. Install Node.js and npm: Download from nodejs.org

  4. Clone the repository:

    git clone <repository-url>
    cd icarus
    
  5. Install dependencies:

    cargo build
    cd www && npm install
    cd client && npm install
    
  6. Build the WebAssembly module:

    wasm-pack build
    

Development Workflow

  1. Start the server and client concurrently:

    cd www
    npm start
    
  2. Open your browser and navigate to http://localhost:8080

  3. For production build:

    cd www
    npm run build
    

Key Features

  • 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

Areas for Improvement

  1. Implement more robust error handling in Rust, Node.js, and React components
  2. Expand the range of supported file types and implement specific handling for each
  3. Add real-time progress tracking for file uploads
  4. Implement chunk-based uploading for very large files
  5. Enhance security measures, including file validation and sanitization
  6. Add capability to queue uploads when offline
  7. Implement multi-language support

Next Steps

  1. Implement Core Rust Functionality

    • File: src/lib.rs
    • Action: Implement basic file processing functions
  2. Create React File Uploader Component

    • File: www/client/src/components/FileUploader.js
    • Action: Implement the UI for file uploading
  3. Integrate WASM with React

    • Update www/client/src/App.js to use the WASM module
  4. Implement File Upload API

    • Enhance www/server/server.js with RESTful endpoints for file upload
  5. Add Tailwind CSS Styling

    • Update www/client/src/index.css with Tailwind imports
  6. Implement Testing

    • Add unit tests in Rust (tests/web.rs)
    • Add React component tests
  7. Enhance Documentation

    • Add inline documentation to Rust, Node.js, and React code
    • Update README with new features and instructions
  8. Optimization

    • Profile and optimize Rust code for performance
    • Optimize React rendering and state management
    • Improve Node.js server efficiency

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors