π Development Guidelines¶
This document outlines the standard development practices at Darukaa to ensure high-quality, scalable, and secure code across all teams and projects.
π Project Structure¶
-
Keep a clean and consistent folder structure across repositories (especially FE and BE).
-
Organize code by domain or feature, not by type.
src/
βββ components/
βββ pages/
βββ hooks/
βββ services/
βββ utils/
- Prefer co-locating tests with the components they test.
π§Ό Code Style & Linting¶
-
Use Prettier + ESLint for JavaScript/TypeScript code.
-
Use
blackorrufffor Python code. -
Code should always pass lint checks before committing.
- Enable pre-commit hooks in your local setup.
Naming Conventions¶
| Entity | Convention | Example |
| --------- | ------------- | -------------------------------- |
| Variables | camelCase | userName, isLoading |
| Functions | camelCase | getUserData() |
| Classes | PascalCase | UserProfile, ApiClient |
| Constants | UPPER_SNAKE | MAX_RETRY_COUNT |
| Files | kebab-case | user-card.tsx, api-client.py |
β Git Commit Messages¶
-
Use the Conventional Commits format:
-
feat: add support for new onboarding flow
-
fix: resolve crash on mobile view
-
chore: update eslint config
π³ Branching Strategy¶
- Always branch off from main or dev.
- Use descriptive names:
-
feature/add-payment-button
-
bugfix/invalid-token-error
-
hotfix/deployment-crash
π Environment Configuration¶
-
Use .env files locally (do not commit them)
-
All sensitive config values should be managed through:
-
GitHub Secrets (for GitHub Actions)
-
GCP Secret Manager (for deployments)
-
Maintain sample .env.example in each repo.
π§ͺ Testing¶
-
Write unit tests for logic-heavy modules.
-
Use mocks/stubs for external services.
-
Follow TDD for new critical components.
-
Recommended tools:
-
Frontend: Jest, React Testing Library
-
Backend: Pytest, unittest
-
Minimum test coverage (as of now): 70%
π‘οΈ Security Best Practices¶
-
Never log secrets or tokens
-
Sanitize all user inputs (backend)
-
Escape HTML in frontend views
-
Use HTTPS APIs only
-
Keep third-party dependencies up to date
ποΈ Documentation¶
-
Every new feature or module must include:
-
README (if applicable)
-
API signature or interface
-
Inline code comments for non-trivial logic
-
Update internal docs (internal-doc/) if architecture or process changes.
π« Anti-Patterns¶
-
Avoid the following:
-
Deeply nested logic blocks (> 3 levels)
-
Hardcoded URLs or API tokens
-
Committing .env, .DS_Store, or build folders
-
Using any in TypeScript unless strictly necessary
-
Global state for local component data
β Done Means Done¶
A task is considered done only if:
-
Code is committed and pushed to a feature branch
-
Code is reviewed and merged
-
Tests pass in CI
-
Staging is tested (for features)
-
Documentation is updated
-
Task is marked complete in the board
-
Consistency beats cleverness. Letβs keep it clean and readable π