Skip to content

Mirza-Gazzal/fastify-microservice-core

Repository files navigation

fastify-microservice-core

fSetup & Getting Started

Please follow the setup instructions in the README file below.

After completing the setup and starting the application, you can review the Module Demo implementation to better understand how to create your own modules and build APIs within the framework.

Module Architecture Overview

This project is built using a modular structure, where each feature is implemented as its own module (e.g., user).

Each module contains a versioned structure (e.g., v1), and follows a consistent folder layout to separate responsibilities and keep code maintainable and scalable.

Example Module: user

Inside the user module, you will find v1, which contains the following layers:

0-controller Handles request/response logic, response formatting, and optional validation handling.

1-models Defines database schemas and data models.

2-repositories Contains database access and query logic (CRUD operations, complex queries, etc.).

3-routes Defines API routes and endpoints (example: /user/login).

4-sanitizer Contains sanitization logic to clean and normalize incoming data if needed.

5-service Implements core business logic and application workflows.

6-validators Includes request validation logic to validate incoming data before it reaches business logic.

This layered structure ensures clean separation between routing, validation, business logic, and database operations.

Included Modules

This framework comes with ready-to-use base modules to help you get started quickly:

Auth Module Includes authentication and OAuth2 login protocol support.

User Module Includes basic user registration and login functionality.

modules/ user/ v1/ 0-controller/ 1-models/ 2-repositories/ 3-routes/ 4-sanitizer/ 5-service/ 6-validators/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors