How samit22/calendarn works
Project type and purpose
• CalendarN is a Go-based CLI utility that exposes several commands (nep, eng, today, countdown, convert) for calendar generation, date conversion, and countdown management.
• It is not a full-stack web app but rather a single binary that parses CLI input, invokes business logic modules, and writes results to stdout (or persists countdowns).
File structure
• Top-level:
• main.go: entry point
• cmd/: command definitions and tests (each subcommand is implemented as a Cobra command)
• countdown/: core countdown logic (create, list, show, delete, run)
• dateconv/: date conversion utilities and models
• data/: static data definitions (e.g., English month/day names)
• calerr/: custom error types
• logger/: simple logging wrapper
• cmd/*.go + cmd/*_test.go: per-command code/tests
• Supporting files:
• Makefile, .github workflows → CI/CD
• sonar-project.properties → code-quality integration
• go.mod/go.sum → dependency management
README for insights
• Lists available CLI commands, flags, and intended behavior (Nepali/English calendars, date converter, today's date, countdown tool).
• Emphasizes unit-test coverage and Go 1.18+.
Detailed breakdown of components
• CLI Parser (root.go + const.go)
• Subcommands (cdlist, cdshowdel, convert, countdown, englishcal, nepcal, today, version)
• countdown package (Save, Load, Run, List, Delete)
• dateconv package (Converter, Utils, Model)
• data package (static month/day data)
• calerr (custom error types)
• logger (LogInfo, LogError)
• Persistence (local file under ~/.calendarN/countdowns.json or similar)
Final Advice
• Blue = CLI & command dispatch
• Green = Business logic modules
• Orange = Persistence
• Grey = Shared utilities