DEV Community

Thierry Nicola
Thierry Nicola

Posted on • Originally published at littleiffel.net on

The perfect repository (WebApplication)

Starting a new repository, aka new project is always exciting times. Starting fresh, no dependencies, no old code, just pure freedom to code and focus on the application code. But before getting started with that, let's setup the repository. But this raises many questions, public or private, which license to use, gitlab, github or sourcehut... and then finally the name. (and we all know naming is hard). After the many important decisions i am almost ready to code, but before that let's choose the language, if not forced upon you, you should choose wisely as the project might still be around when the peak times of the language or framework is long gone. Choosing the language might be as important as choosing a partner for life, you have to spend a lot of time together, go through crisis, and there will be moments where you don't understand each other. Choose JS if you are young and wild, choose Java for something steady ...

Let's assume I made all the choices above and I chose language X and framework Y to build my latest web application. I created the repo and did the git clone (or added the remote), called y initand am proudly looking on the first commit with message Init. Now the fun starts, and even if I am working only me on this project I need to setup everything as if...

Local dev #

  1. Add docker-compose.ymlfor local development
  2. Configure my IDE for this project and save workspace settings file (VSCode or IntelliJ), see as well for next step

Code Style #

  1. Adding .editorconfig is the start, need to make sure the code of the framework is correct and probably fix it with my second commit. This is the bare minimum for each repo and this format is well understood by all editors
  2. Second addition is code Linters (ESLint for JS and TS, Credo for Elixir, Stylelint for CSS, ...), keeps my code consistent

Testing #

  1. Setup up tests (hopefully it comes with the framework)
  2. Generate Test coverage

CI (Automation) #

  1. Using Github Actions, Gitlab Actions or CircleCi the configuration lives in the repo, which is a must for me.
  2. Setup basic build to run tests and linter (and validate Code Style), if possible with CodeClimate, Codacy or similar
  3. Setup Lighthouse CI to validate lighthouse on each PR, yes this can run Lighthouse on each PR before releasing
  4. Setup deployment to an environment (Netlify, Render, Digital Ocean, or one of the lesser know like AWS, Google Cloud or Azure...etc)

Once this is done the repo is ready to handle my code!

Top comments (0)