This project demonstrates how to build a URL shortener using Node.js, React, and MongoDB. The application allows users to create shortened URLs that redirect to the original URL. It also tracks the number of visits to each shortened URL.
The project consists of a backend API and a frontend web application.
The backend is built using Node.js and Express.js. It provides the following functionalities:
- User authentication and authorization using JSON Web Tokens (JWT)
- URL shortening using a random string of characters
- Visit count tracking for shortened URLs
- CRUD operations for URLs
- Exporting URL history to an Excel sheet
The backend API is secured using CORS and rate limiting is implemented using Express Rate Limit.
The frontend is built using React and Bootstrap. It provides the following functionalities:
- User registration and login
- URL shortening form
- Displaying all shortened URLs generated by a user
- Exporting URL history to an Excel sheet
- Deleting shortened URLs
- Navigation using react-router-dom
- Integration with the backend API with Axios
name: Auto Format Code with Prettier
# This action automatically formats code with Prettier when a push is made to the main branch.
on:
push:
branches: [main]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- run: npm install
- run: npm run format
# if there are changes, commit and push them
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Auto formatting with Prettier"
git push