Skip to content

Latest commit

 

History

History
165 lines (111 loc) · 4.46 KB

File metadata and controls

165 lines (111 loc) · 4.46 KB

Alievs Space MMC Backend Developer Guidelines

This document outlines the best practices, coding standards, and development processes to ensure high-quality software development within our organization.


Table of Contents


Getting Started

Before starting development, ensure that you have a clear understanding of the requirements and architecture. Create design documents if necessary.

Key Questions to Answer:

  • Is this API going for production or is it just for internal use?
  • What are the expected load and performance requirements?
  • What technologies and frameworks will be used?
  • What are the security considerations?

Platform Setup

Always use containerization for backend services:

  • Create a Dockerfile for each service
  • Use docker compose for local development

Environment Strategy:

Always set up a local development environment that mirrors the production environment as closely as possible. And setup staging environment for testing before deploying to production.

The three required environments are:

  1. Local - Development environment
  2. Staging - Testing environment
  3. Production - Live environment

Technology Stack

For APIs and server-side logic, we primarily use:

  • Java with Spring Boot framework
  • Go with Gin or Echo framework

Environment Configuration

Runtime Versions

  • Use Java 17 or higher for Spring Boot applications
  • Use Go 1.25 or higher for Go applications

Environment Variables

  • Store sensitive information such as database credentials and API keys in environment variables
  • For development, use a .env file (ensure it's in .gitignore, and never commit it to version control)

Database

Primary Database

  • Use PostgreSQL 17 as the primary database

ORM Tools

  • Java applications: Use JPA/Hibernate
  • Go applications: Use GORM

Migration Best Practices

  • Java: Use Liquibase for database migrations
  • Go: Use go-migrate for database migrations

Performance Optimization

  • Always create indexes on frequently queried columns to improve performance

Backup Strategy

  • Always setup scheduled database backups
  • For high traffic applications, schedule more frequent backups than low traffic applications

File Storage

Storage Service

  • Always use S3 compatible services for file storage
  • Use pre-signed URLs for secure file uploads and downloads

Local Development

  • For local development, use MinIO as an S3 compatible service

SDK Usage

  • Java applications: Use the AWS SDK for Java
  • Go applications: Use the AWS SDK for Go

API Design

REST Principles

  • Follow RESTful principles for API design
  • Implement proper error handling and return appropriate HTTP status codes

Documentation

  • Use OpenAPI/Swagger or other documentation tools for API documentation

Testing

Unit Testing

  • Java: Write unit tests using JUnit
  • Go: Use Go's built-in testing package

Project Structure

Folder Organization

Follow a clean and organized folder structure for your projects:

Java (Spring Boot):

  • Use the standard src/main/java, src/main/resources, and src/test/java directories

Go:

  • Follow the standard Go project layout

Code Organization

  • Separate business logic, data access, and controllers into different packages/modules

.gitignore

Always use a .gitignore file to exclude unnecessary files from version control.

Common entries include:

  • target/ or build/ directories
  • .env files
  • IDE-specific files (e.g., .idea/, .vscode/)
  • Log files

Version Control & Git Practices

Version Control System

  • Use Git for version control

Branching Strategy

  • Create branches for new features and bug fixes
  • Name branches descriptively, e.g., feature/user-authentication or bugfix/login-issue
  • Or copy the branch name from the Github Project board task under development section

Commit Practices

  • Regularly commit changes with meaningful commit messages
  • Follow a consistent commit message format, such as Conventional Commits