docs/docs/developers-guide.md

2.5 KiB

🧰 Developers Guide

This guide helps developers set up a local environment for contributing to the project.


Prerequisites

  • VS Code
  • Docker
  • Git

Setup Instructions

  1. Clone the repository

    git clone https://git.abyres.net/elixier/manager.git
    cd manager
    
  2. Create .env file

    FERNET_KEY=secretkey
    APP_URL=http://localhost:3000
    BACKEND_URL=http://localhost:8000
    APP_VERSION=1.1.0-build.1887.166b86a9
    AGENT_IMAGE=git.abyres.net/elixier/agent:1.1.0-build.1887.166b86a9
    
  3. Open in VS Code

    code .
    
  4. Reopen project in devcontainer

    Ctrl + Shift + P > Dev Containers: Reopen in container

  5. Initialize database

    reflex db migrate
    
  6. Create initial global admin

    python cli.py create-admin --email=admin@example.com --password=password
    
  7. Generate plugin repository

    python cli.py build-repo
    
  8. Run web app

    Development mode:

    Ctrl + Shift + P > Tasks: Run Task > Run

    Production mode:

    reflex run --env prod
    

Branching & Workflow

  • main — stable release
  • development — active development
  • feat-* — new features
  • fix-* — bug fixes

Pull requests to main branch require at least two approvals before merging.


Running Tests

  1. Open project in devcontainer using VS Code

  2. Ctrl + Shift + P > Tasks Run Task > Test

    or run this command in devcontainer:

    uv run pytest tests
    

OpenSearch

List of indexes

  • audit_log
  • cluster-metrics
  • deployment-metrics
  • host-metrics
  • host-logs
  • host-task-log

Delete index

  1. Delete one index:
curl -X DELETE -u admin:{OPENSEARCH_ADMIN_PASSWORD} -k https://localhost:9200/host-metrics
  1. Delete multiple indexes:
curl -X DELETE -u admin:{OPENSEARCH_ADMIN_PASSWORD} -k https://localhost:9200/audit_log,cluster-metrics,deployment-metrics,host-metrics,host-logs,host-task-log

Devcontainer Components

Container Component URL
Reflex Frontend http://localhost:3000
Backend http://localhost:8000
Swagger http://localhost:8000/docs
Opensearch API https://localhost:9200
Dashboard http://localhost:5601
Nginx Plugin repo http://localhost:8080