# http-web **Repository Path**: xiangdada/http-web ## Basic Information - **Project Name**: http-web - **Description**: 一个简单的http服务端,安装环境npm install,运行npm run dev - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-03 - **Last Updated**: 2026-06-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HTTP-Web Facial Recognition and Visitor Management System A real-time facial recognition and visitor management web service system built on Express and Socket.IO, providing comprehensive features for record management, verification, registration, and more. ## Features - **Facial Record Management**: Real-time recording and management of facial recognition data - **Stranger Tracking**: Recording and tracking access information of unknown individuals - **Visitor Management**: Complete visitor information recording and querying functionality - **Facial Recognition**: Support for managing facial recognition requests and responses - **Identity Verification**: Multi-face verification with template management support - **Face Enrollment**: Registration of new users' facial information - **QR Code Management**: Generation and management of visitor QR codes - **Face Enrollment**: Bulk facial data entry functionality - **Real-time Communication**: Real-time data push via Socket.IO - **Console Logs**: Visual interface for viewing system logs ## Technology Stack - **Backend Framework**: Express.js - **Real-time Communication**: Socket.IO - **Frontend Interface**: HTML5 + CSS3 + JavaScript - **Runtime Environment**: Node.js ## Quick Start ### Prerequisites - Node.js >= 12.0 - npm or yarn ### Installation Steps ```bash # Clone the project git clone https://gitee.com/xiangdada/http-web.git cd http-web # Install dependencies npm install ``` ### Start the Service ```bash # Start in development mode npm run dev # Or run directly node app.js ``` The service runs by default at `http://localhost:3000`. Ensure port 3000 is not in use. ## Project Structure ``` http-web/ ├── app.js # Main entry file containing all business logic ├── package.json # Project configuration and dependencies ├── public/ │ ├── index.html # Web interface │ ├── app-client.js # Client-side Socket.IO communication │ └── style.css # Interface styling └── README.md # Project documentation ``` ## API Endpoints The system provides the following RESTful API endpoints: ### Basic Information | Method | Path | Description | |--------|------|-------------| | GET | `/` | Access the web management interface | | GET | `/api/server-info` | Retrieve server information | ### Record Management Endpoints | Method | Path | Description | |--------|------|-------------| | GET | `/api/records/face` | Retrieve facial recognition records | | POST | `/api/records/face` | Add a facial recognition record | | DELETE | `/api/records/face/:id` | Delete a single facial record | | DELETE | `/api/records/face` | Clear all facial records | | GET | `/api/records/stranger` | Retrieve stranger access records | | POST | `/api/records/stranger` | Add a stranger access record | | DELETE | `/api/records/stranger/:id` | Delete a stranger record | | GET | `/api/records/visit` | Retrieve visitor records | | POST | `/api/records/visit` | Add a visitor record | | DELETE | `/api/records/visit/:id` | Delete a visitor record | | GET | `/api/records/recognition` | Retrieve recognition records | | POST | `/api/records/recognition` | Add a recognition record | | DELETE | `/api/records/recognition/:id` | Delete a recognition record | | GET | `/api/records/verify` | Retrieve verification records | | POST | `/api/records/verify` | Add a verification record | | DELETE | `/api/records/verify/:id` | Delete a verification record | | GET | `/api/records/enroll` | Retrieve enrollment records | | POST | `/api/records/enroll` | Add an enrollment record | | DELETE | `/api/records/enroll/:id` | Delete an enrollment record | | GET | `/api/records/qrcode` | Retrieve QR code records | | POST | `/api/records/qrcode` | Add a QR code record | | DELETE | `/api/records/qrcode/:id` | Delete a QR code record | | GET | `/api/records/addFace` | Retrieve face enrollment records | | POST | `/api/records/addFace` | Add a face enrollment record | | DELETE | `/api/records/addFace/:id` | Delete a face enrollment record | ### Template Management Endpoints | Method | Path | Description | |--------|------|-------------| | GET | `/api/templates` | Retrieve all templates | | POST | `/api/templates` | Save a template | | PUT | `/api/templates/:id` | Update a template | | DELETE | `/api/templates/:id` | Delete a template | ## Socket.IO Events ### Client Receive Events | Event Name | Description | |------------|-------------| | `faceRecord` | New facial recognition record | | `strangerRecord` | New stranger access record | | `visitRecord` | New visitor record | | `recognitionRecord` | New recognition record | | `verifyRecord` | New verification record | | `enrollRecord` | New enrollment record | | `qrcodeRecord` | New QR code record | | `addFaceRecord` | New face enrollment record | | `serverLog` | Server log message | ### Client Send Events | Event Name | Description | |------------|-------------| | `subscribe` | Subscribe to specific record types | | `unsubscribe` | Unsubscribe from record types | | `sendRecord` | Send a record to the server | ## Web Interface Overview The system provides an intuitive web management interface with the following modules: ### Top Information Bar Displays server IP address and runtime status. ### Navigation Tabs - **Face Records**: View and manage facial recognition records - **Strangers**: Track access records of unknown individuals - **Visitors**: Manage visitor information - **Recognition**: View facial recognition operation logs - **Verification**: View identity verification records and configure templates - **Enrollment**: View new user registration records - **QR Codes**: Manage visitor QR codes - **Face Enrollment**: Bulk upload facial data - **Console**: View system operation logs ### Universal Features - Real-time record list refresh - Detailed record viewing - Single record deletion - Bulk record clearing - Template saving and loading - JSON data display ## Configuration ### Server Configuration Modify the following settings in `app.js`: ```javascript const PORT = process.env.PORT || 3000; // Server port const SERVER_IP = getServerIP(); // Server IP (auto-detected) ``` ### Record Limit By default, the system limits each record type to a maximum of 1000 entries. Older records are automatically purged when the limit is exceeded. Modify the `maxSize` parameter in the `limitRecords` function to adjust this value. ## Frequently Asked Questions **Q: The service fails to start?** A: Check if port 3000 is in use and ensure your Node.js version meets the requirements. **Q: Records are not updating in real time?** A: Ensure your browser allows WebSocket connections and refresh the page to retrieve the latest data. **Q: How do I change the record retention limit?** A: Modify the `maxSize` parameter in the `limitRecords` function within `app.js`. ## License This project is open-sourced under the MIT License. ## Contribution Guidelines Issues and Pull Requests are welcome to help improve the project. ## Contact Project URL: https://gitee.com/xiangdada/http-web