Skip to content

Latest commit

 

History

History
79 lines (63 loc) · 1.71 KB

File metadata and controls

79 lines (63 loc) · 1.71 KB

LinkedList API

A web application showcasing a Linked List implementation using a Rust backend and a React frontend.

Project Structure

/project-root
│── /app      # Rust backend
│── /web      # React frontend
│── README.md

Prerequisites Ensure you have the following installed:

# Install Rust (if not installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install Node.js (if not installed)
# Visit https://nodejs.org/ or use a package manager:
# macOS: brew install node
# Ubuntu: sudo apt install nodejs npm

Running the Application Locally

  1. Start the Rust Backend
cd app
cargo run

This will start the backend server.

  1. Start the React Frontend
cd web
npm install  # Install dependencies (only needed the first time)
npm run dev

This will start the frontend development server.

API Endpoints

Your Rust backend provides an API to interact with a linked list. The available endpoints include:

# Get all elements in the linked list
GET /

# Get the size of the linked list
GET /size

# Add an element to the linked list
POST /add
Body: { "data": <integer> }

# Search for an element in the linked list
GET /search?key=<integer>

# Insert an element at a specific index
POST /insert
Body: { "data": <integer>, "index": <integer> }

# Remove an element from the linked list
POST /remove
Body: { "key": <integer> }

Configuration

If needed, update the frontend API URL in:

web/src/config.js
# or
web/.env

Deployment

For deployment, ensure your backend is hosted (e.g., Render) and update the frontend’s API configuration accordingly.

License

MIT License