Skip to content

Guidelines for configuring a project with the best standards of the internet.

Notifications You must be signed in to change notification settings

andersoncontreira/projects-guidelines

Repository files navigation

Projects Guidelines (Work In Progress...)

Guidelines for configuring a project with the best standards of the internet.

List of guidelines in different languages:

Objective

Define a standard for our projects to facilitate their identification, comprehension and execution of it.

Basic components of a project

In this section we present an overview of the components expected in an architecture that follows the guidelines standard.

Diagram

Componentes de um projeto

Github - Templates

Include standardized templates for:

  • Pull Request
    • pull_request_template.md
  • Issues
    • Bug Report
      • bug_report.md
      • bug_report.yml
    • Config
      • config.yml
    • Documentation Request
      • documentation_request.md
      • documentation_request.yml
    • Feature Request
      • feature_request.md
      • feature_request.yml

Examples

To view examples of these files click in the links bellow:

Github - Workflows

A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.

Workflow suggestions:

  • Lint
    • A linter or lint refers to tools that analyze source code for programming errors, bugs, stylistic errors, and suspicious builds.
  • Unit Test
    • A unit test exercises the smallest piece of testable software in the application to determine whether it behaves as expected.
  • Component Test
    • A component test limits the scope of the exercised software to a portion of the system under test, manipulating the system through internal code interfaces and using test doubles to isolate the code under test from other components. .
  • Sonar
    • Code analysis tool to check code quality, duplicate code, vulnerabilities and bugs.
  • Versioning
    • Perform project versioning following the SemVer standard;
  • Guidelines
    • Validates whether the project is following the guidelines definitions;

Examples

To view examples of these files click in the links bellow:

References

Github - Documentation

The project must have some files that help the user to understand the project, be able to install and run it, in addition to being able to obtain other information about it, using the respective files as a guide for the project evolution process.

List of the files:

  • README.md
    • You should add a README file to your repository to let others know why your project is useful, what they can do with the project, and how they can use it
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE.md
    • For your repository to truly be open source, you'll need to license it so that others are free to use, change, and distribute the software.

Examples

To view examples of these files click in the links bellow:

More details

Below we have a link with more detailed information on this approach.

Para mais detalhes acesse: GITHUB-DOCUMENTATION.md

References

Sonar

The settings of code quality validation can be used by SonarQube or SonarCloud.

The sonar-project.properties file should contain the following settings:

  • sonar.projectKey
    • Project key in SonarCloud platform or project name;
  • sonar.organization
    • Company name or code registered on SonarCloud;
  • sonar.source
    • Normally, a period (.) is used to refer to the root folder.
  • sonar.exclusions
    • Folders that do not have code created by developers or folders with files that are not relevant for analysis, e.g. configuration files, docker files, node modules.
  • sonar.tests
    • Folder containing all tests scripts;
  • sonar.tests.inclusions
    • Pattern to identify test files;
  • sonar.{linguagem} .coverage.reportPaths
    • Location of project coverage reports;
    • Clover pattern;
  • sonar.junit.reportsPath
    • Location of project coverage reports;
    • JUnit patter;

Examples

To view examples of these files click in the links bellow:

OpenApi/Swagger

Files for dynamic API configuration.

Diagram

Swagger

Schemas

A documentar

Routes

A documentar

UI

A documentar

Examples

To view examples of these files click in the links bellow:

Referência para a documentação de rotas

The material that can be used to generate the inline documentation can be found here: https://swagger.io/specification/;

More details

Below we have a link with more detailed information on this approach.

Para mais detalhes acesse: SWAGGER-DOCUMENTATION.md

RESTful e HATEOS

When the project is an API, it is desirable that it implements the definitions of the RESTful standard. Even better if you can apply HATEOS concepts.

Diagram

RESTful-HATEOS

More details

Below we have a link with more detailed information on this approach.

Para mais detalhes acesse: RESTFUL-HATEOS-DOCUMENTATION.md

References

Docker

Configuration of docker files for the project.

Docker files must be in the docker folder, being organized by context, examples:

  • docker/
    • php/
      • Dockerfile
      • entrypoint.sh
    • nginx/
      • logs/*
      • Dockerfile
      • app.conf
      • nginx.conf
    • python/
      • Dockerfile
      • entrypoint.sh

dockerignore

File with the references of folders and files that should be ignored by docker during copying of the project folder's contents.

docker-compose.yml

File with settings for managing containers in the development environment.

More details

Below we have a link with more detailed information on this approach.

Para mais detalhes acesse: DOCKER-DOCUMENTATION.md

Healthcheck

Quando o projeto for uma API, é requerido que o mesmo implemente um endpoint de healthcheck, é recomendado que o projeto aplique o padrão definido da documentação da guideline, para que o mesmo seja um endpoint inteligente.

Diagram

Healthcheck

More details

Below we have a link with more detailed information on this approach.

Para mais detalhes acesse: HEALTHCHECK-DOCUMENTATION.md

References

Testes

Description of the folder structure and concepts.

Diagram

Tests

Unit Tests

  • Tests that use mocks to avoid real connections to external components;
  • Tests focused on functionality and not on the data itself;
  • Tests to run in CI pipelines;
  • The duration of these tests should be a maximum of 1s per file, ideally running in milliseconds;

Integration tests

  • Tests that should not run fixtures or feature changes to avoid problems;
  • Tests focused on the integration of external components with the application in question;
  • Tests to run in CD pipelines;
  • The duration of these will depend on the scenarios developed, however, it is recommended to create objective tests so that the pipeline does not take too long;

Component Tests

  • Base tests for the TDD process;
  • Tests focused on the behavior, scenarios and data of the project process;
  • Tests to be executed locally in a docker suite that will provide local access to resources such as databases and the like;
  • The duration of these will depend on the scenarios developed, but the idea of these tests is to explore several possible scenarios;

More details

Below we have a link with more detailed information on this approach.

Para mais detalhes acesse: TEST-DOCUMENTATION.md

References

Serverless

WIP

Editorconfig

WIP

Terraform

WIP

Pipeline (CI/CD)

WIP

Automation Scripts

WIP

VSCode settings

WIP

Environment Configurations

WIP

Binaries folder

WIP

Git

Specific settings for the git project.

gitignore

File with the references of folders and files that should be ignored by git during development from the project.

Metadata files

WIP

About

Guidelines for configuring a project with the best standards of the internet.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages