Development Guide#
For portal developers who want to build and deploy a new FairDM-powered research portal.
Your Role#
As a portal developer, you will:
Build a custom research portal: Create a FairDM-based portal tailored to your research community’s needs
Define domain-specific models: Extend the core Sample and Measurement models with your own fields and validation
Configure and customize: Set up your portal’s appearance, permissions, and behavior
Deploy to production: Launch your portal in the cloud or on your own infrastructure
Prerequisites#
You should have:
Working knowledge of Python and general web development concepts
Basic familiarity with Django (ideally having completed the official Django tutorials)
Basic understanding of Docker for deployment (optional but recommended)
Quick Start#
Important
New to FairDM? Start with the Getting Started guide for a complete walkthrough from running the demo to creating your first custom models.
The Getting Started guide will walk you through:
Running the FairDM demo portal locally
Creating your first custom Sample model (e.g.,
RockSample)Creating your first custom Measurement model (e.g.,
MineralAnalysis)Registering your models and seeing them in the UI
Verifying programmatic access via the API
Time required: ~30-60 minutes
Feature Specifications#
For implementation details and rationale behind FairDM features, see the feature specifications:
Core Projects - Project model and management features
FairDM Registry - Model registration system
All Specifications - Complete list of feature specs
These specifications provide full context on design decisions, user stories, and acceptance criteria for documented features.
Contents#
Getting started
- Getting Started
- What You’ll Build
- Step 1: Run the Demo Portal
- Step 2: Define Your First Custom Sample Model
- Step 3: Define a Custom Measurement Model
- Step 4: Register Your Models with FairDM
- Step 5: Create and Apply Migrations
- Step 6: Verify in the UI
- Step 7: Verify Programmatic Access
- What You’ve Accomplished
- Next Steps
- Before You Begin
- Setting up a new project
- Understanding the project directory
- Committing your project to GitHub/GitLab
Defining models
- Defining a model
- Special Fields
- Controlled vocabularies
- Model Registration and Configuration
- Measurement Development Guide
- Overview
- Step 1: Define Your Measurement Model
- Step 2: Register Your Measurement
- Step 3: Create Custom Admin (Optional)
- Step 4: Custom Forms and Filters
- Step 5: QuerySet Optimization
- Step 6: Permission Configuration
- Complete Example: Putting It All Together
- Testing Your Measurement Type
- Best Practices
- Troubleshooting
- Next Steps
- See Also
- Contributors System
- Using the Registry
Customisation
How to
- Create a Plugin
- Quality Control
- Testing Portal Projects with FairDM Factories
- Profile Claiming APIs
- RESTful API
- Automatic Endpoint Generation
- Discovery Catalog
- Interactive Documentation
- Authentication
- Permission Model
- Customizing Serializer Fields
- URL Slugs and verbose_name_plural
- Extending the Router with Custom Viewsets
- Rate Limiting
- CORS
- OpenAPI Schema Customisation
- Customizing the API Description
- Schema Naming Conventions
- Model Descriptions in the API Docs
- API Navigation Sidebar