Web πŸ•Έ

Hero image for Web πŸ•Έ

Project Structure

We generally use battle-tested-and-proven Web frameworks to build applications. However, not all frameworks provide a standardized project structure. For the latter, refer to the general conventions to structure a project.

Frameworks

Refer to the following existing guides and project templates for the main Web frameworks we use:

Project structure in a Phoenix application

Project structure in a Ruby on Rails application

For other frameworks, refer to the official documentation and follow the community guidelines.

General Conventions

The following structure and directories must be followed unless specified otherwise by a framework:

project-name-web
β”œβ”€ config/
β”œβ”€ lib/
β”‚  β”œβ”€ controllers/
β”‚  β”œβ”€ decorators/
β”‚  β”œβ”€ forms/
β”‚  β”œβ”€ helpers/
β”‚  β”œβ”€ models/
β”‚  β”œβ”€ presenters/
β”‚  β”œβ”€ repositories/
β”‚  β”œβ”€ serializers/
β”‚  β”œβ”€ services/
β”‚  └─ views/
β”œβ”€ tests/
β”œβ”€ .env
β”œβ”€ .env.dev
β”œβ”€ .env.example
β”œβ”€ .env.test
β”œβ”€ docker-compose.dev.yml
β”œβ”€ docker-compose.test.yml
β”œβ”€ Dockerfile
└─ Makefile
└─ README.md
  • config: static and dynamic configuration and initialization logic.
  • lib: domain logic and presentation layer for the whole application. The sub-directories are self-explanatory.
  • tests: the test suite and its configuration.
  • .env.*: use dotenv to set environment variables in development and test environments.
  • Makefile: use a Makefile to define executable CLI scripts.

Development Environment

Code Editor

No specific editor is enforced at the team level. Web developers can pick what they are comfortable with but also what does not hinder their productivity.

The following options are the most widely used:

  • JetBrain’s IDEs such as RubyMine and GoLand.
  • Visual Studio Code.
  • Vim.

Tools

The following tools are required for all Web projects:

  • Docker Desktop and Docker Compose are required to run Web applications locally. Instead of running databases - such as PostgreSQL, Redis but also ElasticSearch - directly on the host machine, these dependencies run in isolation in local containers.
  • A GUI tool such as pgAdmin or Postico to interact visually with PostgreSQL databases.
  • A powerful terminal replacement such as iTerm.

Version Managers

Due to the diversity of projects the team works on, each application usually requires different versions of programming languages. Versions managers allow to install and switch between different versions effortlessly.

The following version managers are required:

  • rvm is the preferred version manager for Ruby.
  • nvm is the preferred version manager for Node JS and NPM.
  • asdf is the preferred version manager for Go and Elixir.