The perfect repository (WebApplication)
Tags: repository, scratch, setup
Published: 2021-02-16 21:56:17

---
title: The perfect repository (WebApplication)
published: true
date: 2021-02-16 00:00:00 UTC
tags: 
   - repository
   - scratch
   - setup
canonical_url: https://littleiffel.net/posts/the-perfect-repository/
---

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](https://gitlab.com/), [github](https://github.com/) or [sourcehut](https://sourcehut.org/)... 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 init`and 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 [#](https://littleiffel.net/posts/the-perfect-repository/#local-dev)

1. Add `docker-compose.yml`for 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 [#](https://littleiffel.net/posts/the-perfect-repository/#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](https://eslint.org/) for JS and TS, [Credo](https://github.com/rrrene/credo) for Elixir, [Stylelint](https://github.com/stylelint/stylelint) for CSS, ...), keeps my code consistent

### Testing [#](https://littleiffel.net/posts/the-perfect-repository/#testing)

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

### CI (Automation) [#](https://littleiffel.net/posts/the-perfect-repository/#ci-(automation))

1. Using Github Actions, Gitlab Actions or [CircleCi](https://circleci.com/) 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](https://codeclimate.com/), [Codacy](https://www.codacy.com/) or similar
3. Setup [Lighthouse CI](https://github.com/GoogleChrome/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](https://www.netlify.com/), [Render](https://render.com/), [Digital Ocean](https://www.digitalocean.com/), 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!