Giter VIP home page Giter VIP logo

origranot / reduced.to Goto Github PK

View Code? Open in Web Editor NEW
645.0 3.0 277.0 22.7 MB

Free Modern URL Reducer. Make sure to share love by giving it a star.๐ŸŒŸ Have a great day!

Home Page: https://reduced.to

License: MIT License

JavaScript 1.06% CSS 1.10% TypeScript 97.44% Dockerfile 0.40%
html css nodejs contributions-welcome nestjs url-shortener tailwindcss typescript docker qwik hacktoberfest nx

reduced.to's Introduction

Contributors Forks Stargazers Issues


logo

Preview

Reduced.to is a modern web application that reduces the length of link URL. So it's easier to remember, share and track.

App ยท Report Bug ยท Request Feature


๐Ÿ“š Table of Contents
  1. ๐ŸŒ About The Project
  2. ๐Ÿš€ Getting Started
  3. ๐Ÿฑโ€๐Ÿ’ป Usage
  4. ๐Ÿงฑ Roadmap
  5. ๐Ÿฅ‡ Contributing
  6. ๐Ÿ† Contributors
  7. ๐Ÿ“ License
  8. ๐Ÿ’Œ Contact

๐ŸŒ About The Project

๐Ÿ”ฅ Built With

List of frameworks/libraries used to bootstrap the project.

  • NX
  • Nest
  • Qwik
  • Tailwindcss
  • Novu

(back to top)

๐Ÿš€ Getting Started

๐Ÿ“ƒ Prerequisites

List of things you need to run the project locally and how to install them.

  • npm
    npm install npm@latest -g
  • docker
    https://docs.docker.com/get-docker/

๐Ÿ’ป Installation

  1. Fork / Clone this repository
  2. Install NPM packages
    npm install
  3. Copy .example.env to .env and fill it properly (see Configuration)
  4. Make sure you have a local instance of PostgreSQL running on port 5432. If not, you can run it using docker:
    docker run --name reduced_to_db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=reduced_to_db -p 5432:5432 -d postgres
  5. Run Prisma migration from root folder:
    npx nx migrate-dev prisma --name=init
  6. Run the backend from root folder:
    npx nx serve backend
  7. Run the frontend from root folder:
    npx nx serve frontend

๐Ÿ‘ฉโ€๐Ÿ’ป Development

The project is structured in the following way:

.
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ backend
โ”‚   โ””โ”€โ”€ frontend
โ””โ”€โ”€ libs/
    โ”œโ”€โ”€ config
    โ””โ”€โ”€ prisma

๐Ÿณ Docker

You can build the docker images by running the following nx command:

npx nx run-many -t docker-build
  • This command will automatically build the dependencies and the backend and frontend images.

๐Ÿ™ Docker compose

  • In case you have docker installed, you can single-click deploy and test your changes by running the following and going to http://localhost:5000/ on your browser.

  • When you run the command below, don't forget to change the .env file with the correct values.

    docker compose -f docker/local/docker-compose.yml -p reduced-to up

โ˜ธ Deployment

You can deploy the app to a Kubernetes cluster by installing the Helm chart.

  1. Navigate to the chart directory (/docker/k8s/chart)
  2. Update the values in the values.yaml file
  3. Run the following command to deploy the app to your cluster:
helm install reduced-to . --namespace reduced-to --create-namespace

๐Ÿ‘ท Configuration

For the minimal configuration you can just rename the .example.env files to .env.

General
  • BACKEND_APP_PORT: Backend port
  • FRONTEND_APP_PORT: Frontend port
  • NODE_ENV: Node environment (development / production)
Database
  • DATABASE_URL: Database connection string
Rate Limit
  • RATE_LIMIT_TTL: Rate limit TTL (time to live)
  • RATE_LIMIT_COUNT: Number of requests within the ttl
Paddle - (Payment Gateway - https://www.paddle.com/ - Optional)
  • PADDLE_ENABLE: Wethter to enable Paddle or not
  • PADDLE_WEBHOOK_KEY: Get it from your Paddle account
  • PADDLE_SECRET_KEY: Get it from your Paddle account
Logger
  • LOGGER_CONSOLE_THRESHOLD: Threshold level of the console transporter.
Frontend
  • DOMAIN: Domain of your frontend app
  • PUBLIC_PADDLE_KEY: Get it from your Paddle account (Not needed when running locally)
  • API_DOMAIN: Domain of your backend instance (used for server side requests)
  • CLIENTSIDE_API_DOMAIN: Domain of your backend instance (used for client side requests)
  • STORAGE_DOMAIN=Domain of your bucket (used for storing images)
Redis
  • REDIS_ENABLE: Whether to use external Redis store or not
  • REDIS_HOST: Redis instance host
  • REDIS_PORT: Redis instance port
  • REDIS_PASSWORD: Redis instance password
  • REDIS_TTL: Redis ttl (in seconds)
Auth
  • JWT_ACCESS_SECRET: Jwt secret (used for access tokens)
  • JWT_REFRESH_SECRET: Jwt secret (used for refresh tokens)
Safe Browsing API
Novu
  • NOVU_API_KEY: Get it from https://novu.co/, you don't need this when running locally (just verify your email from the database)

Happy Hacking !

Change my plan on development

If you want to change your plan on developemnt (Assuming you have a local instance of PostgreSQL running on port 5432 and you don't have Paddle configured):

  1. Register locally on the app.
  2. Go to your database and create a new row in the Subscription table:
    • id: 1
    • userId: (you can find your user id in the User table)
    • plan: (FREE / PRO / BUSINESS)
    • status: active
    • endDate: Choose a date in the future
    • scheduledToBeCancelled: false
    • endDate: empty (NULL)
    • nextBilledAt: empty (NULL)
    • createdAt: current date
    • updatedAt: current date
  3. Relogin to the app (refresh the JWT token)
  4. You can now access the premium features.

(back to top)

๐Ÿฑโ€๐Ÿ’ป Usage

Simply copy and paste a URL into the provided area. Then click shorten URL! Your URL has now been shortened!

(back to top)

๐Ÿงฑ Roadmap

  • Migrate backend to NestJS
  • Migrate frontend to Qwik
  • Better README
  • Generate QRCode
  • Split front-end into components
  • Better UI
    • Animations
    • Logo
    • Dark/Light mode
  • Improve front-end components
  • Backend tests
  • Migration to Nx
  • Split backend into libs
  • Support k8s deployment (helm)
  • Front-end Tests
  • Logs
  • Add a statistics page
  • Add more ideas

Just create a Pull request already ๐Ÿ˜ƒ

See the open issues for a full list of proposed features (and known issues).

(back to top)

๐Ÿฅ‡ Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star โญ!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ† Contributors

(back to top)

๐Ÿ“ License

This project is licensed under the terms of the MIT License

(back to top)

๐Ÿ’Œ Contact

Project Link: https://github.com/origranot/reduced.to

(back to top)

reduced.to's People

Contributors

achiyahb avatar aigdonia avatar aliabbasjaffri avatar barkhaaroraa avatar biancam5 avatar dependabot[bot] avatar detronetdip avatar dev-code24 avatar dlibis avatar eduardconstantin avatar essofyany avatar febriadj avatar giladfuchs avatar goldenpheonix02 avatar guillempm avatar hridoyhazard avatar ibrahimtelman avatar jgoerner avatar naandalist avatar origranot avatar orimiles5 avatar owengaspard avatar sarthakk24 avatar saurabhcodes25 avatar siddharth9300 avatar tbetous avatar theshonuff avatar timoransky avatar vidishaag avatar xarielah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

reduced.to's Issues

Documentation is not updated

Issue:
After merging PR #64 , the directions in "HOW TO INSTALL " section in README.md is not working.

it is node app.js but it won't work, after making nextjs configurations. So I have to change this

image

to

npm start

DOCS: Need to update readme

Hey guys,

We migrated to NestJS on our previous pr.
We need to change the installation paragraph at the readme.

Migrate to frontend framework

As @origranot said, we should migrate to a frontend framework.
I could work on migrating to ๐Ÿ”ฐVue.js

I personally prefer Vue.js over React.js as it is so powerful framework and has a softer learning curve and its gaining more popularity over the time, if you prefer to migrate to React close this issue and let's wait for someone interested.

Star History

Star History Chart

Shortend URL Public Statistics Page

In Order to make a value for this App not to be another URL shortener, I believe we need to add some numbers.

As A short URL creator I need to track some statistics for the link I just created, I suggest the following number:

  • Number of Times this link was opened.
  • Geolocation, or list of Referrals where as this link was opened from.

Acceptance Criteria

  • Create a link details page at URL <domain>/<shortened_link>/stats.
  • this page should display the number of times this link was opened.
  • this page should display a brief of maximum 5 referral links that led to this link.
  • this page should be publicly accessible.

Custom shortened links

As A Shortened URL creator I need to create custom shortened links.

This is useful for premium users and advanced users.

Acceptance Criteria

  • User should be able to click create custom link button
  • user should enter custom link.
  • custom link should be validated not to be duplicate, and fulfills length and character validation

Better Space utilization

Currently, the items are placed at the top. So there is lot of negative space from top.
We can make it center aligned to properly utilize the space.
image

Animations

I can add animations to the frontend and i can also improve the ui using tailwind

Adding A Favicon

I can add a favicon icon to the website. Please assign me this.

Add copied animation

I would like to add a popup animation when the link is copied , also please assign me this issue if you want me to work on it

Websites without http or https are invalid

Currently it gives an "Invalid URL" error when a url is entered (without http or https)

image

So to fix this, in this PR i just added "https://" to the url if it doesn't start with the same.
This will also be checked later on, as usual
image

Not generating short link

The app is not generating shorl url link and keeps displaying This url is invalid...

The entered url: https://github.com/JunDevHarsh/amazon-clone.

Add a footer

add a footer to the section which makes the app a better visual impact.
kindly assign me the same. I am interested in working on this.

Clear input field after shortening url

HI, I'm thinking that maybe clearing input field after shortening url world create a better user experience for those who have more than one url to shorten?
Currently, users have to delete their input if they want to shorten another link (like the screenshot below).

image

Does this sound like a good idea to you? if so, I'm willing to make this small change.

Bug: Link copied message for invalid url as well

On clicking the display message of invalid link it says "Link has been copied to the clipboard" which doesn't make any sense

Here is the video displaying the issue -

screen-capture.1.webm

I can fix this issue and create a PR

Use Redis database to store data

Currently data is being stored in memory which can get deleted if the server restarts. Storing data externally to a database will keep data safe. Redis is a good solution, given the data we have is a key value pair.

Shortened URL directing to https://https:// link

When you paste the link and it's shortened, the page it redirects to has https:// in it twice

Steps to reproduce:

  1. Type in a link and press "Shorten URL"
  2. Copy URL and paste in browser

Screenshots
image
image

Check for Invalid Url

Currently, the app is shortening the URL provided by the user irrespective of being valid or invalid.
The URL should be verified before shortening it.
If URL does not exist "Invalid URL" message should be shown.

Develop button to switch between dark and light mode

Hello all!

I saw on the README.md, the suggestion to include the dark mode switch button.

I would like to work on this. I thought about leaving the light mode this way, what do you think?

light-mode

If it's ok, you can assign this issue to me. I will include this.

Add live link

Add a live link of the project to the readme or about page

Missing docker file

Hello! I saw that there's a docker file that's missing. Its better to have a docker of your application so that its easy to setup on any environment with just docker installed.
I can work on that, as a part of hacktoberfest and contribute towards url-shortner :-)

HerokuApp is broken

As I see heroku app is broken after converting the project to Typescript.

We need to specify some extra arguments to help him load the project.

I will create a PR adding this settings, can you assign me this task?

UI

Hey, I would like to work on improving the UI design for the web application. Please assign me this issue

Shortened URL copy as QR Code

As A Shortened URL creator, I need to copy the shortened URL as a QR Code

this should be useful for sharing the URL in printable scannable formats, it saves additonal step of using another service to generate QR code.

Acceptance Criteria

  • After creating a shortened URL, display button suggests if need to get QR format copy
  • button should be clickable and after click on it, it should generate a QR version of shortened url and displays it
  • QR image should be copied to clipboard and notify user about successful copy in clipboard.
  • QR image should not be stored on server in order not to consume space.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.