Project structure and GitLab workflow¶
Good project structure makes it easier to collaborate, debug, and hand in your work. This page suggests a simple layout and workflow for Arduino/ESP32 projects using GitLab.
1. Suggested repository layout¶
For a typical course project, use a structure like this:
your-project/
ââ embedded/
â ââ hello-world/
â â ââ hello-world.ino
â ââ test-sensor-x/
â â ââ test-sensor-x.ino
â ââ test-sensor-y/
â â ââ test-sensor-y.ino
â ââ project/
â â ââ project.ino
â ââ libraries/ # optional: custom code shared between sketches
ââ docs/
â ââ ...
ââ ...
Guidelines:
- Keep each sketch in its own folder inside
embedded/.- To test a sensor or actuator, write and store a sketch in a dedicated folder. This is a good way to test the sensor or actuator before using it in the project.
- Store wiring diagrams, photos, and documentation in
docs/.
Tracking versions of your sketches¶
Instead of keeping many copies like code_v2_final_definitive.ino, let Git handle history:
- Keep the current version as
main.inoorproject.inoin a folder. - Use informative commit messages to track changes.
- Optionally tag important milestones (e.g.
v1.0-demo).
This makes it easier for others (and your future self) to see how the project evolved.