dev
- the personal project tool
I follow the same set of steps with every personal project:
- create a folder
- write a readme with the basic idea
- install the required language runtime/compiler
- install dependencies
- write code
- create a journal.md and start tracking my thoughts as I work on the project.
I’ve also created a docker container for the project so I dont have to worry about installing system-wide runtimes (e.g., ruby) for just one project. so I’d like to make a tool that does this kind of thing for every project so its self-contained.
Requirements
- Create a new project, which sets up:
- a folder with readme and journal.
- a related docker image with a sane default docker file and shared volume
- git init’d repo.
- Interactive use of the container during coding sessions without knowing details of docker commands to do so.
- Ability to install software in the container and have it become part of the container image, either as a snapshot or (preferably) as declarative updates to the dockerfile.
- Non functional: Use a container library that does not need root access, such as podman.
- Push whole project to github/gitlab/etc
- (Nice to have) Support for multi-component projects. Each component would be an independent project on its own, but work together to form a cohesive solution. For example, a set of microservices that form an ecommerce site would be multiple components in a single project.
Mockup of UX
In what follows dev
is a stand-in name for the tool proposed.
-
Creating a new project:
dev new
… creates a folder
, adds aREADME.md
andjournal.md
. It then spins up a docker container using
as the base docker image, eg, alpine linux. It also sets up the shared volume used to manipulate the project’s files. -
Work on the project:
dev do [
] --save-changes // prjname optional if already in folder …(re)starts the docker container and keeps it ready for interactive use.
--save-changes
saves any updates to the image for future sessions - Change code: use standard IDE features, edits are done in shared host folder, which is mirrored in guest via the shared volume.
- Change environment of project: Use standard executables in guest OS.
- Source version control: use standard git commands
- Publish project to Github/et al: Use standard git commands.
Implementation thoughts
As described, this looks like a thin shell script veneer over docker/podman, and that’s probably not a bad thing (TM). The only interesting/complicated bit might be the ability to reify cli commands run within the container as dockerfile commands. However, I wonder if that too might be too much. Exactly how reproducible should every step in this process be, especially if it starts with downloading a binary?