diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c820399 --- /dev/null +++ b/.env.example @@ -0,0 +1,41 @@ +# Copy this file to .env and adjust values as needed. +# config.py already ships with safe, environment-driven defaults, so every +# variable below is optional; only set what you need to override. +# See config.example.py for the full documented default for each setting. + +# --- Database --- +DB_HOST=localhost +DB_USER=root +DB_PASSWORD=your_database_password +DB_DATABASE=campus_system +DB_CHARSET=utf8mb4 +DB_POOL_SIZE=5 + +# --- Face recognition (optional; module not bundled in this repo) --- +FACE_RECOGNITION_MODEL_PATH=model/trainer.yml +FACE_RECOGNITION_HAAR_CASCADE_PATH=haarcascade_frontalface_default.xml +FACE_RECOGNITION_CONFIDENCE_THRESHOLD=50 +FACE_RECOGNITION_PREDICTION_THRESHOLD=70 +FACE_RECOGNITION_TIMEOUT_SECONDS=30 + +# --- Logging --- +LOG_LEVEL=INFO +LOG_DIR=logs +LOG_MAX_BYTES=10485760 +LOG_BACKUP_COUNT=5 + +# --- Application --- +APP_NAME=CIIMS +APP_VERSION=1.0.0 +DEBUG=False + +# --- AI assistant (optional; leave OPENROUTER_API_KEY empty to disable) --- +OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 +OPENROUTER_API_KEY=your_api_key_here +OPENROUTER_MODEL=deepseek/deepseek-chat +OPENROUTER_REFERER= +OPENROUTER_TITLE=CIIMS In-App Assistant +CIIMS_PROXY_URL= + +# --- Security --- +PASSWORD_HASH_ROUNDS=12 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..885a731 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 HelloBryte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index e258b0d..5c850d3 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ python main.py `config.py` already reads every setting from an environment variable with a sensible default, so the app runs out of the box. To override any value, -create a `.env` file in the project root (see `config.example.py` for the -full list of supported variables): +copy `.env.example` to `.env` and adjust as needed (see `config.example.py` +for the full documented default of every supported variable): ```env # Database DB_HOST=localhost @@ -114,6 +114,7 @@ ciims/ ├── scripts/ # Utility scripts (sample data generation, etc.) ├── config.py # Runtime configuration (env-driven, no secrets) ├── config.example.py # Reference/documentation for all config options +├── .env.example # Template for local .env overrides └── main.py # Application entry point ``` @@ -124,7 +125,7 @@ above. ### License -This project is licensed under the MIT License. +This project is licensed under the [MIT License](LICENSE). --- @@ -210,4 +211,4 @@ python main.py ### 许可证 -本项目采用 MIT 许可证。 +本项目采用 [MIT 许可证](LICENSE)。 diff --git a/requirements.txt b/requirements.txt index cc8be4b..0200f9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -PySide6==6.10.3 -mysql-connector-python==9.4.0 -python-dotenv==1.1.1 +PySide6==6.11.2 +mysql-connector-python==9.7.0 +python-dotenv==1.2.3 httpx==0.28.1