project-layout
project-layout copied to clipboard
Proposal: It would be nice if there's a CLI to generate this layout
@cyantarek hi 🤝
I worked around this idea a few weeks (start at Nov 2019), because I need exact "lazy" solution for every new project at my current work 😉
Please note: It's non-profit "pet" project from me to myself.
So, my solution is more like create from scratch base full stack app. It means, you can create from one CLI command:
- REST API (or/and gRPC) with popular Go packages (included rules of
project-layout); - SPA with Preact/React/Vue/Svelte/etc;
- Embed all static files to binary ("one-file-solution");
- Configured (and production-ready) Docker container with this full stack app;
Yes, something like
create-react-app, but for full stack apps.
At this moment, I have repository: https://github.com/create-go-app
Warning: current project status is WIP (work in progress).
Already done:
- MVP for CLI;
- net/http backend template;
- Preact.js frontend template;
- Configured
Dockerfiles for templates;
Attention:
docker-compose.ymlis not complete, don't containerize it for production.
Huge list of features are already at my backlog (ASAP list).
If you want to help, give advice or/and review code — you're welcome! 👍
@koddr hi, very cool project. I will try my best to contribute onto your project.
It would be nice if there's a CLI to generate this layout
Note that the patterns and project layout from this repository are discouraged and deprecated. I would not recommend building a new project on top of this.
@dominikbraun, deprecated? I wonder, Why? Then what project layout we will follow?
Many things in this repository that are considered as "standard" are actually discouraged, especially the pkg-structure. See this: https://github.com/golang-standards/project-layout/issues/10
Then what project layout we will follow?
It entirely depends on your project. For different projects there are different layout that match best. However, there are some basic principles you need to keep in mind: https://rakyll.org/style-packages/
You can build you own structure on top of that principles. Some concrete possible structures are shown here: https://medium.com/@benbjohnson/standard-package-layout-7cdbc8391fc1#.ds38va3pp
@dominikbraun thank you for actively participating in the discussion! It's great to have a wide community discussion with a diverse set of opinions. It's ok to have your own preferences, which might be different from the patterns captured in this repo, but you also need to be able to let others have their own too. Let the community members decide what works for them and what they like and what they want to use :-)
@cyantarek / @koddr This is a great idea! Thanks for kicking off the discussion around it! It's also good to leverage similar capabilities in other dev stacks to learn from them and to make it even better (e.g., Yeoman in the node.js ecosystem).
Se also https://github.com/golang-standards/project-template/pull/2 to add shell script to make standard layout.
Hi there! I'have written a simple project to generate go projects based on this layout. Of course, it does not implements all directories. But it supports overriding plus plugins, so you can add/modify everything you want.
I'have created an issue to add to description https://github.com/golang-standards/project-layout/issues/111