Frontend of Url Shortener project for Next.js in TypeScript. Backend Repository: url-shortener-java-backend
Access the website at https://url-shortener-nextjs-frontend.vercel.app/
The backend app is hosted on Render's free tier. Render spins down a Free web service that goes 15 minutes without receiving inbound traffic. Render spins the service back up whenever it next receives a request to process.
So if the website appears unresponsive, the backend is likely in "sleep" mode after being idle for 15 minutes.
It’s currently waking up, which may take up to a minute. Kindly wait for a moment, and the app will be ready shortly. Thank you for your understanding!
- Next.js App - Hosted on Vercel
How to Create & Deploy a new Next.js App
This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
How to run the app locally
-
Node.js 22+ - Ensure you have Node.js version 22 or later installed. You can download it from Node.js Official Site.
-
npm or yarn or pnpm - A package manager to install dependencies. npm comes with Node.js, but you can also use yarn / pnpm if preferred.
- Fork the repository using the Fork button at the top-right corner of the repository page.
- Clone the forked repository:
git clone https://github.com/yourusername/nextjs-app.git
cd nextjs-app
Run the following command in the project directory to install all required dependencies:
npm install
yarn install
pnpm install
If your project uses environment variables, create a .env file in the root directory and add the required variables. Example:
NEXT_PUBLIC_BACKEND_CLOUD_ENDPOINT=<base-url-of-hosted-backend-server>
NEXT_PUBLIC_BACKEND_REST_PATH=<rest-api-path-of-backend-service>
NEXT_PUBLIC_SHOW_INFO_BUTTON=true [If you need to show the info. message button on bottom right of page]
NEXT_PUBLIC_INFO_MESSAGE_LINE1=<line-1-of-message>
NEXT_PUBLIC_INFO_MESSAGE_LINE2=<line-2-of-message> [Optional]
AUTH_SECRET= [Should be added by AuthJS automatically when you run npx auth secret]
AUTH_GOOGLE_ID=<create-a-new-app-in-google-cloud-console-and-create-a-credential>
AUTH_GOOGLE_SECRET=<create-a-new-app-in-google-cloud-console-and-create-a-credential>
Ensure you do not commit sensitive data by adding .env to .gitignore:
echo ".env*" >> .gitignore
Start the development server using:
npm run dev
yarn dev
pnpm dev
The server will start, and the application will be accessible at http://localhost:3000.