Deroino commited on
Commit
65f2ed4
·
1 Parent(s): d18c032

docs: add project documentation in CLAUDE.md

Browse files
Files changed (1) hide show
  1. CLAUDE.md +101 -0
CLAUDE.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Project Overview
2
+
3
+ This project, `social-auto-upload`, is a powerful automation tool designed to help content creators and operators efficiently publish video content to multiple domestic and international mainstream social media platforms in one click. The project implements video upload, scheduled release and other functions for platforms such as `Douyin`, `Bilibili`, `Xiaohongshu`, `Kuaishou`, `WeChat Channel`, `Baijiahao` and `TikTok`.
4
+
5
+ The project consists of a Python backend and a Vue.js frontend.
6
+
7
+ **Backend:**
8
+
9
+ * Framework: Flask
10
+ * Core Functionality:
11
+ * Handles file uploads and management.
12
+ * Interacts with a SQLite database to store information about files and user accounts.
13
+ * Uses `playwright` for browser automation to interact with social media platforms.
14
+ * Provides a RESTful API for the frontend to consume.
15
+ * Uses Server-Sent Events (SSE) for real-time communication with the frontend during the login process.
16
+
17
+ **Frontend:**
18
+
19
+ * Framework: Vue.js
20
+ * Build Tool: Vite
21
+ * UI Library: Element Plus
22
+ * State Management: Pinia
23
+ * Routing: Vue Router
24
+ * Core Functionality:
25
+ * Provides a web interface for managing social media accounts, video files, and publishing videos.
26
+ * Communicates with the backend via a RESTful API.
27
+
28
+ **Command-line Interface:**
29
+
30
+ The project also provides a command-line interface (CLI) for users who prefer to work from the terminal. The CLI supports two main actions:
31
+
32
+ * `login`: To log in to a social media platform.
33
+ * `upload`: To upload a video to a social media platform, with an option to schedule the upload.
34
+
35
+ ## Building and Running
36
+
37
+ ### Backend
38
+
39
+ 1. **Install dependencies:**
40
+ ```bash
41
+ pip install -r requirements.txt
42
+ ```
43
+
44
+ 2. **Install Playwright browser drivers:**
45
+ ```bash
46
+ playwright install chromium
47
+ ```
48
+
49
+ 3. **Initialize the database:**
50
+ ```bash
51
+ python db/createTable.py
52
+ ```
53
+
54
+ 4. **Run the backend server:**
55
+ ```bash
56
+ python sau_backend.py
57
+ ```
58
+ The backend server will start on `http://localhost:5409`.
59
+
60
+ ### Frontend
61
+
62
+ 1. **Navigate to the frontend directory:**
63
+ ```bash
64
+ cd sau_frontend
65
+ ```
66
+
67
+ 2. **Install dependencies:**
68
+ ```bash
69
+ npm install
70
+ ```
71
+
72
+ 3. **Run the development server:**
73
+ ```bash
74
+ npm run dev
75
+ ```
76
+ The frontend development server will start on `http://localhost:5173`.
77
+
78
+ ### Command-line Interface
79
+
80
+ To use the CLI, you can run the `cli_main.py` script with the appropriate arguments.
81
+
82
+ **Login:**
83
+
84
+ ```bash
85
+ python cli_main.py <platform> <account_name> login
86
+ ```
87
+
88
+ **Upload:**
89
+
90
+ ```bash
91
+ python cli_main.py <platform> <account_name> upload <video_file> [-pt {0,1}] [-t YYYY-MM-DD HH:MM]
92
+ ```
93
+
94
+ ## Development Conventions
95
+
96
+ * The backend code is located in the root directory and the `myUtils` and `uploader` directories.
97
+ * The frontend code is located in the `sau_frontend` directory.
98
+ * The project uses a SQLite database for data storage. The database file is located at `db/database.db`.
99
+ * The `conf.example.py` file should be copied to `conf.py` and configured with the appropriate settings.
100
+ * The `requirements.txt` file lists the Python dependencies.
101
+ * The `package.json` file in the `sau_frontend` directory lists the frontend dependencies.