This project is a microservice for user management built with Firebase Realtime Database, Express, and TypeScript. It follows Domain-Driven Design (DDD) principles to ensure a clean architecture and maintainability.
- Create, Read, Update, and Delete (CRUD) operations for users
- Password encryption
- Unique email validation
- Error handling
- Clean architecture with Domain-Driven Design (DDD)
This project uses the hexagonal architecture (also known as ports and adapters) to decouple the business logic from external dependencies, such as Firebase and Express. The main layers are:
- Domain: Contains the core business logic and domain models
- Application: Contains use cases that orchestrate domain logic
- Infrastructure: Contains external dependencies and implementations, such as Firebase services
- Adapters: Contains adapters for external frameworks and libraries, such as Express controllers
- Node.js (>= 14.x)
- Firebase CLI
- TypeScript
-
Clone the repository:
git clone https://github.com/sousaprogramador/firebase-node-example.git cd your-repo
-
Install dependencies:
cd functions npm install
-
Set up Firebase:
firebase login firebase init functions
Compile the TypeScript code:
npm run build
npm run serve
- Node.js
- TypeScript
- Express
- Firebase Realtime Database
- Firebase Functions
- bcrypt