Home

Awesome

<a name="readme-top"></a>

<!-- PROJECT SHIELDS --> <div align="center">

Contributors Forks Stargazers Issues

</div> <!-- PROJECT LOGO --> <br /> <div align="center">

logo

Preview

<p align="center"> Reduced.to is a modern web application that reduces the length of link URL. So it's easier to remember, share and track. <br /> <br /> <a href="https://reduced.to">App</a> ยท <a href="https://github.com/origranot/reduced.to/issues/new?assignees=&labels=bug%2Ctriage&template=bug.yml">Report Bug</a> ยท <a href="https://github.com/origranot/reduced.to/issues/new?assignees=&labels=enhancement%2Ctriage&template=feature_request.yml">Request Feature</a> </p> </div> <br /> <!-- TABLE OF CONTENTS --> <details> <summary>๐Ÿ“š Table of Contents</summary> <ol> <li> <a href="#-about-the-project">๐ŸŒ About The Project</a> <ul> <li><a href="#-built-with">๐Ÿ”ฅ Built With</a></li> </ul> </li> <li> <a href="#-getting-started">๐Ÿš€ Getting Started</a> <ul> <li><a href="#-prerequisites">๐Ÿ“ƒ Prerequisites</a></li> <li><a href="#-installation">๐Ÿ’ป Installation</a></li> <li><a href="#-development">๐Ÿ‘ฉโ€๐Ÿ’ป Development</a></li> <li><a href="#-docker">๐Ÿณ Docker</a></li> <li><a href="#-docker-compose">๐Ÿ™ Docker Compose</a></li> <li><a href="#-configuration">๐Ÿ‘ท Configuration</a></li> </ul> </li> <li><a href="#-usage">๐Ÿฑโ€๐Ÿ’ป Usage</a></li> <li><a href="#-roadmap">๐Ÿงฑ Roadmap</a></li> <li><a href="#-contributing">๐Ÿฅ‡ Contributing</a></li> <li><a href="#-contributors">๐Ÿ† Contributors</a></li> <li><a href="#-license">๐Ÿ“ License</a></li> <li><a href="#-contact">๐Ÿ’Œ Contact</a></li> </ol> </details> <br/> <!-- ABOUT THE PROJECT -->

๐ŸŒ About The Project

<div align="center"> <img src="docs/reduced-to.gif" width="600" height="254"> </div>

๐Ÿ”ฅ Built With

List of frameworks/libraries used to bootstrap the project.

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- GETTING STARTED -->

๐Ÿš€ Getting Started

๐Ÿ“ƒ Prerequisites

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

๐Ÿ’ป 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

๐Ÿ™ Docker compose

โ˜ธ 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
Database
Rate Limit
Paddle - (Payment Gateway - https://www.paddle.com/ - Optional)
Logger
Frontend
Redis
Auth
Safe Browsing API
Novu

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.
<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- USAGE EXAMPLES -->

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

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

<div align="center"> <img src="docs/reduced-to.gif" width="600" height="254"> </div> <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- ROADMAP -->

๐Ÿงฑ Roadmap

Just create a Pull request already ๐Ÿ˜ƒ

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

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- CONTRIBUTING -->

๐Ÿฅ‡ 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

<a href = "https://github.com/origranot/reduced.to/graphs/contributors"> <img src = "https://contrib.rocks/image?repo=origranot/reduced.to"/> </a> <p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- LICENSE -->

๐Ÿ“ License

This project is licensed under the terms of the MIT License

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- CONTACT -->

๐Ÿ’Œ Contact

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

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- MARKDOWN LINKS & IMAGES -->