feat: implement project launch script run.sh and update README

This commit is contained in:
2025-12-20 22:05:18 +03:00
parent e4dc3159cd
commit 58831c536a
23 changed files with 964 additions and 28 deletions

View File

@@ -0,0 +1,54 @@
# Feature Specification: Project Launch Script
**Feature Branch**: `003-project-launch-script`
**Created**: 2025-12-20
**Status**: Draft
**Input**: User description: "давай создадим скрипт для запуска проекта"
## User Scenarios & Testing *(mandatory)*
### User Story 1 - Launch Project (Priority: P1)
As a developer, I want to launch the entire project (backend and frontend) with a single command so that I can start working quickly without manually running multiple commands in different terminals.
**Why this priority**: This is the core functionality requested. It simplifies the development workflow.
**Independent Test**: Can be fully tested by running the script and verifying that both backend and frontend services are accessible.
**Acceptance Scenarios**:
1. **Given** the project is cloned and I am in the root directory, **When** I run the launch script, **Then** the script checks for dependencies, installs them if missing, and starts both backend and frontend servers.
2. **Given** the servers are running, **When** I press Ctrl+C, **Then** both backend and frontend processes terminate gracefully.
3. **Given** dependencies are missing, **When** I run the script, **Then** it installs them before starting the servers.
---
### Edge Cases
- What happens when a port is already in use? The underlying tools (uvicorn/vite) will likely fail or complain. The script should ideally show this output.
- What happens if `python3` or `npm` is missing? The script should fail with a clear error message.
## Requirements *(mandatory)*
### Functional Requirements
- **FR-001**: The script MUST be executable from the project root (e.g., `./run.sh`).
- **FR-002**: The script MUST check if `python3` and `npm` are available in the environment.
- **FR-003**: The script MUST check for and install backend dependencies from `backend/requirements.txt` if they are missing or outdated.
- **FR-004**: The script MUST check for and install frontend dependencies from `frontend/package.json` if `node_modules` is missing.
- **FR-005**: The script MUST start the backend application server in development mode.
- **FR-006**: The script MUST start the frontend application server in development mode.
- **FR-007**: The script MUST run both backend and frontend processes concurrently.
- **FR-008**: The script MUST handle `SIGINT` (Ctrl+C) to terminate both processes gracefully.
### Key Entities *(include if feature involves data)*
N/A
## Success Criteria *(mandatory)*
### Measurable Outcomes
- **SC-001**: Developers can start the full stack with 1 command.
- **SC-002**: Both backend and frontend services are accessible via their configured network ports within 30 seconds of running the script (assuming dependencies are installed).
- **SC-003**: 100% of child processes are terminated when the script is stopped.