Pārlūkot izejas kodu

docs: update architecture and readme for v1.5 stable

unknown 2 mēneši atpakaļ
vecāks
revīzija
2c318ee5bd
3 mainītis faili ar 78 papildinājumiem un 1 dzēšanām
  1. 66 0
      README.md
  2. 4 1
      docs/README.md
  3. 8 0
      docs/architecture.md

+ 66 - 0
README.md

@@ -0,0 +1,66 @@
+# Radionica3D — Modern 3D Printing Service
+
+[![Vue 3](https://img.shields.io/badge/Frontend-Vue%203-42b883?style=flat-square&logo=vue.js)](https://vuejs.org/)
+[![FastAPI](https://img.shields.io/badge/Backend-FastAPI-009688?style=flat-square&logo=fastapi)](https://fastapi.tiangolo.com/)
+[![SQLite](https://img.shields.io/badge/Database-SQLite-003b57?style=flat-square&logo=sqlite)](https://www.sqlite.org/)
+[![TailwindCSS](https://img.shields.io/badge/Styling-Tailwind-38bdf8?style=flat-square&logo=tailwind-css)](https://tailwindcss.com/)
+
+**Radionica3D** is a full-featured web platform for a 3D printing service, designed to bridge the gap between clients and creators. It handles everything from model analysis and automated pricing to real-time communication and fiscal reporting.
+
+> "Мы печатаем — и делаем как надо." (We print — and we do it right.)
+
+## 🚀 Key Features
+
+- **Instant Quote**: Upload STL/3D models and get instant price estimates based on volume and material.
+- **True Chat**: Real-time bidirectional communication via WebSockets for seamless order adjustments.
+- **Advanced User Panel**: Track all your orders, download invoices, and manage your 3D printing projects in one place.
+- **Admin Dashboard**: Comprehensive order management, customer support, portfolio management, and warehouse tracking.
+- **Fiscal Compliance**: Integrated electronic fiscalization for Montenegrin tax regulations (EFI).
+- **Nuances & Guidelines**: Automated education for users about 3D printing technicalities (anisotropy, layers, etc.).
+
+## 🏗 Architecture
+
+The project follows a modern decoupled architecture:
+- **Frontend**: Vue 3 (Vite), Pinia, TailwindCSS, Lucide Icons.
+- **Backend**: FastAPI (Python 3.10+), SQLAlchemy, Redis (for pings/presence), JWT Authentication.
+- **Database**: SQLite (Development) / PostgreSQL (Optional Production).
+
+For more details, see [Architecture Overview](docs/architecture.md).
+
+## 🛠 Getting Started
+
+### Prerequisites
+- Node.js 18+
+- Python 3.10+
+- Git
+
+### Installation
+1. Clone the repository:
+   ```bash
+   git clone https://git.loky.pw/git/radionica3d.git
+   ```
+2. Set up the frontend:
+   ```bash
+   npm install
+   npm run dev
+   ```
+3. Set up the backend:
+   ```bash
+   cd backend
+   python -m venv .venv
+   source .venv/bin/activate  # or .venv\Scripts\activate on Windows
+   pip install -r requirements.txt
+   python main.py
+   ```
+
+## 📖 Documentation
+
+Detailed documentation is available in the `docs/` directory:
+- [General Overview](docs/README.md)
+- [Architecture & Design](docs/architecture.md)
+- [Deployment Guide](docs/deployment.md)
+- [Admin Tutorial](docs/admin_tutorial.md)
+- [Localization Workflow](docs/development.md#localization)
+
+## 📄 License
+© 2024 Radionica3D. All rights reserved.

+ 4 - 1
docs/README.md

@@ -6,7 +6,10 @@ Welcome to the official documentation for the Radionica 3D platform. This docume
 Radionica 3D is a full-stack web application designed for a 3D printing studio based in Montenegro. It allows users to:
 - Upload 3D models (STL, OBJ, etc.).
 - Receive quotes and track order progress.
-- Interact with administrators via a real-time chat.
+- Interact with administrators via a real-time bidirectional WebSocket chat.
+- View and acknowledge technical 3D printing nuances (anisotropy, shrinkage, etc.).
+- Manage cookie consent for anonymous visitor tracking.
+- Place new orders directly from the unified Orders Dashboard.
 - View a portfolio of previous works.
 - Manage reviews and blog posts.
 

+ 8 - 0
docs/architecture.md

@@ -53,6 +53,13 @@ The backend logic is decoupled into services:
 - `FiscalService`: Handles digital signing and QR code generation for invoices (Montenegro EFI).
 - `PricingService`: Logic for calculating print costs based on material and weight.
 - `EmailService`: Sends notifications for order status changes and password resets.
+- `ChatManager`: Handles real-time communication via WebSockets (True Chat protocol).
+
+### 4. WebSocket "True Chat" Protocol
+To ensure high responsiveness and stability, real-time communication is handled via WebSockets:
+- **Global Channel (`/global`)**: Used for system-wide notifications, unread counts, and administrative alerts.
+- **Order Channel (`/chat`)**: A dedicated bidirectional channel per order. Messages are sent *through* the socket (not just via REST), allowing for instant delivery and reducing HTTP overhead.
+- **Persistence**: While messages are handled in real-time, the backend ensures they are persisted to the database synchronously before broadcasting.
 
 ## Data Flow
 ```mermaid
@@ -60,6 +67,7 @@ graph LR
     User((User Browser)) <--> Vite[Vite Dev Server / Nginx]
     Vite <--> FastAPI[FastAPI Backend]
     FastAPI <--> SQLite[(SQLite Database)]
+    FastAPI <--> WS[WebSockets / Redis]
     FastAPI <--> Telegram[Telegram Bot]
     FastAPI <--> Mail[Email Server]
 ```