{"id":31625013,"url":"https://github.com/metecan/koa-typescript-starter","last_synced_at":"2026-04-17T13:32:36.793Z","repository":{"id":316796428,"uuid":"1064896960","full_name":"metecan/koa-typescript-starter","owner":"metecan","description":"A Simple Koa.js Typescript Starter","archived":false,"fork":false,"pushed_at":"2025-09-26T22:43:02.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-21T19:31:59.556Z","etag":null,"topics":["backend","koajs","starter","template","typescript"],"latest_commit_sha":null,"homepage":"https://koajs.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metecan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-26T18:13:11.000Z","updated_at":"2025-09-26T22:43:06.000Z","dependencies_parsed_at":"2025-09-26T20:12:35.532Z","dependency_job_id":null,"html_url":"https://github.com/metecan/koa-typescript-starter","commit_stats":null,"previous_names":["metecan/koa-typescript-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/metecan/koa-typescript-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metecan%2Fkoa-typescript-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metecan%2Fkoa-typescript-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metecan%2Fkoa-typescript-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metecan%2Fkoa-typescript-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metecan","download_url":"https://codeload.github.com/metecan/koa-typescript-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metecan%2Fkoa-typescript-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31931373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["backend","koajs","starter","template","typescript"],"created_at":"2025-10-06T18:55:21.229Z","updated_at":"2026-04-17T13:32:36.774Z","avatar_url":"https://github.com/metecan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koa.js + TypeScript Starter\n\nA modern, production-ready backend template built with Koa.js and TypeScript. This starter provides a solid foundation for building scalable web APIs with clean architecture and developer-friendly tooling.\n\n**Version:** 1.0.0\n\n## 🚀 Features\n\n- **Koa.js** - Fast, lightweight, and expressive web framework for Node.js\n- **TypeScript** - Full type safety and modern JavaScript features\n- **ESBuild** - Lightning-fast production bundling and compilation\n- **ts-node-dev** - Development server with TypeScript support and hot reload\n- **Path Aliases** - Clean imports with `@/` prefix\n- **Body Parser** - Built-in request body parsing with `@koa/bodyparser`\n- **Docker Support** - Production-ready containerization\n- **Structured Routing** - Modular and organized route management\n- **Custom Middleware** - Built-in logging middleware\n- **Environment Configuration** - Easy configuration management\n\n## 📁 Project Structure\n\n```\n├── src/\n│   ├── index.ts              # Application entry point\n│   ├── routes.ts             # Route definitions\n│   ├── lib/\n│   │   ├── config.ts         # Configuration management\n│   │   └── paths.ts          # API path definitions\n│   ├── middleware/\n│   │   └── logger.ts         # Custom logging middleware\n│   ├── modules/\n│   │   └── auth/\n│   │       └── auth.controller.ts  # Auth controller\n│   └── types/\n│       └── router.types.ts   # TypeScript type definitions\n├── build.ts                  # ESBuild configuration\n├── Dockerfile               # Docker configuration\n├── tsconfig.json            # TypeScript configuration\n└── package.json             # Dependencies and scripts\n```\n\n## 🛠️ Prerequisites\n\n- **Node.js** (v18 or higher)\n- **pnpm** (recommended) or npm/yarn\n\n## 🏃‍♂️ Quick Start\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd koa-typescript-starter\n   ```\n\n2. **Install dependencies**\n   ```bash\n   pnpm install\n   ```\n\n3. **Set up environment variables**\n   \n   Configure your environment by setting the `PORT` variable or use the default port 3000.\n\n4. **Start development server**\n   ```bash\n   pnpm dev\n   ```\n\n   The server will start at `http://localhost:3000`\n\n## 📜 Available Scripts\n\n| Command | Description |\n|---------|-------------|\n| `pnpm dev` | Start development server with hot reload using ts-node-dev |\n| `pnpm build` | Build the project for production using ESBuild |\n| `pnpm start` | Start the production server from built files |\n\n## 🔌 API Endpoints\n\nThe API uses versioned endpoints with the base path `/api/v1/`.\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/v1/auth/register` | User registration endpoint |\n\nAll endpoints are automatically prefixed with the version defined in `CONFIG.API_VERSION`.\n\n## 🐳 Docker Support\n\n### Development\n```bash\n# Build the image\ndocker build -t koa-typescript-starter .\n\n# Run the container\ndocker run -p 3000:3000 koa-typescript-starter\n```\n\n### Production\nThe Dockerfile includes:\n- Multi-stage build with Node.js 22.2.0 Alpine\n- PNPM package manager with frozen lockfile\n- Non-root user (nodejs) for security\n- Health checks for container monitoring\n- Production dependencies only (dev dependencies pruned)\n- Exposed port 3000\n\n## 🔧 Configuration\n\n### Environment Variables\n- `PORT` - Server port (default: 3000, configured in `src/lib/config.ts`)\n\n### Development Tools\n- **ts-node-dev** - Development server with TypeScript compilation and hot reload\n- **ESBuild** - Production bundling with source maps and external dependency optimization\n\n### TypeScript Configuration\n- Path aliases configured with `@/*` pointing to `src/*`\n- Modern ES2022 target with NodeNext module resolution\n- Strict type checking enabled\n\n### Key Dependencies\n- **@koa/bodyparser** - Request body parsing middleware\n- **@koa/router** - Routing middleware for Koa.js\n\n### Development Dependencies\n- **TypeScript** - Type safety and modern JavaScript features\n- **ts-node-dev** - Development server with TypeScript support\n- **ESBuild** - Fast production bundling\n- **tsconfig-paths** - Path mapping support for development\n\n## 🏗️ Architecture\n\nThis starter follows a modular architecture pattern:\n\n- **Controllers** - Handle HTTP requests and responses (see `modules/auth/`)\n- **Middleware** - Cross-cutting concerns like logging and body parsing\n- **Types** - TypeScript type definitions for better code organization\n- **Config** - Centralized configuration management\n- **Path Management** - Organized API endpoint definitions in `lib/paths.ts`\n\nThe application uses:\n- **Koa.js** as the web framework\n- **@koa/router** for routing\n- **@koa/bodyparser** for parsing request bodies\n- **Custom middleware** for logging requests\n\n## 🚀 Deployment\n\n1. **Build the project**\n   ```bash\n   pnpm build\n   ```\n\n2. **Start the production server**\n   ```bash\n   pnpm start\n   ```\n\n3. **Or use Docker**\n   ```bash\n   docker build -t koa-app .\n   docker run -p 3000:3000 koa-app\n   ```\n\n## 🤝 Contributing\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the ISC License.\n\n## 🙋‍♂️ Support\n\nIf you have any questions or need help, please open an issue or contact the maintainers.\n\n---\n\n**Happy coding!** 🎉","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetecan%2Fkoa-typescript-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetecan%2Fkoa-typescript-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetecan%2Fkoa-typescript-starter/lists"}