Skip to content

Commit 335c9b2

Browse files
authored
[HOTFIX][FE] Fix may duplicate logic for CRUD (#270)
2 parents d5ca222 + 5a5d342 commit 335c9b2

File tree

8 files changed

+162
-141
lines changed

8 files changed

+162
-141
lines changed

Diff for: README.md

+99-74
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## HANA PDF
1+
## HANA PDF
22

33
<br>
44
<div align="center">
55
<img src="screenshot/logo.png" alt="HANA" width="300" height="300">
66
</div>
77
<br>
88

9-
__HANA PDF__ is your go-to solution for effortlessly managing your PDFs. We've designed it with simplicity in mind, so you can combine,
9+
**HANA PDF** is your go-to solution for effortlessly managing your PDFs. We've designed it with simplicity in mind, so you can combine,
1010
shrink, convert, and personalize your PDFs with just a few clicks. It was implemented with front-end framework like Tailwind CSS and
1111
used of Flowbite library to maintain responsive and materialize interface. And powered with iLovePDF and Aspose Cloud API as one of the back-end.
1212

@@ -17,113 +17,130 @@ used of Flowbite library to maintain responsive and materialize interface. And p
1717
---
1818

1919
### Requirements [For development with local environment]
20-
- [Apache 2.4](https://httpd.apache.org) or [Nginx](https://www.nginx.com)
21-
- [Composer](http://getcomposer.org/)
22-
- [Docker](https://www.docker.com/)
23-
* On Windows use Docker Desktop
24-
* On Linux use docker-compose and docker.io
25-
- [Node JS 20.11](https://nodejs.org/en)
26-
- [PHP 8.2.12](https://www.php.net/downloads.php)
27-
- [PostgreSQL 16.2](https://www.postgresql.org/)
28-
- [Postman](https://www.postman.com/)
20+
21+
- [Apache 2.4](https://httpd.apache.org) or [Nginx](https://www.nginx.com)
22+
- [Composer](http://getcomposer.org/)
23+
- [Docker](https://www.docker.com/)
24+
- On Windows use Docker Desktop
25+
- On Linux use docker-compose and docker.io
26+
- [Node JS 20.11](https://nodejs.org/en)
27+
- [PHP 8.2.12](https://www.php.net/downloads.php)
28+
- [PostgreSQL 16.2](https://www.postgresql.org/)
29+
- [Postman](https://www.postman.com/)
2930

3031
---
3132

3233
### Python Module Requirements
33-
- Requests
34+
35+
- Requests
3436

3537
---
3638

3739
### Build Status
38-
- [![CodeQL](https://github.com/Nicklas373/Hana-PDF/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/Nicklas373/Hana-PDF/actions/workflows/github-code-scanning/codeql)
39-
- [![HANA PDF Container [SIT]](https://github.com/Nicklas373/Hana-PDF/actions/workflows/docker-sit.yml/badge.svg)](https://github.com/Nicklas373/Hana-PDF/actions/workflows/docker-sit.yml)
40-
- [![HANA Container Production](https://github.com/Nicklas373/hana-ci-docker-prod/actions/workflows/docker-prod-env.yml/badge.svg)](https://github.com/Nicklas373/hana-ci-docker-prod/actions/workflows/docker-prod-env.yml)
40+
41+
- [![CodeQL](https://github.com/Nicklas373/Hana-PDF/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/Nicklas373/Hana-PDF/actions/workflows/github-code-scanning/codeql)
42+
- [![HANA PDF Container [SIT]](https://github.com/Nicklas373/Hana-PDF/actions/workflows/docker-sit.yml/badge.svg)](https://github.com/Nicklas373/Hana-PDF/actions/workflows/docker-sit.yml)
43+
- [![HANA Container Production](https://github.com/Nicklas373/hana-ci-docker-prod/actions/workflows/docker-prod-env.yml/badge.svg)](https://github.com/Nicklas373/hana-ci-docker-prod/actions/workflows/docker-prod-env.yml)
4144

4245
---
4346

4447
### Commit History
45-
- [Old branch - master](https://github.com/Nicklas373/Hana-PDF/tree/master)
46-
- [Frontend Services - fe/master](https://github.com/Nicklas373/Hana-PDF/tree/fe/master)
47-
- [Backend Services - be/master](https://github.com/Nicklas373/Hana-PDF/tree/be/master)
48-
- [(DEV) Frontend Services - dev/fe/master](https://github.com/Nicklas373/Hana-PDF/tree/dev/fe/master)
49-
- [(DEV) Backend Services - dev/be/master](https://github.com/Nicklas373/Hana-PDF/tree/dev/be/master)
48+
49+
- [Old branch - master](https://github.com/Nicklas373/Hana-PDF/tree/master)
50+
- [Frontend Services - fe/master](https://github.com/Nicklas373/Hana-PDF/tree/fe/master)
51+
- [Backend Services - be/master](https://github.com/Nicklas373/Hana-PDF/tree/be/master)
52+
- [(DEV) Frontend Services - dev/fe/master](https://github.com/Nicklas373/Hana-PDF/tree/dev/fe/master)
53+
- [(DEV) Backend Services - dev/be/master](https://github.com/Nicklas373/Hana-PDF/tree/dev/be/master)
5054

5155
---
5256

5357
### Deployment On Docker
58+
5459
#### Step to configure
60+
5561
1. Go to root directory from this project
5662
2. Start to deploy
57-
````bash
63+
```bash
5864
- docker compose up -d
5965
- docker compose exec hana-api-services php artisan migrate
6066
- docker compose exec hana-api-services php artisan db:seed
61-
````
67+
- docker compose exec hana-api-services chmod o+w /var/www/html/hanaci-api/storage/ -R
68+
- docker compose exec hana-api-services chmod o+w /var/www/html/hanaci-api/vendor/mpdf/mpdf/tmp/ -R
69+
```
6270
3. Configure Server Host
63-
````bash
64-
- docker compose exec hana-api-services echo "TELEGRAM_BOT_ID=YOUR_TELEGRAM_BOT_ID" >> .env
65-
- docker compose exec hana-api-services echo "TELEGRAM_REPORT_ID=YOUR_TELEGRAM_CHANNEL_ID" >> .env
66-
- docker compose exec hana-api-services echo "TELEGRAM_CHAT_ID=YOUR_TELEGRAM_CHANNEL_ID" >> .env
67-
- docker compose exec hana-api-services echo "HANA_UNIQUE_TOKEN=YOUR_SHA512_UNIQUE_TOKEN" >> .env
68-
- docker compose exec hana-api-services sed -i "s/ASPOSE_CLOUD_CLIENT_ID=xxxx/ASPOSE_CLOUD_CLIENT_ID=YOUR_ASPOSE_CLOUD_CLIENT_ID/" >> .env
69-
- docker compose exec hana-api-services sed -i "s/ASPOSE_CLOUD_TOKEN=xxxx/ASPOSE_CLOUD_TOKEN=YOUR_ASPOSE_CLOUD_TOKEN" >> .env
70-
- docker compose exec hana-api-services sed -i "s/FTP_USERNAME=xxxx/FTP_USERNAME=YOUR_FTP_USERNAME/" >> .env
71-
- docker compose exec hana-api-services sed -i "s/FTP_USERPASS=xxxx/FTP_USERNAME=YOUR_FTP_USERPASS/" >> .env
72-
- docker compose exec hana-api-services sed -i "s/FTP_ROOT=xxxx/FTP_USERNAME=YOUR_FTP_ROOT_DIR/" >> .env
73-
- docker compose exec hana-api-services sed -i "s/ILOVEPDF_PUBLIC_KEY=xxxx/FTP_USERNAME=YOUR_ILOVEPDF_PUBLIC_KEY/" >> .env
74-
- docker compose exec hana-api-services sed -i "s/ILOVEPDF_SECRET_KEY=xxxx/FTP_USERNAME=YOUR_ILOVEPDF_SECRET_KEY/" >> .env
75-
````
71+
```bash
72+
- docker compose exec hana-api-services echo "TELEGRAM_BOT_ID=YOUR_TELEGRAM_BOT_ID" >> .env
73+
- docker compose exec hana-api-services echo "TELEGRAM_REPORT_ID=YOUR_TELEGRAM_CHANNEL_ID" >> .env
74+
- docker compose exec hana-api-services echo "TELEGRAM_CHAT_ID=YOUR_TELEGRAM_CHANNEL_ID" >> .env
75+
- docker compose exec hana-api-services echo "HANA_UNIQUE_TOKEN=YOUR_SHA512_UNIQUE_TOKEN" >> .env
76+
- docker compose exec hana-api-services sed -i "s/ASPOSE_CLOUD_CLIENT_ID=xxxx/ASPOSE_CLOUD_CLIENT_ID=YOUR_ASPOSE_CLOUD_CLIENT_ID/" >> .env
77+
- docker compose exec hana-api-services sed -i "s/ASPOSE_CLOUD_TOKEN=xxxx/ASPOSE_CLOUD_TOKEN=YOUR_ASPOSE_CLOUD_TOKEN" >> .env
78+
- docker compose exec hana-api-services sed -i "s/FTP_USERNAME=xxxx/FTP_USERNAME=YOUR_FTP_USERNAME/" >> .env
79+
- docker compose exec hana-api-services sed -i "s/FTP_USERPASS=xxxx/FTP_USERNAME=YOUR_FTP_USERPASS/" >> .env
80+
- docker compose exec hana-api-services sed -i "s/FTP_ROOT=xxxx/FTP_USERNAME=YOUR_FTP_ROOT_DIR/" >> .env
81+
- docker compose exec hana-api-services sed -i "s/ILOVEPDF_PUBLIC_KEY=xxxx/FTP_USERNAME=YOUR_ILOVEPDF_PUBLIC_KEY/" >> .env
82+
- docker compose exec hana-api-services sed -i "s/ILOVEPDF_SECRET_KEY=xxxx/FTP_USERNAME=YOUR_ILOVEPDF_SECRET_KEY/" >> .env
83+
```
7684
4. Configure Client Host
77-
````bash
78-
- docker compose exec hana-app-pdf sed -i "s/VITE_ADOBE_CLIENT_ID=xxxx/VITE_ADOBE_CLIENT_ID=YOUR_ADOBE_CLIENT_ID/" >> .env
79-
- docker compose exec hana-app-pdf echo "TELEGRAM_BOT_ID=YOUR_TELEGRAM_BOT_ID" >> .env
80-
- docker compose exec hana-app-pdf echo "TELEGRAM_CHAT_ID=YOUR_TELEGRAM_CHANNEL_ID" >> .env
81-
````
85+
```bash
86+
- docker compose exec hana-app-pdf sed -i "s/VITE_ADOBE_CLIENT_ID=xxxx/VITE_ADOBE_CLIENT_ID=YOUR_ADOBE_CLIENT_ID/" >> .env
87+
- docker compose exec hana-app-pdf echo "TELEGRAM_BOT_ID=YOUR_TELEGRAM_BOT_ID" >> .env
88+
- docker compose exec hana-app-pdf echo "TELEGRAM_CHAT_ID=YOUR_TELEGRAM_CHANNEL_ID" >> .env
89+
- docker compose exec hana-app-pdf chmod o+w /var/www/html/hanaci-pdf/storage/ -R
90+
```
8291
5. Configure REST API
8392
- Install Postman
8493
- Create a new HTTP request with POST format
85-
- URL: http://YOUR_LOCAL_IP:YOUR_LOCAL_PORT/api/v1/auth/token
94+
- URL: http://YOUR_LOCAL_IP:YOUR_LOCAL_PORT/api/v1/auth/getToken
8695
- Body: form-data
8796
8897
- password: YOUR_SHA512_UNIQUE_TOKEN
8998
- Send a POST request to get access token
9099
- Set token to FE services
91-
````bash
92-
- docker compose exec hana-app-pdf sed -i 's|Bearer STATIC_BEARER|Bearer YOUR_CURRENT_BEARER|' public/build/assets/kao-logic-CHECK_LATEST_REVISION.js
93-
- docker compose exec hana-app-pdf sed -i 's|STATIC_BEARER|YOUR_CURRENT_BEARER|' public/build/assets/kao-logic-CHECK_LATEST_REVISION.js
100+
```bash
101+
- docker compose exec hana-app-pdf sed -i 's|STATIC_BEARER|Bearer YOUR_CURRENT_BEARER|' public/build/assets/kao-logic-CHECK_LATEST_REVISION.js
94102
- docker compose exec hana-app-pdf sed -i 's|http://192.168.0.2|YOUR_BACKEND_URL:PORT|' public/build/assets/kao-logic-CHECK_LATEST_REVISION.js
95103
- docker compose exec hana-app-pdf sed -i 's|STATIC_CLIENT_ID|YOUR_ADOBE_CLIENT_ID|' public/build/assets/kao-logic-CHECK_LATEST_REVISION.js
96-
````
104+
```
97105
6. Refresh page and done.
98106

99107
---
100108

101109
### Deployment On Native OS Host
110+
102111
#### Step to configure
103-
1. Clone the repository with branch __fe/master__ [Frontend Services]
104-
105-
A. Copy __.env.example__ file to __.env__ and modify database credentials
106-
````bash
112+
113+
1. Clone the repository with branch **fe/master** [Frontend Services]
114+
115+
A. Copy **.env.example** file to **.env** and modify database credentials
116+
117+
```bash
107118
- VITE_ADOBE_CLIENT_ID="ADOBE_CLIENT_ID" [https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/]
108-
- VITE_JWT_TOKEN="YOUR_CURRENT_BEARER_TOKEN" [Get it from Backend with route api/v1/auth/token]
119+
- VITE_JWT_TOKEN="YOUR_CURRENT_BEARER_TOKEN" [Get it from Backend with route api/v1/auth/getToken]
109120
- TELEGRAM_BOT_ID="YOUR_TELEGRAM_BOT_ID" [https://telegram-bot-sdk.com/docs/getting-started/installation]
110121
- TELEGRAM_CHAT_ID="YOUR_TELEGRAM_CHANNEL_ID" [https://telegram-bot-sdk.com/docs/getting-started/installation]
111-
````
122+
```
123+
112124
B. Run the following command [Make sure to configure database connectivity before use migrate function]
113-
````bash
125+
126+
```bash
114127
- composer install
115128
- npm run install
116129
- php artisan key:generate
117130
- php artisan storage:link
118-
````
131+
```
132+
119133
C. Start to deploy
134+
120135
```bash
121136
- php artisan serve --host=localhost --port=81
122137
```
123-
2. Clone the repository with branch __dev/be/master [Backend Services]
124138

125-
A. Copy __.env.example__ file to __.env__ and modify database credentials
126-
````bash
139+
2. Clone the repository with branch \_\_dev/be/master [Backend Services]
140+
141+
A. Copy **.env.example** file to **.env** and modify database credentials
142+
143+
```bash
127144
- ASPOSE_CLOUD_CLIENT_ID="ASPOSE_CLOUD_CLIENT_ID" [https://dashboard.aspose.cloud/]
128145
- ASPOSE_CLOUD_TOKEN="ASPOSE_CLOUD_TOKEN" [https://dashboard.aspose.cloud/]
129146
- FTP_USERNAME="FTP_USERNAME" [https://dashboard.aspose.cloud/]
@@ -140,43 +157,51 @@ used of Flowbite library to maintain responsive and materialize interface. And p
140157
- TELEGRAM_BOT_ID="YOUR_TELEGRAM_BOT_ID" [https://telegram-bot-sdk.com/docs/getting-started/installation]
141158
- TELEGRAM_CHAT_ID="YOUR_TELEGRAM_CHANNEL_ID" [https://telegram-bot-sdk.com/docs/getting-started/installation]
142159
- HANA_UNIQUE_TOKEN="YOUR_SHA512_UNIQUE_TOKEN"
143-
````
160+
```
161+
144162
B. Run the following command [Make sure to configure database connectivity before use migrate function]
145-
````bash
163+
164+
```bash
146165
- composer install
147166
- php artisan key:generate
148167
- php artisan jwt:secret
149168
- php artisan storage:link
150-
````
169+
```
151170

152171
C. Create new directory inside storage/app/public
153-
* image
154-
* batch
155-
* upload
156-
* download
157-
* pool
172+
173+
- image
174+
- batch
175+
- upload
176+
- download
177+
- pool
158178

159179
D. Start to deploy
160-
````bash
180+
181+
```bash
161182
- npm run dev -- --host
162183
- php artisan serve --host=localhost --port=80
163-
````
184+
```
185+
164186
E. Configure apiUrl variable on resources/js/kao-logic.js to your considered BE address and port !
187+
165188
---
166189

167190
### Technology Stack
168-
- [Docker](https://www.docker.com/)
169-
- [DropzoneJS](https://www.dropzone.dev/)
170-
- [Flowbite](https://flowbite.com/)
171-
- [Laravel](https://laravel.com/)
172-
- [Node JS](https://nodejs.org/en)
173-
- [Mozilla PDFJS](https://mozilla.github.io/pdf.js/)
174-
- [Tailwind CSS](https://tailwindcss.com/)
175-
- [Vite JS](https://vitejs.dev/)
191+
192+
- [Docker](https://www.docker.com/)
193+
- [DropzoneJS](https://www.dropzone.dev/)
194+
- [Flowbite](https://flowbite.com/)
195+
- [Laravel](https://laravel.com/)
196+
- [Node JS](https://nodejs.org/en)
197+
- [Mozilla PDFJS](https://mozilla.github.io/pdf.js/)
198+
- [Tailwind CSS](https://tailwindcss.com/)
199+
- [Vite JS](https://vitejs.dev/)
176200

177201
---
178202

179203
### License
204+
180205
The HANA PDF is a open source Laravel Project that has licensed under the [MIT license](https://opensource.org/licenses/MIT).
181206

182207
---

0 commit comments

Comments
 (0)