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

Proposal project structure #278

Closed
marcofranssen opened this issue Jun 27, 2023 · 0 comments · Fixed by #315
Closed

Proposal project structure #278

marcofranssen opened this issue Jun 27, 2023 · 0 comments · Fixed by #315
Assignees
Milestone

Comments

@marcofranssen
Copy link
Contributor

I would love to cleanup some more scripting e.g. Makefile.

For that I would also like to put a bit more convention into the directory structure and clean this up a bit as well, to simplify Dockerfiles etc.

Main idea is to move cmd, pkg, api one folder up.
Then within the cmd folder we name those to match the intended binary names, this allows massive simplification in Makefile + is a pretty common convention in Go projects. Also renaming those files to main.go to make it more clear these are executable entrypoints.

For the tornjak-frontend folder I would suggest to rename the folder to just frontend as the tornjak part is implicitly already there in the repo name.

Happy to send this as a PR on top of #275 to further simplify make targets as well continue cleanup of Dockerfiles. Doing that cleanup will allow me as well to implement the support for multi-architecture images like I did for all the other spiffe projects.

Please let me know if I should invest some time on these improvements?

See below an example of what I intend to do, left a whole bunch of files and folders for brevity.

.
├── LICENSE
├── Makefile
├── api
│   ├── agent
│   │   ├── api.go
│   │   ├── server.go
│   │   └── types.go
│   └── manager
│       ├── api.go
│       └── server.go
├── cmd
│   ├── tornjak-backend
│   │   └── main.go
│   └── tornjak-manager
│       └── main.go
├── config.conf
├── frontend
│   ├── axios.d.ts
│   ├── babel.config.json
│   ├── jest.config.js
│   ├── package-lock.json
│   ├── package.json
│   ├── public
│   │   ├── favicon.ico
│   │   ├── …
│   │   └── robots.txt
│   ├── src
│   │   ├── App.css
│   │   ├── …
│   │   └── tables
│   ├── tsconfig.json
│   └── webpack.config.js
├── go.mod
├── go.sum
├── pkg
│   ├── agent
│   └── manager
├── run_backend.sh
├── run_tornjak.sh
└── version.txt

43 directories, 126 files
@maia-iyer maia-iyer added this to the 1.4.x milestone Oct 24, 2023
@maia-iyer maia-iyer self-assigned this Oct 26, 2023
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 a pull request may close this issue.

2 participants