Where Are the Backend Services Located in the Plane Project Structure?
Plane's backend services are split between a Django REST API residing in apps/api and a shared TypeScript service layer located in packages/services.
The open-source project management platform Plane (available at makeplane/plane) organizes its backend across two distinct locations to separate server-side API logic from client-side service abstractions. Understanding where these backend services are located in the Plane project structure is essential for contributors working on API endpoints, background workers, or front-end integrations.
Django REST API Core (apps/api)
The primary server-side backend is built with Django and lives under the apps/api directory. This location houses the main Django project, configuration, and all HTTP endpoint logic.
Main Project Configuration
The Django project root is located at apps/api/plane, containing the core settings modules, WSGI entry points, and application configuration. This directory serves as the foundation for the REST API, defining database connections, installed apps, and routing configuration.
Views and Serializers
API endpoints are implemented in apps/api/plane/web/views.py, which contains viewsets handling CRUD operations for resources like issues, projects, and cycles. Data serialization logic resides in apps/api/plane/serializers, converting Django model instances to JSON representations for API responses.
Middleware components for authentication and permission checks are located in apps/api/plane/app/middleware, processing incoming requests before they reach the view layer.
Background Tasks
Asynchronous processing logic lives in apps/api/plane/bgtasks, containing Celery tasks or similar worker implementations for email notifications, data synchronization, and telemetry collection. These background workers handle operations that shouldn't block the main request thread.
Shared TypeScript Services (packages/services)
Reusable backend logic that wraps the REST API is factored into packages/services/src. These TypeScript services provide a typed client abstraction used by the web, desktop, and mobile front-ends.
Service Architecture
The services package encapsulates HTTP communication, state management, and domain-specific business logic. The central HTTP client at packages/services/src/api.service.ts handles all API requests, while individual service modules provide method-specific implementations for different domains.
Core Service Modules
Authentication Service (packages/services/src/auth/auth.service.ts): Handles login flows, token refresh, and session persistence across client applications.
Workspace Service (packages/services/src/workspace/workspace.service.ts): Provides CRUD operations for workspaces and related entities, including member management.
Issue Service (packages/services/src/issue/sites-issue.service.ts): Manages issue tracking functionality, including comments, attachments, and activity streams.
Cycle Service (packages/services/src/cycle/cycle.service.ts): Implements sprint/cycle management with analytics and progress tracking.
File Service (packages/services/src/file/file.service.ts): Handles file uploads, downloads, and S3 integration for asset storage.
Code Examples
Fetching Workspaces via TypeScript Service
Front-end applications interact with the backend through the shared services package:
import { WorkspaceService } from '@plane/services';
async function loadWorkspace(workspaceId: string) {
try {
const workspace = await WorkspaceService.getWorkspace(workspaceId);
console.log('Workspace loaded:', workspace);
} catch (err) {
console.error('Failed to load workspace:', err);
}
}
Creating Issues via Django ViewSet
The server-side API implementation uses Django REST framework viewsets:
# apps/api/plane/web/views.py
class IssueViewSet(viewsets.ModelViewSet):
queryset = Issue.objects.all()
serializer_class = IssueSerializer
def perform_create(self, serializer):
serializer.save(created_by=self.request.user)
Summary
- Primary Django API: Located in
apps/api/plane, containing the main REST API with views, serializers, middleware, and background tasks. - Shared TypeScript Services: Found in
packages/services/src, providing typed client wrappers for web and mobile front-ends. - Key Backend Files:
apps/api/plane/web/views.pyfor HTTP endpoints andapps/api/plane/bgtasks/for asynchronous workers. - Service Layer: Modular TypeScript services like
auth.service.tsandworkspace.service.tsencapsulate API interactions for client applications.
Frequently Asked Questions
Where is the main Django project configuration in Plane?
The main Django project configuration resides in apps/api/plane, which contains the settings modules, WSGI configuration, and root URL routing. This directory serves as the entry point for the Django application server.
What is the purpose of the packages/services directory?
The packages/services directory contains TypeScript service modules that provide a reusable abstraction layer over the REST API. These services handle HTTP requests, authentication state, and data transformation for the web, desktop, and mobile front-end applications.
How does Plane handle background processing tasks?
Background tasks are implemented in apps/api/plane/bgtasks, containing asynchronous workers for operations like email notifications, data synchronization, and telemetry. These tasks run outside the main request cycle to prevent blocking API responses.
Which file contains the core API endpoint definitions for resources like issues and projects?
The apps/api/plane/web/views.py file contains the core viewsets and API endpoint definitions for resources including issues, projects, cycles, and workspaces. These classes implement the HTTP methods that the TypeScript services consume.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →