AI-News
所属分类:Docker
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2023-07-31 02:39:50
上 传 者:
sh-1993
说明: 人工智能书面新闻文章。。。可能会出什么问题!
(AI written news articles... what could possibly go wrong!)
文件列表:
.npmignore (79, 2023-11-30)
Makefile (401, 2023-11-30)
api/ (0, 2023-11-30)
api/.dockerignore (64, 2023-11-30)
api/.eslintrc.json (237, 2023-11-30)
api/.prettierrc (193, 2023-11-30)
api/Dockerfile (183, 2023-11-30)
api/app.ts (1110, 2023-11-30)
api/constant/ (0, 2023-11-30)
api/constant/code.ts (703, 2023-11-30)
api/database/ (0, 2023-11-30)
api/database/index.ts (2330, 2023-11-30)
api/environment/ (0, 2023-11-30)
api/environment/index.ts (983, 2023-11-30)
api/gentokens.sh (1492, 2023-11-30)
api/middleware/ (0, 2023-11-30)
api/middleware/protectedRoutes.ts (2185, 2023-11-30)
api/package-lock.json (178816, 2023-11-30)
api/package.json (1231, 2023-11-30)
api/route/ (0, 2023-11-30)
api/route/Article/ (0, 2023-11-30)
api/route/Article/article.clicks.ts (582, 2023-11-30)
api/route/Article/article.create.ts (838, 2023-11-30)
api/route/Article/article.create_raw.ts (2083, 2023-11-30)
api/route/Article/article.get.ts (1080, 2023-11-30)
api/route/Article/article.getAll.ts (758, 2023-11-30)
api/route/Article/article.getAllImageGen.ts (806, 2023-11-30)
api/route/Article/article.list.ts (2193, 2023-11-30)
api/route/Article/article.recordImageGen.ts (745, 2023-11-30)
api/route/Article/article.record_clicks.ts (861, 2023-11-30)
api/route/Article/article.search.domain.ts (710, 2023-11-30)
api/route/Article/article.search.ts (1455, 2023-11-30)
api/route/Article/article.summary.ts (1749, 2023-11-30)
api/route/Article/articleRouter.ts (1621, 2023-11-30)
api/route/Article/index.ts (43, 2023-11-30)
api/route/Category/ (0, 2023-11-30)
... ...
# AI Driven News Outlet
[`Client `](https://github.com/client/README.md)
[`API `](https://github.com/server/README.md)
[`Scrapper `](https://github.com/scraper/README.md)
[`Search `](https://github.com/search/README.md)
[`Database `](https://github.com/database/README.md)
> 2023 BIT Studio 5/6 Project by **Artem Kechemaev**, **Greg Seal**, **Georgette Watkins**, and **Aardhyn Lavender**
## Live Prototype
Our prototype site is now live.
[`Launch `](https://github.comhttps://ai-daily-news.op-bit.nz/)
## Installation and Configuration
```shell
git clone https://github.com/RozadoStudioProjectsOP/ai_driven_news_outlet/
cd ai_driven_news_outlet
```
### Environment
#### Containerized Development
For Windows OS users, make sure the line endings for any scripts are configured as `LF`. Unix based machines ( i.e. the Docker containers ) cant find files with the Windows `CRLF`. Your IDE may have a setting to do this, I'ts found in the bottom status bar in Visual Studio Code.
Configure the sections from `template.virtual.env` in `virtual.env` for running the modules though docker containers.
The only difference is the `_HOST` variables. As each module is running on its own container, **localhost** does not work. instead, their configured to the name of the container their trying to connect to (except the `client` connecting to the `api`, something weird going on there...).
This works because `docker-compose` creates a network with domain names for each container based on the name of the service in the `docker-compose.yml` file.
Copy and configure the `template.virtual.env` file
```shell
# in project root
cp template.virtual.env virtual.env # git ignore `virtual.env`
vim virtual.env # set undefined variables
```
#### Local
Configure the sections from `template.local.env` in `local.env` for running the modules on your local machine.
```shell
# in project root
cp template.local.env local.env # git ignore `local.env`
vim local.env # set undefined variables
```
Use whatever credentials you like for the `POSTGRES_USER` and `POSTGRES_PASSWORD` variables. You'll use these if you connect manually to the Database with `/database/scripts/attach.sh`.
The `/database/scripts/backup` script will ensure the the `BACKUP_DIR` directory exists before writing to it. You can set this to any directory you like.
## Execution
### Containerized
If you use `GNU Make`, you can use
```shell
make
# shorthand for
make start
```
Or, use the scripts in `/scripts` (see `/scripts/README.md` for more information)
```shell
./script/start.sh
```
This builds the modules, runs each service in respective containers. The `scraper` module starts scraping, the `paraphraser` starts paraphrasing.
You might need to wait a bit before paraphrased articles start appearing in the client application.
Use `make clean` (`./script/clean.sh`) to delete everything. use `ctrl+c` (`SIGTERM`) to stop the containers forcefully.
> This deletes all containers, volumes, and images created by the `make start` task
use `make restart` (`./script/clean.sh && ./script/start.sh`) to clean then start. This does not rebuild unchanged image layers.
### Local
You can run each service on your host machine too.
Checkout the installation and configuration instructions in each module to get started.
## Service Communication
```mermaid
flowchart TD
B[API] --> A[Database]
C[Search Engine] --> B
B --> C
D[Client Application] --> B
B --> D
E[Web Scraper] --> B
F[User] --> D
```
近期下载者:
相关文件:
收藏者: