Practice and reinforce the concepts from Lesson 1
In this hands-on activity, you'll build the foundational architecture for a social impact mobile app that can serve users in challenging environments with unreliable connectivity and limited resources.
By completing this activity, you will:
You're developing an app that helps rural communities access essential services (healthcare, education, emergency response) in areas with poor internet connectivity and limited device resources.
Create a data persistence layer that works offline and syncs when connectivity is available.
// Your implementation here
class ImpactAppDatabase {
constructor() {
// Initialize local storage
// Set up sync queue
// Configure conflict resolution
}
// TODO: Implement save method that works offline-first
async save(data) {
// Your code here
}
// TODO: Implement sync method for when connectivity returns
async sync() {
// Your code here
}
// TODO: Handle data conflicts during sync
async resolveConflicts(localData, remoteData) {
// Your code here
}
}
Expected Outcome: A database class that can store data locally and sync with a remote server when connectivity is available.
Test Scenario:
Implement intelligent syncing that prioritizes critical data and minimizes bandwidth usage.
class SmartSyncManager {
constructor() {
// Define data priority levels
// Set up bandwidth monitoring
}
// TODO: Prioritize sync operations
async prioritizeSync(syncQueue) {
// Emergency requests = Priority 1
// Healthcare appointments = Priority 2
// General community posts = Priority 3
// Your implementation here
}
// TODO: Compress data before sync
async compressData(data) {
// Your code here - reduce payload by 60%+
}
}
Design a modular system where features can be enabled/disabled based on region and user needs.
interface ImpactModule {
name: string;
description: string;
isEnabledForRegion(region: string): boolean;
getFeatures(): ModuleFeature[];
getResourceRequirements(): ResourceRequirements;
}
// TODO: Implement HealthcareModule
class HealthcareModule implements ImpactModule {
// Your implementation here
}
// TODO: Implement EducationModule
class EducationModule implements ImpactModule {
// Your implementation here
}
// TODO: Create module manager that loads appropriate modules
class ModuleManager {
async loadModulesForContext(userContext: UserContext) {
// Your code here
}
}
Requirements:
Implement a system that loads features progressively based on user behavior and device capabilities.
class ProgressiveLoader {
// TODO: Load core features first (30% of total size)
async loadCoreFeatures() {
// Essential offline functionality
}
// TODO: Load secondary features based on usage patterns
async loadSecondaryFeatures(userBehavior: UserBehavior) {
// Additional features user is likely to need
}
// TODO: Preload features during idle time on WiFi
async preloadOptionalFeatures() {
// Background loading when conditions are optimal
}
}
Implement data processing that keeps sensitive information on-device.
class PrivacyFirstProcessor {
// TODO: Process health data locally without sending to server
async processHealthMetrics(rawData: HealthData) {
// Analyze trends locally
// Only send anonymized insights if user consents
// Your implementation here
}
// TODO: Create anonymization system
async anonymizeUserData(userData: UserData): Promise<AnonymizedData> {
// Remove PII while preserving utility for impact measurement
// Your code here
}
}
Set up end-to-end encryption for all data transmission.
class SecureCommunicationLayer {
constructor() {
// Initialize encryption keys
}
// TODO: Encrypt data before transmission
async encryptMessage(message, recipientKey) {
// Your implementation here
}
// TODO: Verify message integrity
async verifyMessage(encryptedMessage, signature) {
// Your implementation here
}
}
Test your architecture under realistic challenging conditions:
Network Interruption Test:
Low Battery Simulation:
Limited Storage Test:
// TODO: Implement resilience monitoring
class ResilienceMonitor {
async testNetworkRecovery() {
// Your test implementation
}
async testLowResourceMode() {
// Your test implementation
}
async testDataPrioritization() {
// Your test implementation
}
}
Implement analytics that measure impact without compromising privacy.
class ImpactAnalytics {
// TODO: Track SDG-aligned metrics
async trackImpactMetric(metric: ImpactMetric) {
// Track: services accessed, response times, user satisfaction
// WITHOUT tracking: personal identity, location, private data
// Your implementation here
}
// TODO: Generate impact reports
async generateCommunityImpactReport(regionCode: string) {
// Aggregate anonymous data for stakeholders
// Your code here
}
}
Submit the following completed implementations:
Your solution will be evaluated on:
Your completed architecture could serve as the foundation for:
After completing this activity, consider:
If you encounter issues during this activity:
Remember: The goal isn't just to build working code, but to understand how architecture decisions can amplify social impact while protecting user privacy and ensuring accessibility.