Skip to content

Commit a9af7d0

Browse files
Merge pull request #2 from alchemista27/pjblms_alchemista
alchemista
2 parents 202e99a + b670f42 commit a9af7d0

16 files changed

Lines changed: 256 additions & 105 deletions

README.md

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,56 @@
11
<h1 align="center"> Hello, <img src="https://raw.githubusercontent.com/nixin72/nixin72/master/wave.gif"
22
alt="Waving hand animated gif"
33
height="45"
4-
width="45" /> I'm Md Shirajul Islam</h1>
4+
width="45" /> My Name is Septian</h1>
55

66

77
<!-- ABOUT THE PROJECT -->
88
## About The Project
99

10-
LC LMS is a cutting-edge online learning management system built with Flutter, offering a seamless and engaging educational experience. This mobile app empowers users with a user-friendly interface, interactive content delivery, and robust features for efficient learning. Whether you're a student or an instructor, LC LMS provides a dynamic platform for accessing courses, submitting assignments, and fostering collaboration. Experience the future of online education with LC LMS – where innovation meets education, all in the palm of your hand.
10+
This is a fork of [interactive_cares_lms](https://github.com/programmingwormhole/interactive_cares_lms), a Flutter-based Learning Management System (LMS).
11+
I extended it by adding role-based authentication and dashboards for different user types:
1112

12-
<!-- Demo -->
13-
## Demo Access
14-
[![Download][Download]][Download-url]
15-
16-
17-
### Built With
18-
19-
LC LMS, crafted with the power of Dart and Flutter, redefines online learning. This dynamic app seamlessly blends innovation and education, providing a sleek, responsive, and user-friendly experience. Whether you're a student or instructor, dive into a world of interactive courses, streamlined assignments, and collaborative tools. LC LMS is the epitome of modern education, built for the future with Dart and Flutter's cutting-edge technology.
13+
* **Admin** 👨‍💻 – Manage courses, users, and system settings.
14+
* **Lecturer** 👩‍🏫 – Create and manage lessons.
15+
* **Student** 🎓 – Enroll in courses and track progress.
2016

21-
[![Flutter][Flutter]][Flutter-url]
22-
[![Dart][Dart]][Dart-url]
17+
---
18+
<!-- Demo -->
19+
## 🚀 Features
20+
### 🔑 Authentication
21+
* Login & Register with API integration
22+
* Role-based redirection (Admin, Lecturer, Student)
23+
24+
### 📚 Course Management
25+
* Featured courses, lessons, and modules
26+
* Track lesson completion progress
27+
28+
### 📌 Bookmarking
29+
* Save & manage bookmarked lessons locally
30+
31+
### 🎨 UI
32+
* Flutter + GetX state management
33+
* Material Design widgets
34+
35+
---
36+
## Project Structure
37+
```bash
38+
lib/
39+
├── bindings/ # GetX dependency bindings
40+
├── controllers/ # App controllers (auth, course, lesson, bookmark)
41+
├── core/services/ # API services (auth, shared services)
42+
├── global_widgets/ # Reusable UI components
43+
├── helpers/ # Helpers (requests, forms, alerts)
44+
├── models/ # Data models (user, course, category)
45+
├── routes/ # Route names & destinations
46+
├── utils/ # Config, constants, colors, assets
47+
├── views/ # Screens (Authentication, Home, Learning, etc.)
48+
│ ├── Admin/ # NEW: Admin dashboard
49+
│ ├── Lecturer/ # NEW: Lecturer dashboard
50+
│ └── Student/ # NEW: Student dashboard
51+
└── main.dart # App entry point with role-based redirection
52+
```
53+
---
2354

2455
<!-- GETTING STARTED -->
2556
## Getting Started
@@ -37,55 +68,33 @@ Follow the below steps to run the application on your device.
3768

3869
1. Clone the repo
3970
```sh
40-
git clone https://github.com/programmingwormhole/interactive_cares_lms.git
41-
```
42-
2. Open Project In IDE
43-
```sh
44-
Android Studio, VS Code, or any other Flutter Supported IDE
71+
git clone https://github.com/<your-username>/interactive_cares_lms.git
72+
cd interactive_cares_lms
73+
4574
```
46-
3. Get Dependencies
75+
2. Get Dependencies
4776
```js
4877
flutter pub get
4978
```
50-
4. Run
79+
3. Run
5180
```js
5281
flutter run
5382
```
5483

5584
<!-- ROADMAP -->
56-
## Key Features
57-
- [x] Authentication using RestAPI.
58-
- [x] Keep logged-in user by storing bearer token.
59-
- [x] Home Screen UI
60-
- [x] Bookmark screen with functionality
61-
- [x] Play a lesson from the bookmark to a specific time in the video.
62-
- [x] Enrolled Course Screen UI with functionality.
63-
- [x] Real-time course complete progress.
64-
- [x] Course modules
65-
- [x] Course lesson
66-
- [x] Previous or Next lesson system from the lesson screen
67-
- [x] Mark as complete a lesson
68-
- [x] After completing all lessons in a course students will get an animated dialogue to claim a certificate.
85+
## Role Based Authentication
86+
- On login, users are redirected to different dashboards based on their role.
87+
- For now, roles are stored in a local mock JSON (assets/json/fake_auth.json) for testing.
88+
- Future updates will connect to a backend API with real role-based authentication.
6989

7090
<!-- Package -->
71-
## Packages
72-
- [x] GetX (For State management)
73-
- [x] http (For API request)
74-
- [x] flutter_svg (To display SVG icon in the app)
75-
- [x] lottie (To display animation in the app)
76-
- [x] shared_preferences (To store data in local storage)
77-
- [x] google_fonts (To use custom fonts)
78-
- [x] carousel_slider (For creating an image slider)
79-
- [x] page_view_dot_indicator (To show a slider dot indicator)
80-
- [x] flutter_staggered_grid_view (To make a user-friendly grid view)
81-
- [x] video_player & chewie (To play video from network or assets)
82-
83-
84-
<!-- MARKDOWN LINKS & IMAGES -->
85-
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
86-
[Flutter]: https://camo.githubusercontent.com/b6d2d66adc138025ea9cdf8444cdc29a588c98d062c263f8651ba6b7ad46fef0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466c75747465722d2532333032353639422e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d466c7574746572266c6f676f436f6c6f723d7768697465
87-
[Flutter-url]: https://flutter.dev
88-
[Dart]: https://camo.githubusercontent.com/a0a1ad90011aa02e7e6f32be4998b8843f0884eed20b575c8a2189859550824d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646172742d2532333031373543322e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d64617274266c6f676f436f6c6f723d7768697465
89-
[Dart-url]: https://dart.dev
90-
[Download]: https://camo.envatousercontent.com/66cff805c4d35c74668291a51e21f978424565d9/68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f70726f6772616d6d696e67776f726d686f6c652f656e7661746f2f6d61696e2f64656d6f2e676966
91-
[Download-url]: https://raw.githubusercontent.com/programmingwormhole/interactive_cares_lms/main/lc_lms_demo.apk
91+
## Roadmap
92+
- [x]Connect role management to backend API
93+
- [x]Add course creation for lecturers
94+
- [x]Add course/user management for admins
95+
- [x]Enhance student dashboard with certificates & progress tracking
96+
97+
---
98+
## Credit
99+
* Original Project [Interactive Cares LMS](https://github.com/programmingwormhole/interactive_cares_lms)
100+
* Extended by [Septian Jauhariansyah](https://github.com/alchemista27)

assets/mock/fake_auth.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"username": "john_doe",
3+
"role": "student",
4+
"token": "abc123xyz"
5+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import 'dart:convert';
2+
import 'package:get/get.dart';
3+
import 'package:interactive_cares_lms/models/user_model.dart';
4+
import 'package:shared_preferences/shared_preferences.dart';
5+
6+
class AuthController extends GetxController {
7+
var currentUser = Rxn<UserModel>();
8+
9+
Future<void> login(String username, String password) async {
10+
// Fake API call (replace with real HTTP later)
11+
final fakeApiResponse = '''
12+
{
13+
"username": "$username",
14+
"role": "${username == 'admin' ? 'admin' : username == 'lecturer' ? 'lecturer' : 'student'}",
15+
"token": "mockToken123"
16+
}
17+
''';
18+
19+
final data = json.decode(fakeApiResponse);
20+
currentUser.value = UserModel.fromJson(data);
21+
22+
// Save user data
23+
SharedPreferences prefs = await SharedPreferences.getInstance();
24+
prefs.setString('user', json.encode(data));
25+
}
26+
27+
Future<void> loadUser() async {
28+
SharedPreferences prefs = await SharedPreferences.getInstance();
29+
if (prefs.containsKey('user')) {
30+
final data = json.decode(prefs.getString('user')!);
31+
currentUser.value = UserModel.fromJson(data);
32+
}
33+
}
34+
35+
Future<void> logout() async {
36+
SharedPreferences prefs = await SharedPreferences.getInstance();
37+
prefs.remove('user');
38+
currentUser.value = null;
39+
}
40+
}

lib/helpers/request_helpers.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
class RequestHelpers {
2-
static Map<String, String> header () {
2+
static Map<String, String> header() {
33
Map<String, String> header = {
4-
'Accept' : 'application/json',
4+
'Accept': 'application/json',
55
};
66

77
return header;
88
}
9-
}
9+
}

lib/main.dart

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import 'package:flutter/material.dart';
22
import 'package:get/get.dart';
3+
import 'package:interactive_cares_lms/controllers/auth_controller.dart';
34
import 'package:interactive_cares_lms/bindings/all_bindings.dart';
45
import 'package:interactive_cares_lms/routes/route_destinations.dart';
56
import 'package:interactive_cares_lms/routes/route_names.dart';
67
import 'package:interactive_cares_lms/utils/colors.dart';
78
import 'package:interactive_cares_lms/utils/config.dart';
9+
import 'package:interactive_cares_lms/views/Admin/admin_dashboard.dart';
10+
import 'package:interactive_cares_lms/views/Lecturer/lecturer_dashboard.dart';
11+
import 'package:interactive_cares_lms/views/Student/student_dashboard.dart';
12+
import 'package:interactive_cares_lms/views/Authentication/LoginScreen/login_screen.dart';
813

9-
void main() {
14+
15+
void main() async {
1016
WidgetsFlutterBinding.ensureInitialized();
17+
final authController = Get.put(AuthController());
18+
await authController.loadUser(); // ✅ allowed now
1119
AllBindings().dependencies();
1220
runApp(const MyApp());
1321
}
@@ -18,15 +26,18 @@ class MyApp extends StatelessWidget {
1826
@override
1927
Widget build(BuildContext context) {
2028
return GetMaterialApp(
21-
debugShowCheckedModeBanner: false,
22-
title: AppConfig.appName,
23-
theme: ThemeData(
24-
colorScheme: ColorScheme.fromSeed(seedColor: AppColors.primary),
25-
useMaterial3: true,
26-
scaffoldBackgroundColor: AppColors.background,
27-
),
28-
getPages: Routes.destination,
29-
initialRoute: RouteNames.initial,
30-
);
31-
}
32-
}
29+
initialBinding: AllBindings(),
30+
home: Obx(() {
31+
final user = Get.find<AuthController>().currentUser.value;
32+
if (user == null) {
33+
return LoginPage();
34+
} else if (user.role == 'admin') {
35+
return AdminDashboard();
36+
} else if (user.role == 'lecturer') {
37+
return LecturerDashboard();
38+
} else {
39+
return StudentDashboard();
40+
}
41+
}),
42+
);
43+

lib/models/category_model.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class CategoryModel {
44
String title;
55
String icon;
66

7-
CategoryModel ({required this.title, required this.icon});
7+
CategoryModel({required this.title, required this.icon});
88
}
99

1010
List<CategoryModel> getCategories = [
@@ -13,4 +13,4 @@ List<CategoryModel> getCategories = [
1313
CategoryModel(title: 'Editing', icon: ImageManager.video),
1414
CategoryModel(title: 'Development', icon: ImageManager.personalDevelopment),
1515
CategoryModel(title: 'Math', icon: ImageManager.math),
16-
];
16+
];

lib/models/user_model.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,32 @@ class UserModel {
33
String? fullName;
44
String? email;
55
String? password;
6+
String? role; //
67

78
UserModel({
89
this.username,
910
this.email,
1011
this.password,
1112
this.fullName,
13+
this.role,
1214
});
1315

1416
Map<String, dynamic> toJson() {
1517
return {
16-
'full_name' : fullName,
18+
'full_name': fullName,
1719
'username': username,
1820
'email': email,
1921
'password': password,
22+
'role': role,
2023
};
2124
}
25+
26+
factory UserModel.fromJson(Map<String, dynamic> json) {
27+
return UserModel(
28+
username: json['username'],
29+
fullName: json['full_name'],
30+
email: json['email'],
31+
role: json['role'],
32+
);
33+
}
2234
}

lib/routes/route_destinations.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class Routes {
1919
GetPage(name: RouteNames.home, page: () => const BottomBarView()),
2020
GetPage(name: RouteNames.courseLearn, page: () => const LearningScreen()),
2121
GetPage(name: RouteNames.lesson, page: () => const LessonScreen()),
22-
GetPage(name: RouteNames.bookmarkPlayer, page: () => const BookmarkPlayerScreen()),
22+
GetPage(
23+
name: RouteNames.bookmarkPlayer,
24+
page: () => const BookmarkPlayerScreen()),
2325
];
24-
}
26+
}

lib/routes/route_names.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ class RouteNames {
88
static const String courseLearn = '/courseLearn';
99
static const String lesson = '/lesson';
1010
static const String bookmarkPlayer = '/bookmark-player';
11-
}
11+
}

lib/utils/app_urls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ class AppUrls {
55
static const String apiUrl = '${AppConfig.baseUrl}/api/$apiVersion';
66
static Uri login = Uri.parse('$apiUrl/login');
77
static Uri register = Uri.parse('$apiUrl/register');
8-
}
8+
}

0 commit comments

Comments
 (0)