2 changed files with 102 additions and 79 deletions
-
124README.md
-
57frontend/README.md
@ -1,16 +1,55 @@ |
|||
# React + Vite |
|||
# 💻 Divar Crawler Dashboard (React + Vite) |
|||
|
|||
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules. |
|||
The frontend client for the **Intelligent Divar Ads Crawler**, built with React 18, Vite, Lucide React icons, and TailwindCSS. |
|||
|
|||
Currently, two official plugins are available: |
|||
--- |
|||
|
|||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) |
|||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) |
|||
## 🎨 Features & Capabilities |
|||
|
|||
## React Compiler |
|||
- **Crawler Management**: Dynamic form modal for creating and updating Divar crawl tasks (title, Divar search URL, AI prompt, interval, allowed hours window, Telegram channel, active status). |
|||
- **Manual Trigger**: Immediate execution button to test scraper and AI evaluation flows on-demand. |
|||
- **Ads Feed**: Filterable view of scraped ads displaying price, location, AI evaluation decision (`is_flagged`), confidence score, and extracted reasoning. |
|||
- **Execution History Logs**: Detailed execution run logs with status indicators (`RUNNING`, `SUCCESS`, `FAILED`) and error log modals. |
|||
- **System Health Indicator**: Real-time polling monitoring status of PostgreSQL database and Redis background broker. |
|||
|
|||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). |
|||
--- |
|||
|
|||
## Expanding the Oxlint configuration |
|||
## 🛠 Project Structure |
|||
|
|||
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and Oxlint's TypeScript related rules in your project. |
|||
```text |
|||
frontend/ |
|||
├── src/ |
|||
│ ├── App.jsx # Main dashboard component handling tabs, modals, and API integration |
|||
│ ├── App.css # Custom styles and glassmorphism styling |
|||
│ ├── index.css # Tailwind & global font declarations |
|||
│ └── main.jsx # React application entry point |
|||
├── Dockerfile # Node 22 slim docker environment configuration |
|||
├── package.json # Project dependencies & scripts |
|||
└── vite.config.js # API proxy configuration (`/api` -> backend:8000 or 127.0.0.1:8000) |
|||
``` |
|||
|
|||
--- |
|||
|
|||
## 🚀 Running Locally |
|||
|
|||
### Development Mode (Local Node) |
|||
```bash |
|||
npm install |
|||
npm run dev |
|||
``` |
|||
The application will run at `http://localhost:5173/` and proxy API calls to `http://127.0.0.1:8000`. |
|||
|
|||
### Production Build |
|||
```bash |
|||
npm run build |
|||
``` |
|||
|
|||
--- |
|||
|
|||
## 🐳 Docker Execution |
|||
|
|||
The frontend is included as part of the multi-container stack in the root `docker-compose.yml`: |
|||
```bash |
|||
docker compose up frontend -d |
|||
``` |
|||
Environment variable `VITE_BACKEND_URL=http://backend:8000` is automatically configured to route API traffic within the Docker network. |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue