This document explains the directory structure and organization of the FoxCloud project.
.
├── .github/ # GitHub-specific files
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ └── workflows/ # GitHub Actions workflows
├── dist/ # Built output (generated)
├── docs/ # Documentation files
├── scripts/ # Utility scripts
├── src/ # Source code
└── tests/ # Test files
Contains constant definitions used throughout the application.
protocol.ts- VLESS protocol constants and definitions
Core application logic and main entry points.
handler.ts- Main request handler for HTTP and WebSocket requestsindex.ts- Core module exportstypes.ts- TypeScript type definitions
Network-related functionality and protocols.
dns.ts- DNS resolution utilitiestcp.ts- TCP connection utilitieswebsocket.ts- WebSocket handling for proxy connections
HTML page templates and UI components.
index.ts- Main page templates (landing page, error page, subscription page)
Protocol-specific implementations (currently empty but reserved for future expansion).
index.ts- Protocol module exports
Business logic and service layer components.
subscription.ts- Subscription configuration generation
Test files for verifying application functionality.
architecture.test.js- Architecture verification tests
Utility functions and helper modules.
array.ts- Array manipulation utilitiesarray.js- JavaScript version for testinghelpers.ts- General helper functions
package.json- Node.js package configurationpackage-lock.json- Dependency lock filetsconfig.json- TypeScript configurationeslint.config.mjs- ESLint configurationrolldown.config.js- Build configurationwrangler.toml- Cloudflare Workers configurationwrangler.example.toml- Example configuration template
.github/ISSUE_TEMPLATE/- GitHub issue templates.github/PULL_REQUEST_TEMPLATE.md- Pull request template.github/workflows/- GitHub Actions workflows
README.md- Main project documentationCONTRIBUTING.md- Contribution guidelinesLICENSE- License informationCHANGELOG.md- Version historyCODE_OF_CONDUCT.md- Community guidelinesSECURITY.md- Security policydocs/- Detailed documentation files
docs/- Documentation files- Images and diagrams for documentation
scripts/- Utility scriptsgenerate-uuid.js- UUID generation utility
dist/- Built output (generated during build process)worker.js- Built Cloudflare Worker
- Generated during testing (no persistent test output directory)
.gitignore- Git ignore patterns.wrangler/- Wrangler development cache (gitignored)
The project is organized into modules by functionality:
- Each module has a single responsibility
- Modules are loosely coupled
- Clear separation between core logic and UI
- Business logic is separated from presentation
- Configuration is separated from code
- Tests are separated from source code
- Standard directory structure
- Consistent naming conventions
- Predictable file organization
- Protocol directory for future protocol support
- Services directory for business logic
- Utilities directory for reusable functions
This structure allows for easy navigation, maintenance, and extension of the FoxCloud project.