A URL shortener application built with Rust (backend) and React + TypeScript + Vite + Tailwind CSS (frontend).
- Rust and Cargo
- Node.js and npm
- PostgreSQL
-
Navigate to the backend directory:
cd backend
-
Create a PostgreSQL database named
url_shortener
-
Update the
.env
file with your PostgreSQL credentials:DATABASE_URL=postgres://username:password@localhost:5432/url_shortener
-
Run the backend server:
cargo run
The backend server will start on http://localhost:8080
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be available at http://localhost:5173
- Shorten long URLs
- Redirect to original URLs using short codes
- Modern and responsive UI
- Type-safe API communication
- PostgreSQL database for URL storage
POST /api/urls
- Create a new short URLGET /{short_code}
- Redirect to the original URL