Setup & Installation
Relevant source files
The following files were used as context for generating this wiki page:
The Technical Analysis project is a multi-tier terminal application designed to test trading algorithms and strategies using the Tinkoff API. The system architecture is composed of a React-based frontend, a NestJS backend, and a specialized Python-based indicators module.
Setting up the environment requires synchronizing multiple dependency managers (NPM, Poetry) and configuring environment-specific variables to ensure communication between the terminal and the financial API providers.
Sources: readme.md:1-5, backend/package.json:20-30, frontend/package.json:5-15
System Prerequisites
Before installation, the following runtimes and package managers must be available on the host system:
- Node.js: Required for both the frontend React application and the NestJS backend server.
- Python & Poetry: Necessary for the
indicatorsmodule which handles complex mathematical computations. - Tinkoff API Access: A valid secret key is required for data fetching.
Sources: readme.md:13
Component Architecture
The installation process is divided into three distinct modules that must be configured and run concurrently.
The diagram shows the parallel dependency structure across the three main project environments.
Sources: readme.md:15-18
Installation Steps
1. Frontend Setup
The frontend is built using Create React App and utilizes klinecharts for financial data visualization.
- Navigate to the directory:
cd frontend - Install dependencies:
npm install(oryarn) - Start development server:
npm run start
Sources: readme.md:15, frontend/package.json:26, frontend/README.md:10-15
2. Backend Configuration
The backend is a NestJS application. It requires a local configuration file for authentication.
- Navigate to the directory:
cd backend - Install dependencies:
npm install - Configuration: Create a file named
.envin the/backendfolder. - Add the following line:
TINKOFF_SECRET=your_secret_key
Sources: readme.md:16-17, backend/README.md:21-23
3. Indicators Module
This module handles technical analysis calculations through a Python environment.
- Navigate to the directory:
cd backend/indicators - Install environment:
poetry install - Run the module:
poetry run python main.py
Sources: readme.md:18
Operational Scripts
The root package.json provides convenience scripts to manage the lifecycle of both frontend and backend services from a single location.
| Command | Action | Source File |
|---|---|---|
npm run start:backend:dev | Launches NestJS in watch mode | package.json:8 |
npm run start:frontend:dev | Launches React development server | package.json:9 |
npm run lint | Runs ESLint across all packages | package.json:10-13 |
npm run build (Backend) | Compiles TypeScript to NestJS dist | backend/package.json:9 |
npm run build (Frontend) | Creates production React bundle | frontend/package.json:27 |
Development Workflow Sequence
The sequence illustrates the typical startup order required to establish a fully functional development environment.
Sources: package.json:8-9, backend/package.json:11, readme.md:18
Chart Library Build (Optional)
The project includes a custom lightweight k-line chart component in frontend/src/klinechart. If modifications are made to the core chart logic, it must be rebuilt using Rollup.
- Build Core:
npm run build-core(uses./config/rollup.config.js) - Build Extension:
npm run build-extension(uses Babel) - Complete Build:
npm run build
Sources: frontend/src/klinechart/package.json:44-46, frontend/src/klinechart/README.md:46-55
Conclusion
Successful setup requires the concurrent operation of the Node.js backend, the React frontend, and the Python indicators process. Proper injection of the TINKOFF_SECRET into the backend environment is critical for any functionality involving real-time or historical market data.
Sources: readme.md:13-18