Laravel Forge Site Deployment Status

TLDR

Example :
src/
├── trades/
│   ├── limit/
│   │   └── ... (логика limit ордеров, controller, etc...)
│   ├── market/
│   │   └── ... (обработка маркет-ордеров)
│   ├── presets/
│   │   └── ... (обработка tp/sl пресетов)
│   └── listeners/
│       ├── auto-buy-bot/
│       │   └── ... обработка авто покупок
│       ├── auto-chat-buy-bot/
│       │   └── ... обработка авто покупок через chat бота
│       └── token-migrated-to-graduated/
│           └── ... обрабокта снайпина когда токен мигрирует
│
└── infrastructure/
    ├── jupiter/
    │   └── ... (весь код, что нужен для работы с jupiter)
    ├── pumpfun/
    │   └── ... (весь код, что нужен для работы с pump и pump amm)
    ├── raydium/
    │   └── ... (весь код, что нужен для работы с raydium)
    └── share/
        └── ... (общий код, который может быть полезен для всех в этой области)

Api Documentation

https://app.yodao.dev-2-tech.ru/api-docs

Dev environment

run:

  • docker-compose up -d run database container
  • npx prisma db push --force-reset refresh database schemas
  • npm run seed seed database
  • npm run start:dev run app
  • openssl rand -base64 32 (optional) generate a 256-bit (32-byte) Encryption Key for JWT_SECRET or ENCRYPTION_KEY

Dev server

  • Connect: ssh forge@206.189.63.102
  • See live console: tail -f /home/forge/.forge/daemon-276032.log or yodao-log
  • Find special string in file and 100 rows after: grep -A 100 "20e3f77d-a2d3-4dff-9978-5fd97a26e2de" /home/forge/.forge/daemon-276032.log

System metrics

you need to start three containers specified in docker-compose.prod.yml:

  • node-exporter – collects system metrics.

  • Prometheus – receives metrics from node-exporter and forwards them to Grafana.

  • Grafana – visualizes the system metrics in a clear and convenient way.

  • sudo docker-compose -f docker-compose.prod.yml up -d run containers

  • sudo docker-compose -f docker-compose.prod.yml down down containers

Visit: http://app.yodao.dev-2-tech.ru:3005 and use the following credentials:

  • Login / Password:Example :
    admin
  • Prod Password:Example :
    apNNY7m8kG6esUD

After logging in, open the Dashboard and select yodao-system-metrics – all collected system metrics will be displayed.

Logs with Loki

start three containers specified in docker-compose.prod.yml:

  • Loki – stores logs and indexes.

  • Promtail – collects logs from a specified file and sends them to Loki (the file can be modified in the configuration).

  • Grafana – visualizes logs with search capabilities.

  • sudo docker-compose -f docker-compose.prod.yml up -d run containers

  • sudo docker-compose -f docker-compose.prod.yml down down containers

Visit: http://app.yodao.dev-2-tech.ru:3005 and use the following credentials:

  • Login: admin
  • Password: admin

After logging in, open the Dashboard and select nest-loki-logs. Here you will find predefined LogQL queries (the query language for Loki), but you can create your own queries if necessary.

Doker

  • install docker + docker-compose:

    Example :
    sudo curl -L "https://github.com/docker/compose/releases/download/v2.34.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    /usr/local/bin/docker-compose --version
    
    sudo apt install docker.io
    docker --version
  • enter: http://app.yodao.dev-2-tech.ru:3005 (without HTTPS)

  • add data sources: image

  • add dashboard for loki: image

Framework

Nest framework TypeScript starter repository.

Installation

Example :
$ npm install

Running the app

Example :
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

Example :
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Swagger:

NestCli:

  • generate module:

npx nest g mo module_name

  • generate controller:

npx nest g co controller_name

  • generate service:

npx nest g s service_name

  • generate resource:

nest g resource (plural, e.g., "users")

Prisma

  • install

npm i -D prisma

  • init

npx prisma init

  • create\update schema npx prisma db push

If db push anticipates that the changes could result in data loss, it will:

Throw an error Require the --accept-data-loss option if you still want to make the changes

  • reset db schema

npx prisma db push --force-reset

Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)

prisma migrate dev

Reset your database and apply all migrations

prisma migrate reset

Apply pending migrations to the database in production/staging

prisma migrate deploy

Third Party Services

Notes

[!CAUTION] NestJS does not handle uncaught exceptions by default. Uncaught exceptions (e.g., errors that aren’t caught within a try-catch or aren’t properly handled by an HTTP exception filter) will cause the application to crash.

Example :
          .s$P*.s$$$s.`*T$$b T TP$P.d$P .sd$s.
        .s$P .s$$$$$$$b. T$$b T:P d$$P.d$$$$$$bs.
       d$$P d$$$$P'`T$$$b $$$;:$bd$$$$$$b`T$$*$$$b.
      d$$P d$$$P' .+. *$$:$$$;.$$$P^*""*^b.$$b T$$$b
     d$P .d$$$b.s$$$$$b TP^TP dP',d$$$$$s.`T$$b T$$$b
    d$P d$$P T$$$P*""*^b.b d,P^*"*^T$$$$$$$b`T$b$$$$$.
   ,$P d$P .$$$P'       `'*`        `T$$$$$$$b`T$$$$$$
   :$ d$P d$$$P                       `T$$$$$$b TPT$$$b
  :$$d$$ d$$$P                          T$$$$$$b T.`T$$;
  :$$$$$d$$$P                            T$$$$ $b T.T$$:
  $$$$$P$$$$                              T$$$$T$b T `T$
  $P$$$;$$$;                               T$^$b Tb b :$
  $`$$$ $$$;                                T.T$b TY$,:$
  $:$$$ $$$'                                `$ T$; $$;'$
  $;$$$;$$$                                  `b T; $$$ $
  $:T$$;$$$  .d$$s.                    .s$$b..$;:$;$$$.T
 / __`*:$$$ *'   `*Tb._            _.dP*'   `*$;:$:$P__ \
..' .`.:$$$         `*Ts'        `sP*'        $$:$$P'. `,,
;  /   ,$$;   .+s**s.   `.           .s**s+.  T$:PP'  \  :
: ,   /:$$;   \ *ss* \    ;         / *ss* /    +: \   . ;
 .`  :  $$;,  .+s$$$s+.            .+s$$$s+.  .* ;  ;  ',
  \   *.:$$,*d$P*"$$$T$b  ,+**+,  d$P*"$$$T$b*   .*    /
   \    `$$;:$; +:$$$:$$;*      *:$; +:$$$:$$;  :     /
         $$; T$b._$$$d$P          T$b._$$$d$P   ;
     `._.:$$, `*T$$$P*'            `*T$$$P*'    :._.'
         |$$;             '                     |P$$b.
         ;`$$,           :.     ,               :b.`T$b
         ` T$$b._        `*.__.*'               d$$b T$b
          . *TP*'           ""                 d$$$$b.:$;
           \                                  dP T$$$$$$$
            \          .+*"*--*"*+.          d$b. T$$^$$$
             `.       :._.--..--._.;       .'$$$$; $$ $$$
               ;.      `.        .'      .'  $$$$$ $P $$;
               : `.      `*----*'      .'    $$$$$ $b $P
               |   `.                .'      $$$$$Y$$dP
        [bug]  :     `.            .'        :T$$P$$P,db.
              /        `-.      .-'          dbT d$Pd$$$$b.
             /            `****'            d$$$PT$$$b T$$$b
           .'                              d$$$P db`T$b T$$$b
        _.'                               :$$$P.d$$b:$$$`$$$$;
   _.-*' `.                               $$$$:$$$$$;$$$:$$$$$
           `-.                            :$$$;$$$$$$$$$;$$$$$
              `-.                        .-T$$$$P$$$$$P d$$$$;
                 `.     `.     .*      .'   T$$$b`T$P.sd$$$$P
                   `.     `-  '      .'      `T$$b$$$$$$$$P'
                     `.            .'          `T.T$$$$P$$$b.
                       `.        .'             :$$$$P'd$$$$$;
                         `.    .'               $$$$$:d$;$$$$$.
                           `..'                 :$$$$;$$$b`T$$;
                                                 T$$$:$$$$; $$$
                                                  T$$$T$$$;d$$;
                                                   `T$b`T$$$$P
                                                     `*b T$P'

results matching ""

    No results matching ""