Skip to content

Refactor: Organize root directory structure for better maintainability #41

Description

@rafamiziara

Summary

Reorganize the root directory structure to follow monorepo best practices and improve maintainability.

Current Issues

  • Configuration files scattered across root directory
  • Development scripts mixed with business logic
  • Documentation files cluttering root level
  • Generated/temporary files in version control
  • Shared utilities buried in package-specific folders

Proposed Structure

/
├── README.md              # Project overview
├── CLAUDE.md             # Development guidance  
├── LICENSE               # License file
├── package.json          # Root package config
├── pnpm-lock.yaml        # Lock file
├── pnpm-workspace.yaml   # Workspace config
├── tsconfig.json         # TypeScript config
├── .nycrc.json          # Coverage config (stays at root)
├── .eslintrc.cjs        # ESLint config (stays at root)
├── apps/                 # Applications
├── packages/             # Shared packages
├── coverage/             # Test coverage reports
├── docs/                 # 📁 NEW: All documentation
├── config/               # 📁 NEW: Configuration files  
└── scripts/              # 📁 NEW: Shared development scripts

Changes Included

Move to /docs/

  • ROADMAP.mddocs/ROADMAP.md
  • SPRINT_1_IMPLEMENTATION.mddocs/SPRINT_1_IMPLEMENTATION.md
  • SPRINT_PLAN.mddocs/SPRINT_PLAN.md

Move to /config/

  • firebase.jsonconfig/firebase.json
  • .firebasercconfig/.firebaserc
  • firestore.indexes.jsonconfig/firestore.indexes.json
  • firestore.rulesconfig/firestore.rules
  • tsconfig.dev.jsonconfig/tsconfig.dev.json
  • ngrok.yml.templateconfig/ngrok.yml.template

Move to /scripts/

  • dev-start.jsscripts/dev-start.js
  • packages/backend/scripts/generateKey.tsscripts/generateKey.ts
  • packages/backend/scripts/signMessage.tsscripts/signMessage.ts

Package.json Updates

  • Update Firebase commands to use --config-dir ./config
  • Update dev script to use scripts/dev-start.js
  • Update backend scripts to reference ../../scripts/

Security Improvements

  • Add development keys to .gitignore
  • Remove generated files from tracking
  • Clean up temporary files

Benefits

Professional Structure - Follows industry monorepo best practices
Clear Separation - Configuration, documentation, and scripts organized
Shared Utilities - Development tools accessible across all packages
Cleaner Root - Only essential files at root level
Better Security - Proper gitignore for sensitive files
Easier Maintenance - Logical grouping makes navigation intuitive

Testing Checklist

  • pnpm dev starts development environment correctly
  • Firebase commands work with new config location
  • Backend generateKey and signMessage scripts function
  • All package builds and tests pass
  • Mobile app can find assets and configurations

Metadata

Metadata

Assignees

Labels

type: refactorImproving code structure without changing its external behavior

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions