DhananjayThomble / URL-Shortener-App

URL Shortener WebApp & Chrome-Extension using Javascript, Node.js, React, and MongoDB.
https://app.snapurl.in
MIT License
54 stars 54 forks source link
chrome-extension digitalocean expressjs hacktoberfest javascript jwt learn learning-by-doing mongodb mongoose nodejs react

SnapURL: The Beginner-Friendly URL Shortener

SnapURL is an open-source URL shortener web application and chrome-extension. It simplifies the process of converting long URLs into short and shareable links.

Features

Future Plans

We have exciting plans to enhance SnapURL in the future, making it even more robust and user-friendly. Our upcoming features include:

User Profile Enhancements

Advanced URL Management

Analytics and Reporting

Integration and Sharing

Enhanced User Experience

Additional Feature Ideas

Tech Stack

Backend

Frontend

Deployment

Prerequisites

Getting Started

  1. Clone the repository:

    git clone https://github.com/DhananjayThomble/URL-Shortener-App.git
  2. Install the dependencies:

    cd ./URL-Shortener-App
    npm install
  3. Goto the backend directory

  4. Create a .env file in the backend directory and add the following environment variables:

    DB_URL=<your-mongodb-database-url>
    JWT_SECRET=<your-jwt-secret>
    SESSION_SECRET=<your-session-secret>
    PORT=4001
    BASE_URL=http://localhost:4001
    SHORT_URL_PREFIX=http://localhost:4001/u 
    EMAIL_HOST=<your-email-host>, e.g. smtp.gmail.com
    EMAIL_PORT=<your-email-port>, e.g. 587
    EMAIL_HOST_USER=<your-email-host-user>, e.g. john@gmail.com
    EMAIL_HOST_PASSWORD=<your-email-host-password>, e.g. btvpykqmgtrpeukj
    FRONTEND_URL=<your-frontend-webapp-url>

    Example .env file:

      DB_URL=mongodb+srv://<username>:<password>@<cluster-url>/<database-name>?retryWrites=true&w=majority
      JWT_SECRET=secret
      SESSION_SECRET=secret
      PORT=4001
      BASE_URL=http://localhost:4001
      SHORT_URL_PREFIX=http://localhost:4001/u
      EMAIL_HOST=smtp.gmail.com
      EMAIL_PORT=587
      EMAIL_HOST_USER=john@gmail.com
      EMAIL_HOST_PASSWORD=btvpykqmgtrpeukj
      FRONTEND_URL=https://app.snapurl.in

    You can get your MongoDB database URL from here.

    You can get your Email Host, Email Port, Email Host User and Email Host Password from your email service provider. You can even use your Gmail account for this. If you have enabled 2-step verification for your gmail account, you will need to generate an app password. you can find more information about this here.

    Contact me if you need help with this.

  5. Goto the frontend directory:

  6. Create a .env file in the frontend directory and add the following environment variables:

    VITE_API_ENDPOINT=http://localhost:4001
  7. Start both backend and the frontend server from the root directory

    npm start
  8. Open http://localhost:4001/doc to view the API documentation.

  9. To view the frontend, check the terminal for the URL.

Contributing

SnapURL is a welcoming community for all contributors. Feel free to open an issue or submit a pull request! Your feedback and contributions are always welcome as we continue to grow and improve

Additional Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.

Enjoy your journey with SnapURL! 🚀