-
Notifications
You must be signed in to change notification settings - Fork 175
Stellar scafold fargate backend #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Stellar scafold fargate backend #646
Conversation
Co-authored-by: Eric Lau <[email protected]>
Reviewer's GuideThis PR scaffolds a new Rust-based Stellar backend API deployed via Fargate, integrates it with the existing Svelte UI for scaffold download, reorganizes the AI Deno server and import paths, and updates build/deploy configurations including Docker Compose and GitHub Actions workflows. Sequence diagram for Svelte UI downloading Stellar scaffold via Fargate backendsequenceDiagram
participant User as actor User
participant SvelteUI as Svelte UI
participant StellarAPI as Stellar Rust API (Fargate)
User->>SvelteUI: Click "Download Scaffold"
SvelteUI->>StellarAPI: POST /stellar/upgrade-scaffold (zip blob)
StellarAPI->>StellarAPI: Unzip, upgrade, re-zip contract
StellarAPI-->>SvelteUI: Return scaffold-project.zip
SvelteUI->>User: Save scaffold-project.zip
Class diagram for new and updated Rust backend modulesclassDiagram
class ServerConfig {
+host: String
+port: u16
+rate_limit_requests_per_second: u64
+wizard_origin: String
+from_environment_variables(): ServerConfig
}
class upgrade_scaffold {
+upgrade_to_scaffold(rust_contract_zip: web::Bytes): Result<Vec<u8>, HttpError>
}
class scaffold_upgrade {
+run_scaffold_upgrade_command(project_dir_path: &Path): Result<(), Error>
}
class zip_folder {
+unzip_in_temporary_folder(zip_data: Vec<u8>, expected_files: &[&str]): Result<TempDir, ZipError>
+zip_directory(zip_path: &Path): ZipResult<Vec<u8>>
}
class errors {
+to_http_hidden_error<E: Debug>(error: E): HttpError
+to_io_error<E: Debug>(error: E): IOError
+to_zip_io_error<E: Debug>(error: E): ZipError
}
ServerConfig <|-- upgrade_scaffold
upgrade_scaffold <|-- scaffold_upgrade
scaffold_upgrade <|-- zip_folder
zip_folder <|-- errors
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CoveMB the release workflows looks ok. I've left some comments. I will also need to provision the required resources to AWS e.g ECS cluster, ALB etc. I will do that work in a different IaC repository.
.github/workflows/docker-prod.yaml
Outdated
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | ||
id: push | ||
with: | ||
context: . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't have Dockerfile at the root, we need to specify a file
setting which points to the dockerfile. e.g
file: .//Dockerfile.production
.github/workflows/docker-prod.yaml
Outdated
fetch-depth: 0 | ||
|
||
- name: Prepare pre-requisites | ||
uses: ./.github/actions/prepare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this action. (the prepare
action)
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.
|
Summary
packages/ui/api/ai
module.Key Changes
packages/ui/api/stellar
with routes, controllers, utils, and tests.GET /health
and upgrade/scaffold routes (seesrc/routes /*
andsrc/controllers/*
).Dockerfile.dev
,Dockerfile.prod
,.dockerignore
,README.md
,rustfmt.toml
, andCargo.toml/lock
.packages/ui/api/stellar/tests/*
.packages/ui/api/*
topackages/ui/api/ai/*
:packages/ui/api/ai/ai-assistant/*
.packages/ui/api/ai/development-server.ts
.packages/ui/api/ai/.env.example
andDockerfile.dev
.packages/ui/api/docker-compose.yaml
to orchestrate local API components.
.github/workflows/docker-stg.yaml
,.github/workflows/docker-prod.yaml
..github/actions/oidc/action.yaml
.packages/core/stellar/src/zip-rust.ts
update.packages/core/stellar/zip-env-rust.js
to package Rust env/scaffold artifacts.update-scarb-project.ts
,erc20.ts
, and assorted test updates.packages/core/cairo_alpha/CHANGELOG.md
.packages/ui/.env.example
updated with keys used by the new layout..gitignore
,.prettierignore
,package.json
,netlify.toml
,.vscode/*
,rollup.config.mjs
).yarn.lock
.Breaking/Structural Changes
packages/ui/api/ai
. Any imports or tooling referencing the oldpackages/ui/api/*
paths must be updated to the new location.How to Run (Local)
packages/ui/api/stellar
:cargo run
(dev) or build with Docker:doc ker build -f Dockerfile.dev .
GET /health
packages/ui/api/ai
:deno task dev
(seedeno.json
anddevelopment -server.ts
)packages/ui/api
:docker compose up --build
.env.example
to.env
inpackages/ui
,packages/ui/api/ai
, andpackages/ui/api/stellar
as needed.Security/Infra
Testing/Verification
packages/ui/api/stellar/ tests/*
.GET /health
returns healthy.set).
Scope/Risk