Getting Started with Service Discovery
A deep dive into how Conduii automatically detects your tech stack and integrations.
One of Conduii's most powerful features is automatic service discovery. In this guide, we'll explore how it works and how to get the most out of it.
What is Service Discovery?
Service discovery is the process of automatically identifying all the external services and integrations your application depends on. This includes:
- **Platforms** - Vercel, Netlify, AWS, etc.
- **Databases** - PostgreSQL, MySQL, MongoDB, Redis, etc.
- **Authentication** - Clerk, Auth0, Firebase Auth, etc.
- **Payments** - Stripe, PayPal, Square, etc.
- **Email** - Resend, SendGrid, Postmark, etc.
- **Storage** - S3, R2, Cloudinary, etc.
How It Works
Conduii uses multiple signals to detect your services:
1. Environment Variable Analysis
We analyze your environment variable patterns to identify services. For example: - `DATABASE_URL` → Database connection - `STRIPE_SECRET_KEY` → Stripe integration - `CLERK_SECRET_KEY` → Clerk authentication
2. Dependency Scanning
We scan your package.json and other dependency files: - `@prisma/client` → Prisma ORM - `@supabase/supabase-js` → Supabase - `stripe` → Stripe SDK
3. Code Analysis
We analyze your codebase for integration patterns: - API endpoint calls - SDK initialization - Configuration files
Running Discovery
Run discovery with a single command:
conduii discoverYou'll see output like:
✓ Framework: Next.js 14 ✓ Platform: Vercel ✓ Database: PostgreSQL (via Prisma) ✓ Auth: Clerk ✓ Payments: Stripe ✓ Email: Resend
Discovered 6 services Generated 24 tests ```
Customizing Discovery
You can customize discovery with a `conduii.config.js` file:
module.exports = {
discovery: {
// Exclude certain directories// Add custom service detection customServices: [ { name: 'Custom API', type: 'api', endpoint: process.env.CUSTOM_API_URL, }, ], }, }; ```
Best Practices
- **Run discovery regularly** - As your app evolves, new services may be added
- **Review detected services** - Ensure all critical services are detected
- **Add custom services** - For internal APIs or custom integrations
- **Use environment-specific configs** - Different services may be used in different environments
Troubleshooting
Service Not Detected
If a service isn't detected: - Ensure environment variables are properly set - Check if the SDK is installed - Try adding it as a custom service
False Positives
If non-existent services are detected: - Check for unused dependencies - Review environment variable patterns - Use the exclude configuration
Conclusion
Service discovery is just the first step. Once Conduii knows your stack, it can generate comprehensive tests, monitor health, and provide intelligent diagnostics when things go wrong.