Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dekiakbar/image-optimizer
Imageoptimizer image is a simple app for compressing any image file. It takes a single input file and compresses it to a much smaller output file.
https://github.com/dekiakbar/image-optimizer
api api-rest image-processing nestjs nestjs-api nestjs-backend nodejs optimize-images
Last synced: 3 months ago
JSON representation
Imageoptimizer image is a simple app for compressing any image file. It takes a single input file and compresses it to a much smaller output file.
- Host: GitHub
- URL: https://github.com/dekiakbar/image-optimizer
- Owner: dekiakbar
- License: mit
- Created: 2021-07-25T11:01:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-20T23:41:38.000Z (4 months ago)
- Last Synced: 2024-10-08T01:24:27.463Z (4 months ago)
- Topics: api, api-rest, image-processing, nestjs, nestjs-api, nestjs-backend, nodejs, optimize-images
- Language: TypeScript
- Homepage: https://api-imageoptimizer.nooby.dev/api
- Size: 2.39 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image Optimizer Backend
---
## Table of Contents
- [Installation](#installation)
- [Without docker](#without-docker)
- [Docker](#docker)
- [Deployment](#deployment)
- [Environment Variable](#environment-variable)
- [Frontend](#frontend)
- [License](#license)## Installation
### Backend (this repo)
- #### Without docker- ```bash
# Clone this repository
git clone https://github.com/dekiakbar/image-optimizer
```- ```bash
# Navigate to project dir
cd image-optimizer
```- ```bash
# Install node modules and dependencies
npm install
```
- ```bash
# Run app# development
$ npm run start# Watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```- ```bash
# access swager api
http://localhost:/api
```
- #### Docker
- ```bash
# Clone this repository
git clone https://github.com/dekiakbar/image-optimizer
```- ```bash
# Navigate to project dir
cd image-optimizer
```
- ```bash
# Build image and start container
docker-compose up -d
```- ```bash
# access swagger api
http://localhost:3000/api
```
- #### NOTE : if you wanna run npm command, please use this.
```bash
docker-compose run --rm node npm install --legacy-peer-deps
```
## Deployment
- #### Docker
- ```bash
# Clone this repository
git clone https://github.com/dekiakbar/image-optimizer
```- ```bash
# Navigate to project dir
cd image-optimizer
```
- ```bash
# Build image and start container
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```
## Environment VariableCopy `env.example` to `.env`
```bash
cp .env.example .env
```Fill the required `env` variables:
```bash
PORT=3000# Storage type for save image
# valid :
# - S3
STORAGE_TYPE=S3# if use S3 as storage
S3_BUCKET_NAME=
S3_REGION=global
S3_ENDPOINT=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=# separated by space and please provide (dot) before list the extension
ALLOWED_FILE_TYPE=.jpeg .jpg .png
MAX_FILE_UPLOAD=5
# max upload size in KB
MAX_UPLOAD_SIZE=8192
```## Frontend
You must install [image optimizer Frontend](https://github.com/dekiakbar/image-optimizer-fe).## License
[MIT](https://github.com/dekiakbar/image-optimizer/blob/master/LICENSE)