mirror of
https://github.com/cassandra/home-information.git
synced 2026-04-17 21:19:45 -04:00
* Working on improving AI agent docs. * Update dev/docs and claude agent configs. * Updated claude commands.
3.7 KiB
3.7 KiB
Project Structure
Directory Structure
Top-level Directory
src: application source codedeploy: helper scripts and files for deploying and setting up the applicationpackage: extra items that need to be packaged up to support running the application in DockerMakefile: provides convenience wrappers around commands for building, packaging and runningdocs: all documentation suitable to be in markdown files
The src Directory
hi: entry point urls/views and some app-wide helper classeshi/apps/${APPNAME}: For normal application moduleshi/environment: Environment definitions for client (Javascript) and server (Python)hi/integrations: Code for dealing with integration not related to a specific integrationhi/services/${SERVICENAME}: Code for a particular integrationhi/simulator: The code for the separate simulator helper apphi/settings: Django settings, including runtime population from environment variableshi/static: Static files for Javascript, CSS, IMG, etc.hi/templates: For top-level views and app-wide common base templateshi/testing: Test-specific code not used in productionhi/requirements: Python package dependenciescustom: Custom user model and other general customizationsbin: Helper scripts needed with the code to run inside a Docker container
Module Structure
All new files should adhere to these naming and directory organization conventions.
Application Module Structure
Filenames: Django Conventions:
admin.py: Django standard for Django admin modelsapps.py: Django standard for app metadata and initializationsmigrations.py: Django standard for migrationsmodels.py: Django standard for database ORM modelsurls.py: Django standard for urlsviews.py: Django standard for views
Filenames: App Conventions:
constants.py: For shared constantscontext_processors.py: For new Django context processorsdecorators.py: For Django decoratorsenums.py: For all enums relevant to this moduleforms.py: For Django formsmiddleware.py: Django standard for middlewaresignals.py: For new Django signal definitionstransient_models.py: For non-DB, in-memory container models with little business logic in themview_mixins.py: For view helpers that use HttpRequest/HttpResponse
Filenames: Reserved for Auto-discovery Mechanisms:
monitors.py: For auto-discovered background monitor tasksservices/{app_name}/integration.py: For auto-discovered integrations (only inhi.services)settings.py: For auto-discovered user-configuration options
Filename Patterns:
*_data.py: For larger in-memory data classes needing their own module*_helpers.py: For general helpers with micellaneous responsibilities*_manager.py: For central control module, usually extending Singleton
Directories: Django Conventions:
management/commands: Django standard for managemtn commandstemplates: Django standard for templatestemplatetags: Django standard for defining template tags
Directories: App Conventions:
assets: For non-code files and data that business logic depends on.edit: For views and features that only apply to the apps editing modetemplates/tests/ui: Templates supporting the UI testing and devtools viewstemplates/{app_name}/modals: Templates for modal dialogstemplates/{app_name}/pages: Templates representing and entire HTML page or sub-pagetemplates/{app_name}/panes: Templates representing an HTML fragmenttests/data: Non-code data supporting teststests/ui: For develoment-only UI tests and development tools (urls.py auto-discovered)tests: All module-specifc tests go here