This document outlines the best practices, coding standards, and development processes to ensure high-quality software development within our organization.
- Getting Started
- Platform Setup
- Technology Stack
- Environment Configuration
- Database
- File Storage
- API Design
- Testing
- Project Structure
- Version Control & Git Practices
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?
Always use containerization for backend services:
- Create a
Dockerfilefor each service - Use
docker composefor 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:
- Local - Development environment
- Staging - Testing environment
- Production - Live environment
For APIs and server-side logic, we primarily use:
- Java with Spring Boot framework
- Go with Gin or Echo framework
- Use Java 17 or higher for Spring Boot applications
- Use Go 1.25 or higher for Go applications
- Store sensitive information such as database credentials and API keys in environment variables
- For development, use a
.envfile (ensure it's in.gitignore, and never commit it to version control)
- Use PostgreSQL 17 as the primary database
- Java applications: Use JPA/Hibernate
- Go applications: Use GORM
- Java: Use Liquibase for database migrations
- Go: Use go-migrate for database migrations
- Always create indexes on frequently queried columns to improve performance
- Always setup scheduled database backups
- For high traffic applications, schedule more frequent backups than low traffic applications
- Always use S3 compatible services for file storage
- Use pre-signed URLs for secure file uploads and downloads
- For local development, use MinIO as an S3 compatible service
- Java applications: Use the AWS SDK for Java
- Go applications: Use the AWS SDK for Go
- Follow RESTful principles for API design
- Implement proper error handling and return appropriate HTTP status codes
- Use OpenAPI/Swagger or other documentation tools for API documentation
- Java: Write unit tests using JUnit
- Go: Use Go's built-in testing package
Follow a clean and organized folder structure for your projects:
Java (Spring Boot):
- Use the standard
src/main/java,src/main/resources, andsrc/test/javadirectories
Go:
- Follow the standard Go project layout
- Separate business logic, data access, and controllers into different packages/modules
Always use a .gitignore file to exclude unnecessary files from version control.
Common entries include:
target/orbuild/directories.envfiles- IDE-specific files (e.g.,
.idea/,.vscode/) - Log files
- Use Git for version control
- Create branches for new features and bug fixes
- Name branches descriptively, e.g.,
feature/user-authenticationorbugfix/login-issue - Or copy the branch name from the Github Project board task under development section
- Regularly commit changes with meaningful commit messages
- Follow a consistent commit message format, such as Conventional Commits