Hi everyone, I'm attempting a Frontend Mentor challenge after a long time.
I have always used HTML, CSS and JavaScript for all my previous challenges. For this one, I decided to go with React and TailwindCSS. I thought that might help me learn React more. I want to learn more by building projects. It took me about 5-6 hours to code this.
One thing I noticed whilst is, coding with React felt faster compared to just plain HTML and CSS. I also used ChatGPT to solve errors with code and also implement the API functionality.
I used React, TailwindCSS and TinyURL for this project. Also implemented a mobile navigation menu to make this responsive for mobile devices. I believe it's not the best implementation, but it does work.
- React
- Vite
- Tailwind CSS
- Node.js
- Express.js
- Shorten long URLs
- Copy shortened URLs
- Responsive design
- Backend API built with Express
- TinyURL API integration
The biggest challenge was the API itself. I tried cleanuri but, noticed that the shortened URL was redirecting to some random websites. So, I had to switch to TinyURL for the URL shortening to actually work.
The next challenge was setting up the backend to make the API key secure. I had to set up Express to create a backend server and deploy it using Render. I'm not familiar with Backend, so this was a new kind of workflow for me. This setup took the longest time because switching from cleanuri to TinyURL gave me a bunch of errors and I had to change a lot of code. I had to check their documentations and do some ChatGPT to get these issues solved.
I did vibe code the footer since coding the footer is one of the most boring parts of a project as per my experience. It is responsive and does work as expected.
Any help on improving my code would be appreciated. I'm a beginner in React, so my code isn't the best — if you could share better coding practices, tips, or anything useful, that'd be great.
Clone the repository
git clone https://github.com/yourusername/url-shortener.git
cd url-shortenerInstall frontend dependencies
npm installInstall backend dependencies
cd server
npm installCreate a .env file in the project root.
VITE_API_URL=http://localhost:3000Create server/.env
TINYURL_API_TOKEN=YOUR_API_TOKENStart the backend
cd server
node server.jsStart the frontend
npm run dev-
Frontend: Vercel
-
Backend: Render
This is my attempt to apply what I have learned in React in a real project. I will try building more projects to create a solid foundation in React.
