https://github.com/emjjkk/ant
Minimal URL shortener and QR code generator with API, using React and Flask.
https://github.com/emjjkk/ant
axios flask react vite
Last synced: 3 months ago
JSON representation
Minimal URL shortener and QR code generator with API, using React and Flask.
- Host: GitHub
- URL: https://github.com/emjjkk/ant
- Owner: emjjkk
- License: mit
- Created: 2023-12-22T12:19:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-28T11:37:28.000Z (over 2 years ago)
- Last Synced: 2025-01-14T01:14:57.996Z (over 1 year ago)
- Topics: axios, flask, react, vite
- Language: JavaScript
- Homepage: https://antlink.vercel.app
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> The demo of this project no longer works because ElephantSQL stopped existing :(
> If you change the db, however, everything should function fine.

# 🐜 Url Shortener + QR Code Generator w/ API
__It works in theory, but...__ For now, this project is a demo merely to demonstrate how a URL Shortener and QR Code Generator might work, using Javascript for the frontend and Python for the backend. As a result, the generated URL might not actually be shorter than the original (because of the use of a free domain) and also takes a long time to generate (because Render spins down with inactivity). However, all other functionalities will function as expected.
### Technologies
- Vite (Build)
- React (Front-End Framework)
- TailwindCSS (CSS Framework)
- Flask (Backend)
- cs50 Library For Python (Backend)
- PostgreSQL (Database)
- ElephantSQL (Database Provider)
- Vercel (Front-End Hosting)
- Render (Backend Hosting)
## API
This project also provides an experimental minimal open API which does not require the use of an API key or any authentication method. Below are some code snippets to demonstrate their usage.
### URL Shortener:
```
const url = 'https://ant-erqz.onrender.com/api/v1/generate_url';
const requestData = { start_url: 'your_actual_url_here'};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(requestData),
})
.then (response => {
console.log(response)
})
```
### QR Code:
```
const url = 'https://ant-erqz.onrender.com/api/v1/generate_qr';
const requestData = { start_url: 'your_actual_url_here'};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(requestData),
})
.then (response => {
console.log(response)
})
```