Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5. - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5) --- updated-dependencies: - dependency-name: undici dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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
🌐 About The Project
🔥 Built With
List of frameworks/libraries used to bootstrap the project.
🚀 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
- Fork / Clone this repository
- Install NPM packages
npm install
- Copy
.example.env
to.env
and fill it properly (see Configuration) - 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
- Run Prisma migration from root folder:
npx nx migrate-dev prisma --name=init
- Run the backend from root folder:
npx nx serve backend
- 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.
- Navigate to the
chart
directory (/docker/k8s/chart) - Update the values in the
values.yaml
file - 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
- 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
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):
- Register locally on the app.
- Go to your database and create a new row in the
Subscription
table:id
: 1userId
: (you can find your user id in theUser
table)plan
: (FREE / PRO / BUSINESS)status
: activeendDate
: Choose a date in the futurescheduledToBeCancelled
: falseendDate
: empty (NULL)nextBilledAt
: empty (NULL)createdAt
: current dateupdatedAt
: current date
- Relogin to the app (refresh the JWT token)
- You can now access the premium features.
🐱💻 Usage
Simply copy and paste a URL into the provided area. Then click shorten URL! Your URL has now been shortened!
🧱 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).
🥇 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 ⭐!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
🏆 Contributors
📝 License
This project is licensed under the terms of the MIT License
💌 Contact
Project Link: https://github.com/origranot/reduced.to