Skip to content
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

Restructure Files in Features #45

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Restructure Files in Features #45

merged 3 commits into from
Apr 27, 2023

Conversation

boudra
Copy link
Contributor

@boudra boudra commented Apr 26, 2023

This PR moves files around so that we split the codebase in feature or domains, decoupling business logic and the interface:

- src
  - cli # scripts that are executed form the command line, like indexer and passport
  - passport # passport feature
  - prices # prices feature
  - indexer # event handlers and blockchain related stuff
  - http # HTTP server feature
  - calculator # calculator related stuff
  - utils # miscelaneous util functions, we should split these up if new features start emerging

Complete structure:

src
├── calculator
│   └── index.ts
├── cli
│   ├── indexer.ts
│   └── passport.ts
├── config.ts
├── http
│   └── index.ts
├── indexer
│   ├── abis
│   ├── handleEvent.ts
│   └── handlers
├── passport
│   └── index.ts
├── prices
│   ├── coinGecko.ts
│   └── index.ts
├── test
│   ├── fixtures
│   └── server.test.ts
└── utils
    ├── fetchRetry.ts
    ├── getBlockFromTimestamp.ts
    ├── index.ts
    └── ipfs.ts

12 directories, 14 files

I want to encourage us to think in terms of features or domain to split files. Let's try to think before adding new files, where they should go and how we can structure things, and watch out for the utils folder if something becomes too big we can split it into it's own domains.

Copy link
Contributor

@gravityblast gravityblast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it <3

@boudra boudra merged commit b0a7317 into main Apr 27, 2023
@boudra boudra deleted the feat/restructure-files branch April 27, 2023 11:40
bard pushed a commit that referenced this pull request Aug 2, 2023
* chore: delete jest config

* refactor: restructure files in domains

* feat: restore config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants