{"id":26086844,"url":"https://github.com/liqtags/firebase-functions-routing-controllers","last_synced_at":"2026-04-08T23:33:32.795Z","repository":{"id":222038808,"uuid":"756077195","full_name":"liqtags/firebase-functions-routing-controllers","owner":"liqtags","description":"Express + Routing-Controllers on Firebase Functions","archived":false,"fork":false,"pushed_at":"2024-02-12T00:45:42.000Z","size":300,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T07:18:42.524Z","etag":null,"topics":["express","firebase","firebasefunctions","routing-controllers","serverless","typedi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liqtags.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-11T22:38:38.000Z","updated_at":"2024-02-11T22:40:31.000Z","dependencies_parsed_at":"2024-05-13T19:01:38.111Z","dependency_job_id":"c9eb7b02-151a-435a-adec-3f49c20a5600","html_url":"https://github.com/liqtags/firebase-functions-routing-controllers","commit_stats":null,"previous_names":["0xlino/firebase-functions-routing-controllers","liqtags/firebase-functions-routing-controllers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liqtags/firebase-functions-routing-controllers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqtags%2Ffirebase-functions-routing-controllers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqtags%2Ffirebase-functions-routing-controllers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqtags%2Ffirebase-functions-routing-controllers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqtags%2Ffirebase-functions-routing-controllers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liqtags","download_url":"https://codeload.github.com/liqtags/firebase-functions-routing-controllers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liqtags%2Ffirebase-functions-routing-controllers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["express","firebase","firebasefunctions","routing-controllers","serverless","typedi"],"created_at":"2025-03-09T07:18:32.203Z","updated_at":"2026-04-08T23:33:32.778Z","avatar_url":"https://github.com/liqtags.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Express + Routing-Controllers on Firebase Functions\n\n## Overview\nA lightweight, flexible approach to building a serverless API with Firebase Functions, leveraging the `routing-controllers` library in conjunction with Express.js. Unlike the heavier NestJS framework, which also builds upon `routing-controllers` and `typedi`, this setup opts for simplicity and flexibility, making it easier to understand and customize for your specific needs.\n\n## Why `routing-controllers`?\n- **Simplicity and Flexibility**: Offers a straightforward way to define routes and middleware, making it easier to work with and adapt than more complex frameworks like NestJS.\n- **Compatibility**: Seamlessly integrates with any Express application, allowing for the use of existing Express middleware and patterns.\n- **Dependency Injection**: Utilizes `typedi` for dependency injection, simplifying the management of service instances and their dependencies.\n- **Reduced Overhead**: Avoids the extra complexity and overhead introduced by frameworks like NestJS, focusing instead on the core functionalities needed for routing and control.\n\n## Project Structure\n\n- **Middleware**: Custom middleware, such as `LoggingMiddleware` for logging requests and `CustomErrorHandler` for handling errors, can be globally applied before controller actions.\n- **Controllers**: Business logic is encapsulated within controllers, e.g., `ThingController`, keeping the code organized and maintainable.\n- **Decorators**: Utilizes decorators for routing, middleware, and dependency injection, making the code cleaner and more expressive.\n\n## Features\n\n- **Express Setup**: Basic Express server setup with JSON body parsing and a simple root route.\n- **Global Middleware**: Demonstrates how to use global middleware for logging and custom error handling.\n- **Dependency Injection**: Shows how to integrate `typedi` for dependency injection in controllers and services.\n- **Custom Decorators**: Implements custom decorators for authorization and current user context, showcasing the extensibility of `routing-controllers`.\n\n## Getting Started\n\n1. **Install Dependencies**: Run `npm install` to install the required packages, including `express`, `reflect-metadata`, `routing-controllers`, and `typedi`.\n\n2. **Local Development**:\n   - Start the local development server using Firebase Emulator or deploy it to Firebase Functions for testing.\n   - Use `firebase serve` (if using the Firebase CLI) to test locally.\n\n3. **Deployment**:\n   - Deploy your function to Firebase using `firebase deploy` and specify your project details in `firebase.json`.\n\n## Configuration\n\n- **Controllers**: Add or modify controllers in the `controllers` directory, following the `ThingController` example for handling specific routes.\n- **Middleware**: Implement custom middleware for global or route-specific functionality, ensuring they are registered in the Express application setup.\n- **Error Handling**: Customize the `CustomErrorHandler` to manage how application errors are handled and responses are sent.\n\n## Security and Authentication\n\n- **Authorization Checker**: The `authorizationChecker` function is a placeholder for implementing route-specific authorization logic.\n- **Current User Context**: The `currentUserChecker` function demonstrates how to integrate user context into your controllers, potentially using session or token-based authentication.\n\n## Conclusion\n\nThis project template offers a streamlined approach to building serverless APIs with Firebase Functions, emphasizing simplicity, flexibility, and the effective use of `routing-controllers` and `typedi`. It's an excellent starting point for developers looking to create scalable, maintainable serverless applications without the overhead of more complex frameworks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliqtags%2Ffirebase-functions-routing-controllers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliqtags%2Ffirebase-functions-routing-controllers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliqtags%2Ffirebase-functions-routing-controllers/lists"}