These integration guides are not official documentation and the Strapi Support Team will not provide assistance with them.
What Is Pythagora?
Pythagora is an AI-powered development platform built on the open-source GPT Pilot tool that generates production-ready code through a multi-agent architecture. The open-source GPT Pilot uses multiple specialized AI agents to handle different aspects of development. The commercial Pythagora platform extends this architecture with 14 specialized agents covering planning, coding, testing, debugging, and deployment.
The platform currently operates as a VS Code extension rather than a standalone CLI tool. It focuses on generating full-stack web applications using React frontends and Node.js/Express backends with TypeScript support.
Unlike autonomous code generation tools, Pythagora implements a human-in-the-loop methodology. You review each task before AI implementation begins, provide feedback at each step, and approve or reject proposed changes. This "pair programming" model means you maintain architectural control while the AI handles implementation details.
Why Integrate Pythagora with Strapi
Combining Pythagora's AI-assisted code generation with Strapi's headless CMS creates a powerful development workflow that leverages the strengths of both platforms.
Automated Backend Scaffolding with Content Infrastructure
Strapi automatically generates REST and GraphQL APIs for your content models, eliminating the need to manually build CRUD operations, serializers, and endpoint configurations.
Pythagora generates Node.js/Express backend code and React frontends through its VS Code extension. When building applications that integrate with Strapi, you can guide Pythagora to generate code that consumes Strapi's REST APIs for content delivery while handling custom business logic separately.
Accelerated Full-Stack Development
The combination addresses different parts of the development lifecycle simultaneously. While Strapi's Content-Type Builder handles data modeling through a visual interface, Pythagora generates frontend components and custom backend logic from natural language descriptions, reducing context switching between development tasks.
Clear Architectural Boundaries
Strapi manages content, media assets, and user permissions through its admin panel, while AI-generated code handles payment processing, third-party integrations, and custom workflows. This separation simplifies reasoning about where functionality lives and reduces the cognitive load of maintaining mixed concerns.
Reduced Operational Overhead
Strapi provides managed infrastructure for content operations while Pythagora generates custom code through its multi-agent workflow, potentially reducing manual work when building features that integrate with content APIs.
How to Integrate Pythagora with Strapi
The integration pattern keeps Strapi and your AI-generated application code in separate projects that communicate through APIs. Strapi runs as your content backend, while Pythagora generates custom frontend and API code that consumes Strapi's endpoints.
Install and Configure Strapi
Create a new Strapi project using the CLI:
npx create-strapi@latest my-content-backendThe installation wizard handles database selection—choose quickstart with SQLite for development, or custom installation for PostgreSQL/MySQL production setups.
Once installation completes, create your administrator account at http://localhost:1337/admin.
Create Content Types in Strapi
In the Content-Type Builder (admin panel), create a new collection type with a name relevant to your domain—for this example, we'll use "Article."
Add these fields to establish a basic blog structure:
- title (Text, short)
- slug (UID, attached to title field)
- content (Rich text, Markdown)
- excerpt (Text, long)
- publishedAt (DateTime)
When you save a content type in Strapi, the system automatically generates REST endpoints. For the Article content type, Strapi creates standard CRUD endpoints at /api/articles. You can verify these endpoints are working by testing them with curl.
Set public access for read operations by navigating to Settings → Users & Permissions Plugin → Public role. Enable find and findOne permissions for your Article content type.
Test the API by creating sample content through the admin panel, then verify the endpoint:
curl http://localhost:1337/api/articles?populate=*Configure Strapi API Permissions
By default, Strapi requires authentication for all API operations. Configure granular access through Settings → Users & Permissions Plugin → Roles.
For public content consumption, enable these permissions under the Public role:
- Article:
find,findOne
For authenticated operations (creating, updating, deleting), configure the Authenticated role or create custom roles with specific permissions.
If your application needs custom authentication beyond Strapi's built-in system, you can extend the Users & Permissions plugin through plugin extension patterns, implement custom policies in your routes, or create custom middleware and lifecycle hooks in your backend code.
According to Strapi's backend customization documentation, you can also leverage service extensions to modify authentication behavior at the business logic layer.
Install Pythagora VS Code Extension
Open VS Code and navigate to the Extensions marketplace (Ctrl+Shift+X or Cmd+Shift+X). Search for "Pythagora" and install the extension by Pythagora Technologies.
After installation, the Pythagora icon appears in your sidebar. Click it to open the panel and complete registration. Note that Pythagora requires Node.js v24 (recommended) and Git installed on your system.
Generate Application Code with Pythagora
Click "Create New App" in the Pythagora sidebar. Provide a descriptive project name and enter a detailed natural language description of what you're building.
Here's an effective prompt structure for generating a blog frontend that consumes your Strapi API:
Build a blog application with the following specifications:
Backend:
- Fetch articles from existing REST API at http://localhost:1337/api/articles
- Implement pagination (20 articles per page)
- Add client-side search filtering by title
- Cache API responses for 5 minutes
Frontend (React):
- Homepage: grid layout showing article excerpts with "Read More" links
- Article detail page: full content display with formatted markdown
- Navigation: header with logo and search bar
- Responsive design using Tailwind CSS
- Loading states for API requests
- Error handling for failed requests
Technical requirements:
- Use React Router for navigation
- Implement URL slugs for article pages (/articles/[slug])
- Parse markdown content with react-markdown
- Format dates with date-fns libraryPythagora generates the project iteratively. You'll see prompts asking for clarification on specific implementation details. This is the human-in-the-loop process working as designed. Provide feedback through the chat interface as the AI builds components.
Connect Generated Code to Strapi APIs
Review the API integration code Pythagora generates. API calls typically appear in service files or custom hooks. Verify the endpoint URLs match your Strapi configuration:
// Generated API service file
const API_BASE_URL = 'http://localhost:1337/api';
export const fetchArticles = async (page = 1, pageSize = 20) => {
const response = await fetch(
`${API_BASE_URL}/articles?pagination[page]=${page}&pagination[pageSize]=${pageSize}&populate=*`
);
if (!response.ok) {
throw new Error(`HTTP error: ${response.status}`);
}
return response.json();
};If Pythagora generates an endpoint structure that doesn't match Strapi's API conventions, guide it through the chat:
According to Strapi's REST API documentation, the API supports several query parameters for filtering, pagination, and data population. The Entity Service API accepts structured parameters with the following approaches:
- **Pagination**: `pagination: { page: 1, pageSize: 20 }`
- **Filters**: `filters: { title: { $contains: 'search-term' } }`
- **Population**: `populate: '*'` or `populate: { relationName: true }`
For REST API endpoints, these are conceptually passed as query parameters, but the available Strapi REST API documentation does not spell out how to translate `pagination`, `filters`, and `populate` options into REST URL query strings or describe this as following standard REST conventions.
Update the fetchArticles function to use this query format.Test the Integration
Run both servers in separate terminals:
# Terminal 1 - Strapi backend
cd my-content-backend
npm run develop
# Terminal 2 - Pythagora-generated frontend
cd my-blog-app
npm startVerify that your frontend successfully fetches and displays content from Strapi. Use the browser's network inspector to confirm API requests use the correct endpoints and query parameters.
If you encounter CORS errors during development, you'll need to configure Strapi's CORS middleware. Strapi's CORS configuration is managed through config/middlewares.js. According to Strapi's middleware documentation, you can configure allowed origins, methods, and headers to permit requests from your frontend application.
Refer to the Strapi middleware configuration documentation for the specific configuration syntax for your Strapi version.
Project Example: Multi-Channel Content Platform with Custom Analytics
This project demonstrates building a content platform where Strapi manages articles, authors, and media while AI-generated code handles custom analytics tracking, subscriber management, and content recommendations. The architecture creates a clear separation: content operations run through Strapi's admin panel while business logic lives in custom code.
Set Up Strapi Content Models
Create these collection types in Strapi's Content-Type Builder:
Article Collection:
- title (Text, required)
- slug (UID, required, auto-generated from title)
- content (Rich text, Blocks or Markdown)
- excerpt (Text, long)
- featuredImage (Media, single image)
- author (Relation, many-to-one with Author collection)
- categories (Relation, many-to-many with Category collection)
- publishedAt (DateTime)
- viewCount (Number, integer, default: 0)
This schema matches the Strapi 5 content-type structure documented in the Content-Type Builder Documentation, where field definitions include type, configuration options, and relationship specifications. The structure supports both single and repeatable components, with proper population control for relations as described in the Entity Service API Operations documentation.
Author Collection:
- name (Text)
- bio (Text, long)
- avatar (Media, single image)
- socialLinks (JSON)
Category Collection:
- name (Text)
- slug (UID)
- description (Text, long)
Subscriber Collection:
- email (Email, required, unique)
- preferences (JSON)
- subscribedAt (DateTime)
After creating these content types, populate sample data through the admin panel. The Media Library handles image uploads for featured images and author avatars.
Generate Custom Backend with Pythagora
Use this prompt to generate the analytics and subscription backend:
Build a Node.js/Express backend that integrates with an existing Strapi CMS:
Analytics Features:
- Track article views when users visit article detail pages
- Endpoint: POST /api/analytics/view with { articleId, userId (optional), timestamp }
- Store analytics in MongoDB with fields: articleId, timestamp, sessionId, referrer
- Generate daily analytics reports: top articles by views, traffic sources, reading time estimates
- Endpoint: GET /api/analytics/reports?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD
Subscriber Management:
- Endpoint: POST /api/subscribe with { email, preferences }
- Validate email format and check for duplicates
- Send confirmation email using an email service provider (SendGrid, Mailgun, or similar)
- Endpoint: POST /api/unsubscribe with { email, token }
- Endpoint: GET /api/subscribers/stats returns total count and growth metrics
Newsletter Generation:
- Endpoint: POST /api/newsletter/send
- Fetch top 5 articles from past week via Strapi API
- Generate email template with article excerpts
- Send to subscribers via email service integration
- Track basic delivery metrics
Technical Requirements:
- MongoDB for analytics storage
- JWT authentication for admin endpoints (/api/newsletter/send, /api/analytics/reports)
- Rate limiting: 100 requests per 15 minutes per IP
- Environment variables for Strapi API URL, MongoDB connection, email service API keyNote: This prompt demonstrates the level of detail helpful when guiding Pythagora. The actual generated code structure may vary, and complex features may require iterative refinement through Pythagora's human-in-the-loop process. When Pythagora generates email integration code, review it carefully to ensure proper error handling and rate limiting for your email service provider.
Pythagora generates full-stack applications with Node.js/Express backends and React frontends through its VS Code extension. The generated code typically includes routing, business logic, and database integration, though the exact architectural patterns may vary based on your project requirements and prompts.
Implement a Custom Strapi Controller for View Tracking
Create a custom controller in Strapi that receives view count updates from your analytics backend. This demonstrates extending Strapi's auto-generated APIs with custom logic.
Create this controller following Strapi's controller factory pattern:
// src/api/article/controllers/article.js
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::article.article', ({ strapi }) => ({
async incrementViews(ctx) {
const { id } = ctx.params;
const article = await strapi.entityService.findOne('api::article.article', id, {
fields: ['id', 'viewCount'],
});
if (!article) {
return ctx.notFound('Article not found');
}
const updatedArticle = await strapi.entityService.update(
'api::article.article',
id,
{
data: {
viewCount: (article.viewCount || 0) + 1,
},
}
);
return { data: updatedArticle };
},
async getPopular(ctx) {
const entries = await strapi.entityService.findMany('api::article.article', {
filters: { publishedAt: { $notNull: true } },
populate: { author: true, categories: true, featuredImage: true },
sort: { viewCount: 'desc' },
pagination: { limit: 10 },
});
return { data: entries };
},
}));Add custom routes for these controller actions. This demonstrates Strapi's documented route structure, but specific endpoint paths and handler names should be verified against your use case:
// src/api/article/routes/custom-routes.js
module.exports = {
routes: [
{
method: 'POST',
path: '/articles/:id/increment-views',
handler: 'article.incrementViews',
config: {
policies: [],
middlewares: [],
},
},
{
method: 'GET',
path: '/articles/popular',
handler: 'article.getPopular',
config: {
policies: [],
middlewares: [],
},
},
],
};Connect Analytics Backend to Strapi
Here's an implementation pattern for integrating your analytics backend with Strapi's API:
// services/strapiService.js
const STRAPI_URL = process.env.STRAPI_URL || 'http://localhost:1337';
const STRAPI_API_TOKEN = process.env.STRAPI_API_TOKEN;
const strapiRequest = async (endpoint, options = {}) => {
const response = await fetch(`${STRAPI_URL}/api${endpoint}`, {
...options,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${STRAPI_API_TOKEN}`,
...options.headers,
},
});
if (!response.ok) {
throw new Error(`Strapi API error: ${response.status}`);
}
return response.json();
};
const incrementArticleViews = async (articleId) => {
return strapiRequest(`/articles/${articleId}/increment-views`, {
method: 'POST',
});
};
const fetchArticlesByCategory = async (categorySlug, limit = 5) => {
return strapiRequest(
`/articles?filters[categories][slug][$eq]=${categorySlug}&populate=*&pagination[limit]=${limit}`
);
};
const fetchRecentArticles = async (days = 7) => {
const startDate = new Date();
startDate.setDate(startDate.getDate() - days);
return strapiRequest(
`/articles?filters[publishedAt][$gte]=${startDate.toISOString()}&sort=publishedAt:desc&populate=*`
);
};
module.exports = {
incrementArticleViews,
fetchArticlesByCategory,
fetchRecentArticles,
};Example MongoDB document structure (this represents a common pattern for analytics storage, not Pythagora-generated code):
// Analytics document in MongoDB
{
articleId: "strapi-article-id-123",
views: 1534,
sessions: [
{ timestamp: "2024-01-15T10:30:00Z", referrer: "https://google.com" }
],
lastUpdated: "2024-01-15T14:22:00Z"
}Fetch the full article data from Strapi's API when you need to display analytics with article details. This architectural pattern, common in headless CMS implementations, maintains clear boundaries and prevents schema coupling between services.
Generate Frontend with Pythagora
Create a new Pythagora project for the frontend, or ask it to extend the existing project:
Extend the blog application with these features:
Analytics Integration:
- When user views article detail page, send POST request to analytics backend
- Include sessionId (stored in localStorage), referrer, and timestamp
- Handle analytics failures gracefully (don't block page rendering)
Newsletter Subscription:
- Add subscription form in footer: email input + subscribe button
- POST to /api/subscribe with email
- Show success message on successful subscription
- Display validation errors inline
- Add unsubscribe page that validates token from email link
Popular Articles Sidebar:
- Fetch from custom `/api/articles/popular` endpoint
- Display top 10 articles by view count
- Update every 5 minutes via client-side polling
- Show article title, author name, and view countReview the generated components to verify they properly handle API errors and loading states. The generated code should include proper TypeScript types if you specified that requirement.
Deploy and Monitor
This multi-service architecture requires coordination between deployments. Deploy Strapi to Strapi Cloud, AWS, DigitalOcean, or Heroku. Each platform's documentation provides specific configuration details for your hosting setup.
For the custom analytics backend and frontend, standard Node.js hosting works. Configure environment variables for each service:
Strapi Environment:
DATABASE_URL=postgresql://user:pass@host:5432/dbname
NODE_ENV=productionAnalytics Backend Environment:
STRAPI_URL=https://your-strapi-instance.com
STRAPI_API_TOKEN=your-api-token
MONGODB_URI=mongodb://user:pass@host:27017/analytics
EMAIL_SERVICE_API_KEY=your-email-service-key
JWT_SECRET=your-jwt-secretFrontend Environment:
REACT_APP_STRAPI_URL=https://your-strapi-instance.com
REACT_APP_ANALYTICS_URL=https://your-analytics-backend.comThis architecture demonstrates clear separation: content creators work entirely within Strapi's admin panel, never touching code. Developers extend functionality through custom controllers in Strapi and separate microservices for specialized features like analytics.
Strapi Open Office Hours
If you have any questions about Strapi 5 or just would like to stop by and say hi, you can join us at Strapi's Discord Open Office Hours, Monday through Friday, from 12:30 pm to 1:30 pm CST: Strapi Discord Open Office Hours.
For more details, visit the Strapi documentation and Pythagora documentation.
Get Started in Minutes
npx create-strapi-app@latest in your terminal and follow our Quick Start Guide to build your first Strapi project.