Skip to content

Doc repo introduction 15436609161273575530#21

Open
Djude1 wants to merge 15 commits into
AI-FanGe:mainfrom
Djude1:doc-repo-introduction-15436609161273575530
Open

Doc repo introduction 15436609161273575530#21
Djude1 wants to merge 15 commits into
AI-FanGe:mainfrom
Djude1:doc-repo-introduction-15436609161273575530

Conversation

@Djude1
Copy link
Copy Markdown

@Djude1 Djude1 commented Feb 26, 2026

No description provided.

google-labs-jules Bot and others added 15 commits February 25, 2026 03:49
…d hardware usage

This new file provides a comprehensive overview of the AI Blind Glasses system, including:
- Repository structure breakdown.
- System architecture and data flow between ESP32 and Python backend.
- Detailed pinout for XIAO ESP32S3 (Camera, Mic, Speaker, IMU).
- Instructions for switching functions via voice commands.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
Added `ineedyou/ocr_test` containing:
- `omni_client.py`: Copied from root, handles multimodal interaction (including OCR via Qwen-Omni).
- `test_ocr.py`: A script to test OCR capabilities by sending an image to Qwen-Omni.
- `requirements.txt`: Dependencies for the test script.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
…files

This commit includes:
- REPO_INTRODUCTION.md: Detailed documentation of the repository.
- ineedyou/ocr_test/: A new folder for testing OCR capabilities with Qwen-Omni.
- ineedyou/ocr_test/omni_client.py: Client for multimodal interaction.
- ineedyou/ocr_test/test_ocr.py: Test script for OCR.
- ineedyou/ocr_test/requirements.txt: Dependencies for the test script.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit adds a dedicated OCR test environment in `ineedyou/ocr_test/`:
- `ocr_server.py`: A lightweight FastAPI server that receives video frames from the ESP32 and performs OCR using Qwen-Omni.
- `omni_client.py`: An asynchronous client for the Qwen-Omni API, replacing the synchronous one to prevent blocking the event loop.
- `README.md`: Detailed instructions on how to set up the environment, configure the ESP32, and run the test.
- `requirements.txt`: Dependencies for the test environment.
- `test_ocr.py`: A script to test OCR with a static/downloaded image.

Security Fixes:
- Removed hardcoded API keys from `omni_client.py`, `ocr_server.py`, and `test_ocr.py`. Now relies on `DASHSCOPE_API_KEY` environment variable.

Concurrency Fixes:
- `omni_client.py` now uses `AsyncOpenAI` and `async for` to properly handle streaming responses without blocking the asyncio event loop.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
Added `ineedyou/full_stack_web/` containing:
- **Backend (Django)**:
  - `users`: Custom user model and authentication.
  - `devices`: Device management and logs.
  - `config`: Settings and URLs.
  - `entrypoint.sh`: Auto-migration and default user creation (`admin`/`admin123`, `user1`/`user123`).
  - `Dockerfile`: Python 3.9 environment.
- **Frontend (React)**:
  - `src/pages`: Login and Dashboard (Admin/User views).
  - `src/context`: Auth context for state management.
  - `Dockerfile`: Multi-stage build (Node -> Nginx).
- **Docker Compose**:
  - Orchestrates `db` (Postgres), `backend`, and `frontend`.
  - Includes healthchecks and volume persistence.
- **README.md**: Deployment instructions.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit addresses build failures in the full-stack web dashboard and improves documentation.

Changes:
- **`ineedyou/full_stack_web/frontend/Dockerfile`**:
  - Removed `COPY package-lock.json ./` to prevent build failure (lock file not present initially).
  - Changed `as` to `AS` in multi-stage build for consistency.
- **`ineedyou/full_stack_web/frontend/tsconfig.json` & `tsconfig.node.json`**:
  - Added TypeScript configuration files required by `tsc` during the build process.
- **`ineedyou/full_stack_web/docker-compose.yml`**:
  - Removed obsolete `version: '3.8'` attribute.
- **`ineedyou/full_stack_web/README.md`**:
  - Added "Windows Troubleshooting" section for Docker Desktop pipe errors.
  - Added explicit URLs for accessing Frontend, Backend API, and Admin Panel.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit resolves build failures in the full-stack web dashboard and adds comprehensive repository documentation.

Changes:
- **`ineedyou/full_stack_web/frontend/Dockerfile`**:
  - Removed `COPY package-lock.json ./` to prevent build failure when the lock file is not present.
  - Changed `as` to `AS` in multi-stage build for consistency.
- **`ineedyou/full_stack_web/frontend/tsconfig.json` & `tsconfig.node.json`**:
  - Added missing TypeScript configuration files required by `tsc` during the build process.
- **`ineedyou/full_stack_web/docker-compose.yml`**:
  - Removed obsolete `version: '3.8'` attribute.
- **`ineedyou/full_stack_web/README.md`**:
  - Added "Windows Troubleshooting" section for Docker Desktop pipe errors.
  - Added explicit URLs for accessing Frontend, Backend API, and Admin Panel.
- **`REPO_INTRODUCTION.md`**:
  - Created a new file providing a detailed introduction to the repository content, system operation, hardware pinout, and function switching methods.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
Changes:
- **`ineedyou/full_stack_web/frontend/package-lock.json`**: Created a minimal dummy lock file. This serves as a bulletproof workaround for Docker Compose using a cached context that stubbornly tries to `COPY package.json package-lock.json ./` even after the Dockerfile was modified.
- **`ineedyou/full_stack_web/frontend/src/pages/Dashboard.tsx` & `Login.tsx`**: Fixed incorrect relative import paths for `AuthContext` (`../context/AuthContext` instead of `./context/AuthContext`).
- **`ineedyou/full_stack_web/frontend/src/context/AuthContext.tsx`**: Added explicit type annotations (`username: string`, `password: string`) to the `login` function to satisfy the strict TypeScript compiler configuration (`tsconfig.json`).

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit resolves the `tsc && vite build` failures during the Docker build process:
- Added a dummy `package-lock.json` to the frontend to satisfy the Docker cache and `COPY` command reliably across different environments.
- Removed unused `React` imports from `App.tsx`, `Dashboard.tsx`, `Login.tsx`, and `AuthContext.tsx`. In React 17+, importing `React` is no longer necessary for JSX, and strict TypeScript linting (`noUnusedLocals: true`) flags this as an error, halting the build.
- Removed unused Material UI components (`Card`, `CardContent`) from `Dashboard.tsx`.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
Changes:
- **`ineedyou/full_stack_web/backend/entrypoint.sh`**:
  - Enhanced the user creation logic to explicitly call `.set_password()` and `.save()` on every startup. This guarantees the passwords (`admin123`, `user123`) are correctly hashed and set, fixing the "Invalid credentials" error the user experienced.
  - Added explicit generation of DRF Authentication Tokens for the default users on startup to ensure API login works immediately without needing to recreate users.
- **`ineedyou/full_stack_web/ARCHITECTURE.md`**:
  - Created a detailed Markdown file explaining the folder structure and the specific role of every file in the `full_stack_web` directory (Backend Django apps, Frontend React components, Docker configs) as requested.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit addresses the issue where the frontend was accessible on port 3000, but the backend API on port 8000 was unreachable, leading to "Invalid credentials" during login.

Changes:
- **`ineedyou/full_stack_web/backend/Dockerfile`**: Added `dos2unix` installation and applied it to `entrypoint.sh`. This prevents the container from crashing immediately with a `\r: command not found` error, which happens when Windows Git clients checkout the bash script with CRLF line endings.
- **Django App Initialization**: Created missing `__init__.py` and `apps.py` files for the `users`, `devices`, and `config` directories to ensure Django correctly recognizes them as Python modules.
- **`ineedyou/full_stack_web/renew.md`**: Created the requested log file detailing the root cause of the bug and providing the exact commands the user must run (`docker-compose down -v` then `docker-compose up -d --build`) to resolve the issue locally.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit resolves the issue where the backend API was unreachable on port 8000, causing login failures on the frontend.

Changes:
- **`entrypoint.sh` & `init_db.py`**: Extracted the user/token creation logic from the bash heredoc into a dedicated Python script (`init_db.py`). Removed `set -e` from `entrypoint.sh` so that if database initialization fails, the container doesn't crash silently, and the web server still starts (allowing developers to see error logs/pages).
- **`docker-compose.yml`**: Added `PYTHONUNBUFFERED=1` to ensure Python print statements from `init_db.py` appear immediately in Docker logs.
- **`Dockerfile`**: Added `dos2unix` to strictly convert `entrypoint.sh` from Windows CRLF to Unix LF line endings to prevent `\r: command not found` errors.
- **Hygiene**: Removed accidental `__pycache__` commits and added a comprehensive `.gitignore` for the `full_stack_web` directory.
- **`renew.md`**: Updated with instructions on how to view backend logs for troubleshooting.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit resolves the `exec /app/entrypoint.sh: no such file or directory` error when running the backend container.

Changes:
- **`ineedyou/full_stack_web/docker-compose.yml`**: Modified the backend entrypoint to run `sh -c "dos2unix /app/entrypoint.sh && bash /app/entrypoint.sh"`. Because `docker-compose` mounts the host's `./backend` folder over the container's `/app` folder at runtime, any file converted to LF during the `docker build` phase was immediately overwritten by the Windows host's CRLF file, causing the crash. Running `dos2unix` dynamically at startup guarantees the script has correct Unix line endings before execution.
- **`ineedyou/full_stack_web/backend/.gitattributes`**: Added a configuration file instructing Git to enforce `LF` line endings for all `.sh` files during checkout, providing a secondary layer of protection against Windows CRLF issues.
- **`ineedyou/full_stack_web/renew.md`**: Updated the log to explain the exact root cause of the volume mount overwrite issue and provided instructions on how to rebuild and test the environment.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit addresses the issue where the backend container successfully completed database migrations and user initialization but crashed during the final step (`python manage.py runserver`) with the error: `django.core.exceptions.ImproperlyConfigured: WSGI application 'config.wsgi.application' could not be loaded; Error importing module.`

Changes:
- **`ineedyou/full_stack_web/backend/config/wsgi.py`**: Added the core WSGI configuration file required by Django's `runserver` to start the HTTP interface.
- **`ineedyou/full_stack_web/backend/config/asgi.py`**: Added the ASGI configuration file for completeness and future asynchronous support.
- **`ineedyou/full_stack_web/renew.md`**: Logged the fix, explaining that the final crash cause was identified and resolved, and provided simple instructions (`docker-compose down` / `up -d`) to apply the fix and successfully log in.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
This commit resolves an issue where the React frontend successfully authenticated but failed to redirect the user to the dashboard.

Changes:
- **`ineedyou/full_stack_web/frontend/src/pages/Login.tsx`**: Added `useNavigate` from `react-router-dom` and implemented `navigate('/')` upon successful login, resolving the "unresponsive login button" issue.
- **`ineedyou/full_stack_web/renew.md`**: Updated the changelog with the correct date (2026-02-28, matching the user's system logs). Added an explanation clarifying that the `HTTP 401 Unauthorized` response on `http://localhost:8000/api/` is the expected, correct behavior for a secure API when accessed directly without a token.

Co-authored-by: Djude1 <188016353+Djude1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant