diff --git a/.dockerignore b/.dockerignore index 59d7c58..67bf222 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,10 +12,10 @@ client/dist \*/.env.example -app/.gitignore -app/Dockerfile -app/fly.toml -app/.dockerignore +api/.gitignore +api/Dockerfile +api/fly.toml +api/.dockerignore # Exclude version control system files @@ -30,5 +30,5 @@ docs # Exclude any other files or directories specific to your project .github - +.circleci nginx diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 68f2813..29a31bc 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,3 @@ -github: thuongtruong1009 -ko_fi: thuongtruong1009 +github: thuongtruong109 custom: ["https://paypal.me/thuongtruong1009", "https://nhantien.momo.vn/0917085937"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bc0911..b3f1d46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: | - ${{ secrets.DOCKERHUB_USERNAME }}/short1url-api + ${{ secrets.DOCKERHUB_USERNAME }}/onelink-api ghcr.io/${{ github.repository }} - name: Build and push api image @@ -55,7 +55,7 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: | - ${{ secrets.DOCKERHUB_USERNAME }}/short1url-client + ${{ secrets.DOCKERHUB_USERNAME }}/onelink-client ghcr.io/${{ github.repository }} - name: Build and push client image diff --git a/README.md b/README.md index f9648e6..8e651da 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@
## Description -This is a simple URL shortener service. It is written in Golang and uses Redis as database. Other hand, it also provides some services such as QR code generator, barcode generator, etc. +This is a simple URL shortener service, which helps you shorten your long URL to share repidly to external. It is written in Golang and uses Redis as database. Other hand, it also provides some services such as QR code generator, barcode generator, etc. ## Preview @@ -24,66 +24,21 @@ This is a simple URL shortener service. It is written in Golang and uses Redis a - [x] Shorten URL - [x] Redirect to original URL -- [x] Expiration time +- [x] Expiration time (default 1 day) +- [x] QR code generator (custom color, download image, copy to clipboard) +- [x] Barcode generator - [x] Statistics - [x] Rate limit -- [x] QR code generator (custom color, download image) -- [x] Barcode generator -- [x] Microservices Dockerize -- [x] Auto build and deploy image - [x] Reverse proxy +- [x] Multi Dockerize layers +- [x] CI/CD build and deploy image +- [ ] Custom expiration time - [ ] Unit test - [ ] Caching ## Architecture -![](public/architecture.png) - -## Getting started - -1. Clone this repo - -```bash -git clone https://github.com/thuongtruong1009/short1url.git -``` - -2. Fill in environment variables - -```bash -# client -cd api && cp .env.example .env - -# server -cd client && cp .env.example .env -``` - -3. Run Docker container - -```bash -docker-compose up -d -``` - -4. Testing API - -```bash -# with browser -Open http://localhost:81/s -``` - -```bash -# with Postman or browser -POST http://localhost:81/s -body: { - "url": "