Back to posts

Repository Naming Conventions Best Practices

gitdevopsbest-practicescollaboration

Repository Naming Conventions Best Practices

Repository Convention

Establishing clear and consistent naming conventions for repositories is essential for maintaining organization, enhancing collaboration, and improving code discoverability across development teams.

General Naming Rules

Format Guidelines

All repository names should follow these principles:

  • Lowercase only: Use lowercase letters throughout
  • Slug-case: Separate words with hyphens (-)
  • No special characters: Avoid underscores, dots, or spaces
  • Descriptive: Names should convey purpose at a glance

Naming Structure

The recommended pattern follows this structure:

{project}-{type}-{service-name}-{variant}

This format allows team members to quickly identify the repository’s purpose and its role within the larger project.


Backend Projects

Backend repositories can be categorized based on their purpose—either as a general API or as a microservice.

General Backend

PatternExampleUse Case
{project}-general-apiecommerce-general-apiNon-microservice backend applications

Microservice Backend

PatternExampleUse Case
{project}-service-{name}-apiecommerce-service-user-apiAPI for specific service
{project}-service-{name}-cronecommerce-service-user-cronScheduled tasks for service
{project}-service-{name}-workerecommerce-service-order-workerBackground job processor

Examples in practice:

ecommerce-service-user-api
ecommerce-service-payment-api
ecommerce-service-notification-cron
ecommerce-service-inventory-worker

Frontend Projects

Frontend repositories should clearly indicate they serve the web application layer.

PatternExampleUse Case
{project}-feecommerce-feMain frontend application
{project}-{service}-feecommerce-admin-feService-specific frontend
{project}-fe-{framework}ecommerce-fe-reactFramework-specific (if multiple)

Mobile Projects

Mobile repository names should specify the platform or framework being used.

PatternExampleUse Case
{project}-mobile-flutterecommerce-mobile-flutterFlutter cross-platform app
{project}-mobile-iosecommerce-mobile-iosNative iOS application
{project}-mobile-androidecommerce-mobile-androidNative Android application
{project}-mobile-rnecommerce-mobile-rnReact Native application

Desktop Projects

Desktop applications should indicate their development framework or technology.

PatternExampleUse Case
{project}-desktop-electronanalytics-desktop-electronElectron-based app
{project}-desktop-dotnetinventory-desktop-dotnet.NET desktop app
{project}-desktop-taurinotes-desktop-tauriTauri-based app

Fullstack Projects

Fullstack repositories combine both frontend and backend components.

PatternExampleUse Case
{project}-appblog-appMonolithic fullstack application
{project}-fullstackdashboard-fullstackCombined frontend + backend

Template Repositories

Template repositories serve as starter kits for various frameworks and technologies.

PatternExampleUse Case
{framework}-templatevue-templateFramework starter
{framework}-{type}-templatenestjs-api-templateSpecific type starter
{framework}-fullstack-templatelaravel-fullstack-templateComplete stack template

Popular examples:

nextjs-template
nestjs-api-template
fastapi-api-template
vue-admin-template
react-dashboard-template
laravel-fullstack-template

Infrastructure & DevOps

PatternExampleUse Case
{project}-infraecommerce-infraInfrastructure as Code
{project}-helm-chartsecommerce-helm-chartsKubernetes Helm charts
{project}-dockerecommerce-dockerDocker configurations
{project}-ciecommerce-ciCI/CD pipelines

Quick Reference Table

Project TypePatternExample
General API{project}-general-apimyapp-general-api
Microservice{project}-service-{name}-apimyapp-service-auth-api
Frontend{project}-femyapp-fe
Mobile{project}-mobile-{platform}myapp-mobile-flutter
Desktop{project}-desktop-{framework}myapp-desktop-electron
Fullstack{project}-appmyapp-app
Template{framework}-{type}-templatereact-admin-template
Infrastructure{project}-inframyapp-infra

Benefits of Standardized Naming

Adopting consistent naming conventions offers several advantages:

1. Clarity

Clear names help team members quickly identify the purpose and functionality of a repository, facilitating easier onboarding and collaboration.

2. Organization

A structured convention keeps repositories organized, especially in larger projects with multiple services.

3. Discoverability

Uniformity makes it easier for developers to search for and locate relevant repositories.

4. Efficiency

With clear names, developers spend less time figuring out project structures and more time writing code.

5. Automation

Consistent patterns enable automated tooling for CI/CD, documentation, and monitoring.


Implementation Tips

  1. Document your conventions: Create a CONTRIBUTING.md in your organization’s main repository
  2. Use repository templates: Set up templates that follow naming conventions
  3. Automate enforcement: Use GitHub/GitLab webhook or pre-commit hooks to validate names
  4. Review existing repos: Gradually rename legacy repositories to match conventions
  5. Team buy-in: Ensure all team members understand and agree to the conventions

By implementing these repository naming conventions, development teams can maintain a well-organized codebase that enhances collaboration, improves efficiency, and promotes better understanding across all members.