This project consist of a monorepo with components required for the implementation of DeRisk on Starknet. There are several components in this repository, each with its own purpose and functionality. The main components are:
shared
Both projects data_handler
, dashboard_app
work with the same shared database,
which is contained in the shared folder. It also contains all shared modules.
data_handler
Data processing and analysis component: Collects data from DeFi, analyzes it, and saves it to the db. It contains Celery tasks to schedule data collection runs. Once the data is collected, it triggers an endpoint on the dashboard_app
dashboard_app
Works as a server for the frontend_dashboard
. Generates an analytics dashboard using Streamlit. Contains an API to handle the Telegram webhook and send bot messages.
Key Features:
- Interactive data visualization
- Protocol statistics monitoring
- Loan portfolio analysis
- Real-time data updates
frontend_dashboard
React client app. Uses API if the dashboard_app
web_app
- Main web application interfacelegacy_app
- Legacy application functionality
- Docker installed on your machine (v19.03+ recommended).
- Docker Compose installed (v2.0+ recommended).
-
To set up this project run next command for local development in
derisk-research
directory: -
Environment Configuration:
cp apps/data_handler/.env.dev apps/data_handler/.env
- Start the Services:
docker-compose -f devops/dev/docker-compose.data-handler.yaml up --build
- Stop the Services:
docker-compose -f devops/dev/docker-compose.data-handler.yaml down
- To run test cases for this project run next command in
derisk-research
directory:
make test_data_handler
For detailed documentation, see the Data Handler
-
To set up this project run next command for local development in
derisk-research
directory: -
Environment Configuration:
cp apps/dashboard_app/.env.dev apps/dashboard_app/.env
- Start the Services:
docker-compose -f devops/dev/docker-compose.dashboard-app.yaml up --build
- Stop the Services:
docker-compose -f devops/dev/docker-compose.dashboard-app.yaml down
cd apps/dashboard_app
poetry install
cp .env.dev .env
poetry run uvicorn app.main:app --reload --port 8000
Explore the API will be available at http://localhost:8000/docs.
Make sure dashboard_app
is running!
cd apps/frontend_dashboard
npm install
npm run dev
Navigate to http://localhost:5173 to access the subscription form.
The backend is configured with CORS to allow requests from http://localhost:5173, and the Vite dev server proxies /api
to the backend.
- How to run test cases for shared package, run next command in root folder:
make test_shared
-
Naviagte to frontend_dashboard directory:
cd apps/frontend_dashboard
-
Build the Docker Image:
docker build -t frontend_dashboard .
or on linux
sudo docker build -t frontend_dashboard .
-
Run the Docker Container::
docker run -p 5173:5173 frontend_dashboard
or on linux
sudo docker run -p 5173:5173 frontend_dashboard
-
Access the Application: Open your browser and navigate to
http://localhost:5173
.