|
1 | 1 | <h1 align="center">
|
2 | 2 | React-ChatGPT
|
3 | 3 | </h1>
|
| 4 | + |
4 | 5 | <p align="center">
|
5 | 6 | <strong>Simple Full-Stack Summarizer based on ChatGPT</strong>
|
6 | 7 | </p>
|
7 | 8 |
|
| 9 | +[](https://github.com/frankling2020/react-chatgpt/actions/workflows/github-code-scanning/codeql) |
| 10 | + |
8 | 11 | ## Simple Summarizer
|
9 | 12 | ### Description
|
10 | 13 | <p>
|
11 | 14 | It contains a React-based summarizer built with ChatGPT whose primary purpose of the application is to generate a summary of paragraphs with highlighting of the relevant keywords. It aims to facilitate the comprehension of the original text and to enhance user trust in the generated summary.
|
12 | 15 | </p>
|
13 | 16 | <p>
|
14 |
| - <b>Tools</b>: <em>Docker, OpenAI, ReactJS, Flask (gunicorn + gevent), Celery (Redis)</em> |
| 17 | + <b>Tools</b>: <em>Docker, OpenAI, ReactJS, Flask (gunicorn + gevent), Celery (Redis), Nginx</em> |
15 | 18 | </p>
|
16 | 19 |
|
17 | 20 | ---
|
|
24 | 27 | - **Gevent**: it will allow web application to scale to potentially thousands of concurrent requests on a single process. It mainly replaces blocking parts with compatible cooperative counterparts from gevent package by "monkey patching". It uses epoll or kqueue or libevent for highly scalable non-blocking I/O.
|
25 | 28 | - **Celery**: Celery is a powerful and robust distributed task queue system that enables asynchronous task execution, scheduling, and distributed work processing. Celery supports distributing tasks across multiple workers, allowing applications to scale horizontally by adding more Celery workers as needed.
|
26 | 29 | - **Redis**: Redis provides a fast, lightweight, and efficient message queue system, making it suitable for handling large volumes of tasks and ensuring reliable task delivery.
|
27 |
| -- **Nginx (TO-DO)**: NGINX is well known as a high‑performance load balancer, cache, and web server. |
| 30 | +- **Nginx**: NGINX is well known as a high‑performance load balancer, cache, and web server. It is often preferred over Linux Virtual Server (LVS) for load balancing and reverse proxying. It is a full-featured web server and reverse proxy, providing a complete solution with built-in load balancing, caching, access control, and other features. LVS, on the other hand, is primarily focused on load balancing and requires additional components for other functionalities. |
28 | 31 |
|
29 | 32 | ---
|
30 | 33 |
|
@@ -79,13 +82,22 @@ You can start the broker to make the web appliaction more scalable with the comm
|
79 | 82 | The detailed configuration is under `backend/celeryconfig.py`
|
80 | 83 |
|
81 | 84 |
|
82 |
| -#### Development with Dokcer |
| 85 | +#### Load Balance: Nginx (to-do) |
| 86 | +Please see the configuration in `nginx.conf`. Run with |
| 87 | +- `nginx -g daemon off` |
| 88 | + |
| 89 | + |
| 90 | +#### Development with Docker |
83 | 91 | Docker is a good tool to deploy applications in different platforms. Here you can see we have `Dockerfile` in both `frontend/` and `backend/` folders and `docker-compose.yaml` in the directory. So, you can directly use the command `docker-compose -d up` with `docker` installed in your computer. I would recommend you to use Docker Desktop which can inspect the containers with GUI shown below.
|
84 | 92 |
|
| 93 | + |
85 | 94 | <div align="center">
|
86 | 95 | <img src="examples/docker-impl.png" style="width:70%">
|
| 96 | + <img src="examples/nginx.png" style="width:70%"> |
87 | 97 | </div>
|
88 | 98 |
|
| 99 | +We can choose either Node or Nginx as the web server. The top figure is with Node, while the bottom figure is with Nginx. It is worth noticing that with Nginx, the frontend server with Node only need to complete the compilation. |
| 100 | + |
89 | 101 | The following figure shows the success deployment and some console log for your debegging in the web inspection mode.
|
90 | 102 | <div align="center">
|
91 | 103 | <img src="examples/inspection.png" style="width:90%">
|
@@ -118,6 +130,7 @@ The following figure shows the success deployment and some console log for your
|
118 | 130 | - [MDN react](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/React_components#defining_our_first_component)
|
119 | 131 | - [Gunicorn with Flask](https://flask.palletsprojects.com/en/2.3.x/deploying/gunicorn/)
|
120 | 132 | - [Flask with Celery](https://flask.palletsprojects.com/en/2.3.x/patterns/celery/)
|
| 133 | +- [Nginx: Beginner's Guide](https://nginx.org/en/docs/beginners_guide.html) |
121 | 134 |
|
122 | 135 |
|
123 | 136 | ## Getting Started with Create React App (Default React Documentation)
|
|
0 commit comments