docs: Add comprehensive guide for creating services and API v2 integration #24687
+48
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds comprehensive documentation to the
.agents/knowledge-base.mdfile explaining how to create services in thepackages/featuresdirectory and properly integrate them with API v2 using the platform-libraries pattern.The documentation provides:
Context: This documentation was created to help developers understand the proper architecture for services and avoid common mistakes like:
packages/featuresin API v2 (violates architecture)The guide uses a generic
NotificationServiceexample to demonstrate the patterns without being tied to any specific feature.Link to Devin run: https://app.devin.ai/sessions/9a569d953f0a4e78a72149b53a14f6b3
Requested by: @hariombalhara ([email protected])
Visual Demo
N/A - Documentation only
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
This is a documentation-only PR. Testing involves:
Accuracy Review: Verify the documented patterns match actual Cal.com conventions
RegularBookingServiceandHashedLinkServiceCompleteness Review: Ensure the guide covers all necessary steps
Clarity Review: Assess if the documentation is clear and easy to follow
Human Review Checklist
Critical items to verify:
deps?: ServiceDeps) is the correct pattern for base servicespackages/featuresand must go through platform-libraries@Injectable(), module providers, and dependency injection follows NestJS best practicesNotificationServiceexample for correctness - ensure it doesn't contain any anti-patterns or misleading codeLow-risk items:
Summary by cubic
Added a clear guide to .agents/knowledge-base.md for creating services in packages/features and integrating them with API v2 through platform-libraries. It covers the 5-layer architecture, DI, NestJS modules/providers, repository wrappers, examples, best practices, and troubleshooting.