{"id":17474034,"url":"https://github.com/ispyhumanfly/flight","last_synced_at":"2025-08-09T17:20:53.444Z","repository":{"id":217374034,"uuid":"743633090","full_name":"ispyhumanfly/flight","owner":"ispyhumanfly","description":"Flight is a modern, high-performance web application server built on Node.js, designed for building scalable, component-driven applications.","archived":false,"fork":false,"pushed_at":"2025-07-28T13:13:40.000Z","size":498,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-04T15:56:13.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ispyhumanfly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-15T16:46:52.000Z","updated_at":"2025-07-28T13:13:45.000Z","dependencies_parsed_at":"2024-07-08T02:29:14.870Z","dependency_job_id":"7e3075dd-8da5-4e53-994e-3cda21b3670f","html_url":"https://github.com/ispyhumanfly/flight","commit_stats":null,"previous_names":["bartonmalow/flight","ispyhumanfly/flight"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ispyhumanfly/flight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispyhumanfly%2Fflight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispyhumanfly%2Fflight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispyhumanfly%2Fflight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispyhumanfly%2Fflight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ispyhumanfly","download_url":"https://codeload.github.com/ispyhumanfly/flight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispyhumanfly%2Fflight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269606741,"owners_count":24446256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T18:08:10.966Z","updated_at":"2025-08-09T17:20:53.421Z","avatar_url":"https://github.com/ispyhumanfly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flight\n\nFlight is a modern, high-performance web application server built on Node.js, designed for building scalable, component-driven applications. It represents the evolution of the [Avian](https://github.com/ispyhumanfly/avian) component application server, incorporating modern best practices and improved developer experience.\n\n## Overview\n\nFlight takes the best concepts from Avian and enhances them with modern tooling and practices. It provides a robust foundation for building enterprise-grade applications while maintaining simplicity and developer productivity.\n\n### Key Features\n\n- **Modern Stack**: Built on Koa.js with TypeScript support\n- **Component-Based Architecture**: Organize your application into reusable components\n- **Built-in Development Server**: Powered by Vite for lightning-fast development\n- **Production-Ready**: Includes rate limiting, compression, and caching out of the box\n- **Cluster Mode**: Automatic load balancing across CPU cores\n- **Redis Integration**: Built-in support for session management and caching\n- **TypeScript First**: Native TypeScript support throughout the framework\n- **Hot Module Replacement**: Fast development with instant updates\n- **CORS Enabled**: Ready for modern web applications\n- **Security Features**: Rate limiting, secure session handling, and more\n\n## Installation\n\n```bash\nnpm install @spytech/flight\n# or\nyarn add @spytech/flight\n```\n\n## Quick Start\n\n1. Create a new project directory and initialize:\n```bash\nmkdir my-flight-app\ncd my-flight-app\nnpm init -y\n```\n\n2. Install Flight and its dependencies:\n```bash\nnpm install @spytech/flight ioredis\n```\n\n3. Ensure Redis is running locally or set environment variables:\n```bash\n# Default values shown below\nexport FLIGHT_REDIS_HOST=localhost\nexport FLIGHT_REDIS_PORT=6379\n```\n\n4. Create a component with a backend route:\n```bash\nmkdir -p components/hello\n```\n\nCreate `components/hello/hello.backend.ts`:\n```typescript\nimport Router from '@koa/router';\n\nconst router = new Router();\n\nrouter.get('/hello', async (ctx) =\u003e {\n    ctx.body = { message: 'Hello from Flight!' };\n});\n\nexport default router.routes();\n```\n\n5. Start the server:\n\nDevelopment mode:\n```bash\nnode flight.js --mode development --app_home .\n# Starts development server on port 3001 with HMR\n# Backend API available on port 3000\n```\n\nProduction mode:\n```bash\nnode flight.js --mode production --app_home .\n# Builds and serves application on port 3000\n```\n\nAvailable CLI options:\n- `--app_home`: Application root directory (default: current directory)\n- `--app_key`: Application key for sessions (default: 'flightApp')\n- `--app_secret`: Secret key for session encryption (default: 'the best secret key in the world')\n- `--mode`: 'development' or 'production' (default: 'production')\n\n## Project Structure\n\n```\nmy-app/\n├── components/           # Application components\n│   ├── Hello/   # Component directory\n│   │   ├── Hello.vue    # Vue component view\n│   │   └── Hello.backend.ts  # Backend routes and logic\n├── assets/              # Static assets\n├── dist/                # Production build output\n└── package.json\n```\n\nEach component follows a simple structure:\n- `Index.vue`: Contains the Vue component template, script, and styles\n- `Index.backend.ts`: Contains the backend routes and logic for the component\n\nExample component files:\n\n`components/hello/Index.vue`:\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003ch1\u003e{{ message }}\u003c/h1\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript setup lang=\"ts\"\u003e\nimport { ref } from 'vue'\n\nconst message = ref('Hello from Flight!')\n\u003c/script\u003e\n```\n\n`components/hello/Index.backend.ts`:\n```typescript\nimport Router from '@koa/router';\n\nconst router = new Router();\n\nrouter.get('/hello', async (ctx) =\u003e {\n    ctx.body = { message: 'Hello from Flight!' };\n});\n\nexport default router.routes();\n```\n\n## Configuration\n\nFlight can be configured through environment variables or command-line arguments:\n\n```bash\nFLIGHT_MODE=development\nFLIGHT_REDIS_HOST=localhost\nFLIGHT_REDIS_PORT=6379\nFLIGHT_MAX_WORKERS=4\n```\n\n## Development Mode\n\nIn development mode, Flight provides:\n- Hot Module Replacement (HMR)\n- Fast refresh for React components\n- Detailed error messages\n- Development server on port 3001\n\n## Production Mode\n\nProduction mode includes:\n- Optimized builds\n- Rate limiting\n- Response compression\n- Redis caching\n- Cluster mode for load balancing\n- Production server on port 3000\n\n## Comparison with Avian\n\nFlight is a modern reimagining of the Avian framework, making several architectural improvements while maintaining the core philosophy of component-driven applications. Here are the key differences:\n\n### Framework Evolution\n- **Koa Instead of Express**: Flight uses Koa.js as its foundation instead of Express, providing better async/await support and a more modern middleware architecture\n- **Vite Instead of Webpack**: Replaced Webpack bundling with Vite for significantly faster development experience and simpler configuration\n- **TypeScript First**: While Avian supported TypeScript, Flight is built with TypeScript from the ground up\n\n### Architectural Improvements\n1. **Simplified Component Structure**\n   - Avian: Complex component hierarchy with multiple file types (.client, .server, .view, .config)\n   - Flight: Streamlined with `.backend.ts` files and modern frontend frameworks\n   \n2. **Development Experience**\n   - Avian: Webpack-based bundling with slower rebuild times\n   - Flight: Vite-powered development with instant HMR and no bundle step in development\n\n3. **Session Management**\n   - Avian: Express-session with Redis store\n   - Flight: Koa-session with Redis store, improved security defaults\n\n4. **Performance Features**\n   - Built-in rate limiting\n   - Redis-based caching\n   - Automatic compression in production\n   - Cluster mode for CPU utilization\n\n5. **Configuration**\n   - Avian: Complex webpack configuration and multiple build modes\n   - Flight: Simplified configuration with sensible defaults and Vite's zero-config approach\n\n### What's Different\n\n1. **Removed Features**\n   - Removed Webpack-specific configurations\n   - Removed legacy view engine support (EJS, Twig, Pug)\n   - Removed Sentry integration (can be added as middleware if needed)\n   - Removed built-in cron job scheduler (better handled by dedicated services)\n\n2. **New Features**\n   - Native ESM support\n   - Built-in CORS support\n   - Improved Redis integration\n   - Better security defaults\n   - Simpler API for backend routes\n   - Modern frontend tooling support\n\n3. **Simplified Architecture**\n   - Reduced configuration complexity\n   - More intuitive component organization\n   - Better separation of concerns\n   - Modern middleware approach\n\n### Migration from Avian\n\nIf you're migrating from Avian, the main changes you'll need to make are:\n\n1. Update your component structure to use `.backend.ts` files\n2. Move from Express middleware to Koa middleware\n3. Update your frontend bundling to use Vite\n4. Adapt to the new session management system\n5. Update your static file serving configuration\n\n## Requirements\n\n- Node.js 16.x or higher\n- Redis server\n- TypeScript 4.x or higher\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Acknowledgments\n\nFlight is built upon the solid foundation laid by the [Avian](https://github.com/ispyhumanfly/avian) framework, created by FlyPaper Technologies, LLC. We're grateful for their pioneering work in component-driven architecture.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fispyhumanfly%2Fflight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fispyhumanfly%2Fflight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fispyhumanfly%2Fflight/lists"}