-
Notifications
You must be signed in to change notification settings - Fork 1
CONTRIBUTING
Divyansh jamwal edited this page Jun 22, 2026
·
1 revision
Thank you for contributing to CMS Web! To maintain code quality and ensure a smooth development process, please adhere to the following guidelines.
-
Create a Branch: Create a descriptive feature branch from
main:git checkout -b feat/your-feature-name
- Implement Changes: Ensure your changes are modular and contain appropriate comments. Avoid unrelated refactorings.
-
Run Tests: Always run backend tests locally to verify no regressions were introduced:
go test -v ./test/... -
Commit & Push: Commit with concise messages conforming to conventional commits (e.g.
feat: add ...,fix: resolve ...):git add . git commit -m "feat: add user profile page" git push origin feat/your-feature-name
-
Pull Request: Open a pull request against the
mainbranch. Provide a comprehensive summary of your changes.
-
GORM Models: When creating or modifying database schemas, verify relationships and validation tags (e.g.,
binding:"required",gorm:"not null"). -
Endpoints: Add routes to their designated category in the
routes/package. -
Error Handling: Follow idiomatic Go patterns. Return clear JSON error payloads with relevant HTTP statuses:
-
400 Bad Requestfor invalid input parameters/schemas. -
401 Unauthorized/403 Forbiddenfor failed authentication/authorization checks. -
404 Not Foundwhen GORM queries returngorm.ErrRecordNotFound. -
500 Internal Server Errorfor database failures.
-
-
TypeScript: Define explicit types/interfaces for state, props, and API response schemas. Avoid using
anywhenever possible. - Styling: Maintain vanilla CSS conventions and structure styles clearly within component directories.