stacks-network / sbtc

Repo containing sbtc
GNU General Public License v3.0
220 stars 4 forks source link

[Design]: Mono-repo Structure #82

Closed AshtonStephens closed 2 months ago

AshtonStephens commented 5 months ago

Completing the issue description and arriving at a conclusion is the deliverable of this issue.

Design - Monorepo Structure

This ticket holds the design of sBTC-v1's Monorepo Structure and how it fits into sBTC-v1.

1. Summary

We want a reasonable monorepo structure so that the different concerns and artifacts are broken up logically.

2. Context & Purpose

Relevant Research Discussions

External Resources

3. Design

3.1 Proposed Component Design

We have multiple different artifacts, I think it probably make sense to have a different directory for each artifact except the signer which should all be in one directory as a cargo crate. Within each directory the primary can just figure out how it should be done through PRs.

3.1.1 Design Diagram

Here's my rough thought:

sbtc-v1
├── .generated-sources # <- Any autogenerated sources go here (not pushed to the repo)
├── .github
├── .gitignore
├── Cargo.toml
├── api-name
│   ├── api-definition
│   ├── cdk
│   └── lambda
├── blocklist-client
├── bridge-website
├── clarity
├── devenv
├── signer
└── txn-lib

3.1.2 Considerations & Alternatives

I don't think there are many alternatives to this that are still a mono repo. The names don't need to be what I suggested above, but that's my thought idea.

3.2 Areas of Ambiguity

Are there better standard ways to do this?


Closing Checklist

netrome commented 5 months ago

I'm wondering if we should have rust-specifics such as Cargo.toml in the repo root, or if it makes sense to have all Rust crates live one level up in a crates folder.

I'm fine with Cargo.toml being a special case since Rust is our main language, but I would not like to see the repo root being polluted with more toolchain-specific files which only apply to certain applications.

xoloki commented 5 months ago

Putting Rust crates inside a crates folder seems really unnecessary, and would add a layer of friction.

I'm okay with putting e.g. smart contracts in a subfolder and not exposing their build systems at top level.