-
Notifications
You must be signed in to change notification settings - Fork 0
Development
This page covers development workflows, coding standards, and best practices for ExpoScholar.
Start Server:
./setup start-server
# or
cd server && python manage.py runserverServer runs at http://localhost:8000
Start Mobile App:
./setup start-mobile
# or
cd mobile && flutter runStart Android VM (Optional):
./setup start-mobileThis automatically creates and boots a QEMU-based Android virtual machine.
-
Make Changes: Edit source files in
server/ormobile/ -
Test Locally: Run tests with
./setup test-serveror./setup test-mobile - Check Quality: Run linting and static analysis
- Commit Changes: Follow the established commit message format
Flutter:
- Press
rin terminal for hot reload - Press
Rfor hot restart - Press
qto quit
Django:
- Server auto-reloads on file changes
- Manual restart:
./setup start-server
Style Guidelines:
- Follow PEP 8 style guidelines
- Maximum line length: 79 characters
- Use type hints where appropriate
- Write docstrings for all functions and classes
Example:
def process_order(order_id: int) -> dict:
"""
Process an order and return the result.
Args:
order_id: The ID of the order to process
Returns:
Dictionary containing order processing results
"""
# Implementation
passLinting:
cd server
flake8 .
black --check .Style Guidelines:
- Follow Dart style guide
- Use
flutter analyzeto check for issues - Maintain zero analyzer warnings
- Write comprehensive tests
Example:
/// Processes synchronization data and returns the result.
Future<SyncResult> processSync(SyncData data) async {
// Implementation
}Analysis:
cd mobile
flutter analyzeInstallation:
-
./setup install- Full installation -
./setup server- Server setup only -
./setup mobile- Mobile setup only
Development:
-
./setup start-server- Start development server -
./setup start-mobile- Start mobile app -
./setup stop-server- Stop development server -
./setup stop-mobile- Stop mobile app
Testing:
-
./setup test- Run all tests -
./setup test-server- Run server tests -
./setup test-mobile- Run mobile tests
Building:
-
./setup build-apk- Build Android APK -
./setup build-aab- Build Android App Bundle -
./setup build-ios- Build iOS app -
./setup build-split- Build split APKs
Documentation:
-
./setup docs- Build documentation -
./setup docs-info- Build Info format -
./setup docs-html- Build HTML format -
./setup docs-pdf- Build PDF format
Utilities:
-
./setup check- Validate system requirements -
./setup help- Show all available commands
Setup:
-
make setup- Full installation -
make setup-server- Server setup only -
make setup-mobile- Mobile setup only
Testing:
-
make test- Run all tests -
make test-server- Run server tests -
make test-mobile- Run mobile tests
Quality:
-
make lint- Run linting -
make format- Format code -
make analyze- Run static analysis
Building:
-
make build- Build all components -
make docker-build- Build Docker images
Documentation:
-
make docs- Build documentation -
make docs-html- Build HTML format -
make docs-pdf- Build PDF format
Cleanup:
-
make clean- Clean build artifacts -
make clean-all- Clean all generated files
Help:
-
make help- Show all targets
Run All Tests:
./setup test-server
# or
cd server && python manage.py testRun Specific Test Suite:
cd server && python manage.py test apps.accounts.testsWith Coverage:
cd server && python manage.py test --coverageRun All Tests:
./setup test-mobile
# or
cd mobile && flutter testRun Specific Test:
cd mobile && flutter test test/unit/providers/sync_provider_test.dartWith Coverage:
cd mobile && flutter test --coverageStatic Analysis:
cd mobile && flutter analyzeIntegration tests are located in tests/integration/ and can be run with:
./setup testDjango Debug Toolbar:
- Automatically enabled in development
- Access at
/__debug__/
Logging:
import logging
logger = logging.getLogger(__name__)
logger.debug('Debug message')Management Commands:
python manage.py shell
python manage.py dbshellFlutter DevTools:
flutter pub global activate devtools
flutter pub global run devtoolsPrint Debugging:
print('Debug message');
debugPrint('Debug message'); // RecommendedWidget Inspector:
- Available in IDE or via DevTools
- Inspect widget tree
- View render tree
- apps/: Django applications (modular components)
- config/: Project configuration
- templates/: HTML templates
- static/: Static files
- media/: User-uploaded files
- lib/models/: Data models
- lib/providers/: State management
- lib/screens/: UI screens
- lib/widgets/: Reusable components
- lib/utils/: Utility functions
- test/: Test suites
- Create Feature Branch:
git checkout -b feature/your-feature-name- Make Changes and Commit:
git add .
git commit -m "feat: add new feature"- Push and Create Pull Request:
git push origin feature/your-feature-nameFollow the established format:
<type>: <short summary>
OVERVIEW:
- Brief overview of changes
DETAILS:
- Detailed list of changes
TECHNICAL DETAILS:
- Technical implementation notes
TESTING:
- Testing procedures and results
FILES:
- List of modified files
Types:
-
fix:Bug fixes -
feat:New features -
docs:Documentation changes -
refactor:Code refactoring -
test:Test additions or changes -
ci:CI/CD changes -
infra:Infrastructure changes
- Write clear, self-documenting code
- Add comments for complex logic
- Keep functions small and focused
- Use meaningful variable names
- Follow DRY (Don't Repeat Yourself) principle
- Use Django ORM for database queries
- Validate input at the serializer level
- Use signals for cross-app communication
- Implement proper error handling
- Log important events
- Use Provider for state management
- Keep widgets small and reusable
- Use const constructors where possible
- Implement proper error handling
- Handle network failures gracefully
- Installation - Installation instructions
- Architecture - System architecture
- Testing - Testing procedures
- Contributing - Contribution guidelines