Skip to content

Latest commit

Β 

History

History
440 lines (363 loc) Β· 8.9 KB

SAMPLE_DATA.md

File metadata and controls

440 lines (363 loc) Β· 8.9 KB

Sample Data & Configuration Guide

πŸ“Š Sample Student Data

Use this sample data to test the application. You can manually enter these students or modify the database service to seed data on first launch.

Sample Students

[
  {
    "firstName": "Ahmed",
    "lastName": "Hassan",
    "email": "ahmed.hassan@school.com",
    "phone": "08012345678",
    "rollNumber": "CSE001",
    "className": "100 Level",
    "dateOfBirth": "15-05-2005",
    "address": "123 Main Street, Katsina",
    "gpa": 3.8,
    "attendancePercentage": 95,
    "enrollmentDate": "01-09-2023"
  },
  {
    "firstName": "Fatima",
    "lastName": "Muhammad",
    "email": "fatima.m@school.com",
    "phone": "08087654321",
    "rollNumber": "CSE002",
    "className": "100 Level",
    "dateOfBirth": "22-08-2005",
    "address": "456 Oak Avenue, Katsina",
    "gpa": 3.9,
    "attendancePercentage": 98,
    "enrollmentDate": "01-09-2023"
  },
  {
    "firstName": "Abdullahi",
    "lastName": "Ali",
    "email": "abdullahi.ali@school.com",
    "phone": "08045678901",
    "rollNumber": "CSE003",
    "className": "200 Level",
    "dateOfBirth": "10-03-2004",
    "address": "789 Pine Road, Katsina",
    "gpa": 3.5,
    "attendancePercentage": 92,
    "enrollmentDate": "01-09-2022"
  },
  {
    "firstName": "Aisha",
    "lastName": "Ibrahim",
    "email": "aisha.i@school.com",
    "phone": "08078901234",
    "rollNumber": "CSE004",
    "className": "200 Level",
    "dateOfBirth": "05-12-2003",
    "address": "321 Elm Street, Katsina",
    "gpa": 3.7,
    "attendancePercentage": 96,
    "enrollmentDate": "01-09-2022"
  },
  {
    "firstName": "Usman",
    "lastName": "Sani",
    "email": "usman.sani@school.com",
    "phone": "08056789012",
    "rollNumber": "CSE005",
    "className": "300 Level",
    "dateOfBirth": "18-07-2002",
    "address": "654 Maple Drive, Katsina",
    "gpa": 3.6,
    "attendancePercentage": 94,
    "enrollmentDate": "01-09-2021"
  }
]

πŸ› οΈ Adding Sample Data to App

Method 1: Manual Entry (Recommended for Testing)

  1. Launch the app
  2. Tap "Add Student" or FAB
  3. Fill in the form with sample data
  4. Tap "Add Student"
  5. Repeat for all sample students

Method 2: Database Seeding (Advanced)

Modify lib/services/database_service.dart:

// Add this method to DatabaseService class
Future<void> seedSampleData() async {
  final sampleStudents = [
    Student(
      firstName: 'Ahmed',
      lastName: 'Hassan',
      email: 'ahmed.hassan@school.com',
      phone: '08012345678',
      rollNumber: 'CSE001',
      className: '100 Level',
      dateOfBirth: '15-05-2005',
      address: '123 Main Street, Katsina',
      gpa: 3.8,
      attendancePercentage: 95,
      enrollmentDate: '01-09-2023',
    ),
    // ... add more students
  ];

  for (var student in sampleStudents) {
    await insertStudent(student);
  }
}

// Call from main.dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  final dbService = DatabaseService();
  final count = await dbService.getTotalStudents();
  
  // Seed if empty
  if (count == 0) {
    await dbService.seedSampleData();
  }
  
  runApp(const StudentManagementApp());
}

🎯 Test Scenarios

Scenario 1: Adding a Student

1. Click Add Student
2. Fill fields:
   - First Name: John
   - Last Name: Doe
   - Email: john@example.com
   - Phone: 0801234567
   - Roll No: CSE099
   - Class: 100 Level
   - DOB: 01-01-2005
   - Address: Test Address
   - GPA: 3.5
   - Attendance: 90
   - Enrollment: 01-09-2023
3. Click "Add Student"
4. Verify appears in list

Scenario 2: Searching Students

1. Go to Students List
2. Type "Ahmed" in search
3. Verify only Ahmed shows
4. Clear search
5. Select class "100 Level"
6. Verify only 100 Level students show

Scenario 3: Viewing Details

1. Click on any student
2. Verify all details display correctly
3. Check progress bars
4. Verify edit button works
5. Test delete with confirmation

Scenario 4: Statistics

1. Go to Dashboard
2. Verify Total Students count
3. Check Average GPA calculation
4. Check Average Attendance calculation
5. Verify recent students display

πŸ”§ Configuration Files

pubspec.yaml Configuration

name: student_management_system
version: 1.0.0+1

# Add these configurations:

flutter:
  uses-material-design: true
  
  # Assets
  assets:
    - assets/images/
    - assets/icons/
  
  # Fonts
  fonts:
    - family: Poppins
      fonts:
        - asset: assets/fonts/Poppins-Regular.ttf
        - asset: assets/fonts/Poppins-Bold.ttf
          weight: 700

Android Configuration

android/app/build.gradle:

android {
    compileSdkVersion 34
    
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34
    }
}

android/app/AndroidManifest.xml:

<manifest package="com.example.student_management_system">
    <application
        android:label="Student Management"
        android:icon="@mipmap/ic_launcher">
    </application>
</manifest>

πŸ“ Environment Variables

Create .env file for configuration:

# Database Configuration
DB_NAME=student_management.db
DB_VERSION=1

# App Configuration
APP_NAME=Student Management System
APP_VERSION=1.0.0

# API Configuration (for future use)
# API_BASE_URL=https://api.example.com
# API_TIMEOUT=30

🎨 Theme Configuration

Current theme in main.dart:

// Primary Color
Color seedColor = const Color(0xFF6366F1);  // Indigo

// Optional: Custom ThemeData
ThemeData.from(
  colorScheme: ColorScheme.fromSeed(
    seedColor: const Color(0xFF6366F1),
    brightness: Brightness.light,
  ),
)

πŸ’Ύ Database Location

After app installation, database is stored at:

/data/data/com.example.student_management_system/databases/student_management.db

To access via ADB:

adb pull /data/data/com.example.student_management_system/databases/student_management.db

πŸ“± Device Configuration

Minimum Requirements

- Android 5.0 (API 21)
- 50 MB free space
- 2 GB RAM minimum

Recommended

- Android 8.0+ (API 26+)
- 150 MB free space
- 4 GB RAM

πŸ§ͺ Testing Configuration

Unit Test Setup

Create test/student_test.dart:

import 'package:flutter_test/flutter_test.dart';
import 'package:student_management_system/models/student.dart';

void main() {
  group('Student Model Tests', () {
    test('Student creation and copyWith', () {
      final student = Student(
        firstName: 'John',
        lastName: 'Doe',
        email: 'john@test.com',
        phone: '1234567890',
        rollNumber: 'TEST001',
        className: '100 Level',
        dateOfBirth: '01-01-2005',
        address: 'Test Address',
      );

      expect(student.fullName, equals('John Doe'));
      
      final updated = student.copyWith(gpa: 3.8);
      expect(updated.gpa, equals(3.8));
    });
  });
}

Run tests:

flutter test

πŸš€ Performance Benchmarks

Target Performance Metrics:

Operation          | Target Time | Notes
================== | =========== | ===================
Load all students  | < 500ms     | With 1000+ records
Search students    | < 200ms     | In-memory filter
Add student        | < 300ms     | Database write
Update student     | < 300ms     | Database update
Delete student     | < 300ms     | Database delete
Calculate stats    | < 100ms     | Aggregation query

πŸ” Debugging Commands

Flutter Debug Commands

# Run with debug output
flutter run -v

# Run in debug mode with breakpoints
flutter run --debug

# Profile app
flutter run --profile

# Release mode
flutter run --release

# Show device logs
flutter logs

# Hot reload
Press 'r'

# Hot restart
Press 'R'

Database Debugging

// In database_service.dart, add logging:
Future<List<Student>> getAllStudents() async {
  final db = await database;
  final List<Map<String, dynamic>> maps = await db.query('students');
  
  print('Fetched ${maps.length} students from database');
  
  return List.generate(maps.length, (i) => Student.fromMap(maps[i]));
}

πŸ“Š Sample API Response (for future backend)

{
  "success": true,
  "data": {
    "students": [
      {
        "id": 1,
        "firstName": "Ahmed",
        "lastName": "Hassan",
        "email": "ahmed@school.com",
        "phone": "08012345678",
        "rollNumber": "CSE001",
        "className": "100 Level",
        "dateOfBirth": "15-05-2005",
        "address": "123 Main St",
        "gpa": 3.8,
        "attendancePercentage": 95,
        "enrollmentDate": "01-09-2023"
      }
    ],
    "meta": {
      "total": 100,
      "page": 1,
      "perPage": 10
    }
  }
}

πŸ“‹ Checklist Before Deployment

  • All dependencies installed
  • No build errors
  • Sample data tested
  • All features working
  • No console errors
  • Performance acceptable
  • Database backup working
  • App icons set
  • Splash screen configured
  • Version updated
  • Release APK built
  • Tested on physical device

Ready to deploy! πŸš€