2022-10-09 08:27:30 +03:00
< a name = "readme-top" > < / a >
2022-10-05 20:46:30 +03:00
2022-10-09 08:27:30 +03:00
<!-- PROJECT SHIELDS -->
2022-10-09 17:05:15 +03:00
< div align = "center" >
2022-10-05 18:20:38 +03:00
2022-10-13 01:17:49 +03:00
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
2022-10-09 17:05:15 +03:00
< / div >
2022-10-08 09:21:39 -04:00
2022-10-09 08:27:30 +03:00
<!-- PROJECT LOGO -->
< br / >
< div align = "center" >
2022-10-14 00:00:13 +03:00
2022-12-14 20:00:20 +02:00
[](https://reduced.to)
2022-10-09 08:27:30 +03:00
2023-09-29 07:26:39 +01:00
[](https://reduced.to)
2022-10-09 08:27:30 +03:00
< p align = "center" >
2022-10-13 22:13:13 +03:00
Reduced.to is a modern web application that reduces the length of link URL. So it's easier to remember, share and track.
2022-10-09 08:27:30 +03:00
< br / >
< br / >
2022-10-13 22:13:13 +03:00
< a href = "https://reduced.to" > App< / a >
2022-10-09 08:27:30 +03:00
·
2022-10-31 18:10:57 +05:30
< a href = "https://github.com/origranot/reduced.to/issues/new?assignees=&labels=bug%2Ctriage&template=bug.yml" > Report Bug< / a >
2022-10-09 08:27:30 +03:00
·
2022-10-31 18:10:57 +05:30
< a href = "https://github.com/origranot/reduced.to/issues/new?assignees=&labels=enhancement%2Ctriage&template=feature_request.yml" > Request Feature< / a >
2022-10-09 08:27:30 +03:00
< / p >
< / div >
< br / >
<!-- TABLE OF CONTENTS -->
< details >
< summary > 📚 Table of Contents< / summary >
< ol >
< li >
2022-10-17 15:08:58 +05:30
< a href = "#-about-the-project" > 🌐 About The Project< / a >
2022-10-09 08:27:30 +03:00
< ul >
2022-10-17 15:08:58 +05:30
< li > < a href = "#-built-with" > 🔥 Built With< / a > < / li >
2022-10-09 08:27:30 +03:00
< / ul >
< / li >
< li >
2022-10-17 15:08:58 +05:30
< a href = "#-getting-started" > 🚀 Getting Started< / a >
2022-10-09 08:27:30 +03:00
< ul >
2022-10-17 15:08:58 +05:30
< 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 >
2022-10-24 22:31:03 +03:00
< li > < a href = "#-configuration" > 👷 Configuration< / a > < / li >
2022-10-09 08:27:30 +03:00
< / ul >
< / li >
2022-10-17 15:08:58 +05:30
< 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 >
2022-10-09 08:27:30 +03:00
< / ol >
< / details >
< br / >
<!-- ABOUT THE PROJECT -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 🌐 About The Project
2022-10-10 10:02:25 -05:00
< div align = "center" >
2022-10-19 17:17:31 +06:00
< img src = "docs/reduced-to.gif" width = "600" height = "254" >
2022-10-10 10:02:25 -05:00
< / div >
2022-10-05 20:46:30 +03:00
2022-10-09 08:27:30 +03:00
### 🔥 Built With
List of frameworks/libraries used to bootstrap the project.
2023-09-10 10:56:28 +03:00
- [![NX][nx]][nx-url]
2022-10-13 01:17:49 +03:00
- [![Nest][nestjs]][nest-url]
- [![Qwik][qwik.js]][qwik-url]
- [![Tailwindcss][tailwindcss]][tailwindcss-url]
2022-11-04 22:11:40 +02:00
- [![Novu][novu]][novu-url]
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
<!-- GETTING STARTED -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 🚀 Getting Started
### 📃 Prerequisites
List of things you need to run the project locally and how to install them.
2022-10-13 01:17:49 +03:00
- npm
2022-10-09 08:27:30 +03:00
```sh
npm install npm@latest -g
```
2023-05-14 22:18:55 +03:00
- docker
```sh
https://docs.docker.com/get-docker/
```
2022-10-09 08:27:30 +03:00
### 💻 Installation
2022-10-24 22:31:03 +03:00
1. [Fork ](https://github.com/origranot/reduced.to/fork ) / Clone this repository
2023-06-27 23:13:15 +03:00
2. Install NPM packages
2022-10-13 01:17:49 +03:00
```sh
2023-10-01 06:23:05 -04:00
npm install
2022-10-13 01:17:49 +03:00
```
2023-09-15 17:35:05 +03:00
3. Copy `.example.env` to `.env` and fill it properly (see [Configuration ](#-configuration ))
4. Make sure you have a local instance of PostgreSQL running on port 5432. If not, you can run it using docker:
2023-05-14 22:18:55 +03:00
```sh
2023-05-15 21:56:50 +03:00
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
2023-05-14 22:18:55 +03:00
```
2023-09-15 17:35:05 +03:00
5. Run Prisma migration from root folder:
2023-05-14 22:50:05 +03:00
```sh
2023-09-10 10:56:28 +03:00
npx nx migrate-dev prisma --name=init
2023-05-14 22:50:05 +03:00
```
2023-09-15 17:35:05 +03:00
6. Run the backend from root folder:
2022-10-13 01:17:49 +03:00
```sh
2023-09-10 10:56:28 +03:00
npx nx serve backend
2022-10-13 01:17:49 +03:00
```
2023-09-15 17:35:05 +03:00
7. Run the frontend from root folder:
2022-10-13 01:17:49 +03:00
```sh
2023-09-10 10:57:19 +03:00
npx nx serve frontend
2022-10-13 01:17:49 +03:00
```
2022-10-09 08:27:30 +03:00
### 👩💻 Development
2022-10-13 01:17:49 +03:00
2023-06-27 23:13:15 +03:00
The project is structured in the following way:
2022-10-13 01:17:49 +03:00
2023-09-10 10:56:28 +03:00
```
.
├── apps/
│ ├── backend
│ └── frontend
└── libs/
2023-09-15 17:35:05 +03:00
├── config
2023-09-10 10:56:28 +03:00
└── prisma
```
2022-10-09 08:27:30 +03:00
### 🐳 Docker
2022-10-13 01:17:49 +03:00
2023-09-10 10:56:28 +03:00
You can build the docker images by running the following nx command:
2023-05-15 22:24:12 +03:00
2023-09-11 22:45:38 +03:00
```sh
npx nx run-many -t docker-build
```
2022-10-25 00:54:38 +03:00
2023-09-10 10:56:28 +03:00
- This command will automatically build the dependencies and the backend and frontend images.
2022-10-09 08:27:30 +03:00
### 🐙 Docker compose
2022-10-13 01:17:49 +03:00
2022-10-25 00:54:38 +03:00
- 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.
2023-06-27 23:13:15 +03:00
- When you run the command below, don't forget to change the .env file with the correct values.
2023-06-28 20:40:06 +03:00
2022-10-09 08:27:30 +03:00
```sh
2023-06-27 23:13:15 +03:00
docker compose -f docker/local/docker-compose.yml -p reduced-to up
2022-10-09 08:27:30 +03:00
```
2023-06-27 23:49:15 +03:00
2024-07-14 16:41:23 +03:00
### ☸ Deployment
You can deploy the app to a Kubernetes cluster by installing the [Helm ](https://helm.sh/ ) 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:
```sh
helm install reduced-to . --namespace reduced-to --create-namespace
```
2022-10-24 22:31:03 +03:00
### 👷 Configuration
2023-09-10 10:56:28 +03:00
For the minimal configuration you can just rename the `.example.env` files to `.env` .
2022-10-24 22:31:03 +03:00
2023-09-15 17:35:05 +03:00
###### General
2022-10-25 00:54:38 +03:00
2023-09-15 17:35:05 +03:00
- **BACKEND_APP_PORT**: Backend port
- **FRONTEND_APP_PORT**: Frontend port
2023-05-14 22:18:55 +03:00
- **NODE_ENV**: Node environment (development / production)
2023-02-21 15:41:25 +02:00
###### Database
2023-02-21 15:51:07 +02:00
2022-11-04 17:03:03 +02:00
- **DATABASE_URL**: Database connection string
2023-02-21 15:41:25 +02:00
###### Rate Limit
2023-02-21 15:51:07 +02:00
2023-10-14 01:17:18 -07:00
- **RATE_LIMIT_TTL**: Rate limit TTL (time to live)
2023-02-21 15:51:07 +02:00
- **RATE_LIMIT_COUNT**: Number of requests within the ttl
2023-02-21 15:41:25 +02:00
2024-06-08 16:34:23 +03:00
###### 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
2023-02-21 15:41:25 +02:00
###### Logger
2023-02-21 15:51:07 +02:00
2023-02-21 15:41:25 +02:00
- **LOGGER_CONSOLE_THRESHOLD**: Threshold level of the console transporter.
###### Frontend
2023-02-21 15:51:07 +02:00
2023-09-15 17:35:05 +03:00
- **DOMAIN**: Domain of your frontend app
2024-06-08 16:34:23 +03:00
- **PUBLIC_PADDLE_KEY**: Get it from your Paddle account (Not needed when running locally)
2023-09-15 17:35:05 +03:00
- **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)
2023-12-24 17:58:54 +02:00
- **STORAGE_DOMAIN**=Domain of your bucket (used for storing images)
2022-11-05 00:11:39 +02:00
2023-02-21 15:41:25 +02:00
###### Redis
2023-02-21 15:51:07 +02:00
2023-10-28 14:17:14 +05:30
- **REDIS_ENABLE**: Whether to use external Redis store or not
2023-10-27 21:19:08 +05:30
- **REDIS_HOST**: Redis instance host
2023-01-06 19:40:51 +02:00
- **REDIS_PORT**: Redis instance port
2023-01-07 13:03:23 +02:00
- **REDIS_PASSWORD**: Redis instance password
2023-01-06 19:40:51 +02:00
- **REDIS_TTL**: Redis ttl (in seconds)
2023-02-21 15:41:25 +02:00
###### Auth
2023-02-21 15:51:07 +02:00
2023-09-15 17:35:05 +03:00
- **JWT_ACCESS_SECRET**: Jwt secret (used for access tokens)
- **JWT_REFRESH_SECRET**: Jwt secret (used for refresh tokens)
2022-11-04 17:03:03 +02:00
2024-04-02 20:31:49 +03:00
###### Safe Browsing API
- **SAFE_URL_ENABLE**: Whether to use Google Safe Browsing API or not
- **SAFE_URL_GOOGLE_SAFE_BROWSING_API_KEY**: Get it from https://developers.google.com/safe-browsing/v4/get-started
2023-02-21 15:41:25 +02:00
###### Novu
2023-02-21 15:51:07 +02:00
2023-09-15 17:35:05 +03:00
- **NOVU_API_KEY**: Get it from https://novu.co/, you don't need this when running locally (just verify your email from the database)
2022-10-24 22:31:03 +03:00
2022-10-07 09:15:10 +05:30
Happy Hacking !
2022-10-07 19:56:30 +05:30
2024-06-08 16:34:23 +03:00
### 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.
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
<!-- USAGE EXAMPLES -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 🐱💻 Usage
Simply copy and paste a URL into the provided area. Then click shorten URL! Your URL has now been shortened!
2022-10-10 10:05:11 -05:00
< div align = "center" >
2022-10-19 17:17:31 +06:00
< img src = "docs/reduced-to.gif" width = "600" height = "254" >
2022-10-10 10:05:11 -05:00
< / div >
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
<!-- ROADMAP -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 🧱 Roadmap
- [x] Migrate backend to NestJS
- [x] Migrate frontend to Qwik
- [x] Better README
2022-10-10 20:36:27 +03:00
- [x] Generate QRCode
2022-10-12 21:28:03 +03:00
- [x] Split front-end into components
- [x] Better UI
2022-10-13 01:17:49 +03:00
- [x] Animations
2022-10-16 15:00:29 +03:00
- [x] Logo
2022-10-18 15:23:45 +03:00
- [x] Dark/Light mode
2022-10-12 21:28:03 +03:00
- [ ] Improve front-end components
2023-06-27 23:13:15 +03:00
- [x] Backend tests
2023-09-10 10:56:28 +03:00
- [x] Migration to Nx
2023-09-15 17:35:05 +03:00
- [ ] Split backend into libs
- [ ] Support k8s deployment (helm)
2022-10-16 15:00:29 +03:00
- [ ] Front-end Tests
2022-10-10 16:21:22 +03:00
- [ ] Logs
2022-10-09 08:27:30 +03:00
- [ ] Add a statistics page
- [ ] Add more ideas
2022-10-18 21:24:36 +03:00
Just create a [Pull request ](https://github.com/origranot/reduced.to/pulls ) already 😃
2022-10-09 08:27:30 +03:00
2022-10-18 21:24:36 +03:00
_See the [open issues ](https://github.com/origranot/reduced.to/issues ) for a full list of proposed features (and known issues)._
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
<!-- CONTRIBUTING -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 🥇 Contributing
2022-10-13 05:50:45 +05:30
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated** .
2022-10-09 08:27:30 +03:00
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".
2022-10-09 17:05:15 +03:00
Don't forget to give the project a star ⭐!
2022-10-09 08:27:30 +03:00
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
2022-10-13 01:17:49 +03:00
2022-10-18 21:24:36 +03:00
< a href = "https://github.com/origranot/reduced.to/graphs/contributors" >
< img src = "https://contrib.rocks/image?repo=origranot/reduced.to" / >
2022-10-07 19:56:30 +05:30
< / a >
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
<!-- LICENSE -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 📝 License
2023-11-01 03:22:19 +05:30
This project is licensed under the terms of the [MIT License ](LICENSE )
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
<!-- CONTACT -->
2022-10-13 01:17:49 +03:00
2022-10-09 08:27:30 +03:00
## 💌 Contact
2022-10-18 21:24:36 +03:00
Project Link: [https://github.com/origranot/reduced.to ](https://github.com/origranot/reduced.to )
2022-10-09 08:27:30 +03:00
< p align = "right" > (< a href = " #readme -top" > back to top</ a > )</ p >
2022-10-07 09:15:10 +05:30
2022-10-09 08:27:30 +03:00
<!-- MARKDOWN LINKS & IMAGES -->
2022-10-13 01:17:49 +03:00
2022-10-18 21:24:36 +03:00
[contributors-shield]: https://img.shields.io/github/contributors/origranot/reduced.to.svg?style=for-the-badge
[contributors-url]: https://github.com/origranot/reduced.to/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/origranot/reduced.to.svg?style=for-the-badge
[forks-url]: https://github.com/origranot/reduced.to/network/members
[stars-shield]: https://img.shields.io/github/stars/origranot/reduced.to.svg?style=for-the-badge
[stars-url]: https://github.com/origranot/reduced.to/stargazers
[issues-shield]: https://img.shields.io/github/issues/origranot/reduced.to.svg?style=for-the-badge
[issues-url]: https://github.com/origranot/reduced.to/issues
2022-10-09 08:27:30 +03:00
[product-screenshot]: docs/gif.gif
2023-09-10 10:56:28 +03:00
[nx]: https://img.shields.io/static/v1?style=for-the-badge& message=Nx& color=143055& logo=Nx& logoColor=FFFFFF& label=
[nx-url]: https://nx.dev/
[nestjs]: https://img.shields.io/static/v1?style=for-the-badge& message=NestJS& color=E0234E& logo=NestJS& logoColor=FFFFFF& label=
2022-10-13 01:17:49 +03:00
[nest-url]: https://nestjs.com/
[qwik.js]: https://tinyurl.com/y67dv8ub
[qwik-url]: https://qwik.builder.io/
2022-10-12 21:28:03 +03:00
[tailwindcss]: https://img.shields.io/badge/tailwindcss-06B6D4?style=for-the-badge& logo=tailwindcss& logoColor=fff
[tailwindcss-url]: https://tailwindcss.com
2022-11-04 22:11:40 +02:00
[novu]: https://img.shields.io/badge/Novu-000000?style=for-the-badge& logo=novu& color=F30F8A
[novu-url]: https://novu.co/