- π Introduction
- π οΈ Technology Stack
- π§± Architecture Overview
- ποΈ Folder Structure
- π± UI Pages and Workflows
- π Login
- π Signup
- π Home
- π₯ Groups
- π Group Detail
- π Notifications
- πββοΈ Profile
- π API Integration
- πΎ State Management and Session Handling
- π‘οΈ Validation and Error Handling
- π§ͺ Setup Instructions
- π Useful Links
StudyFi is a cross-platform academic collaboration app built with Flutter. It enables students to create or join study groups, share academic materials, post updates, and receive notifications. The frontend communicates with a robust Spring Boot microservice backend.
| Layer | Technology |
|---|---|
| UI Framework | Flutter |
| Programming Lang | Dart |
| State Persistence | SharedPreferences |
| HTTP Requests | http package |
| Image Upload | Cloudinary (via backend) |
| Platform Support | Android, iOS, Web |
- Flutter App β sends API requests to API Gateway (Spring Cloud Gateway)
- API Gateway routes requests to services:
User & Group Service(Authentication, Profile, Group)Content & News Service(Files, Posts, News)Notification Service(Alerts)
- Response β processed in Flutter and stored (e.g., SharedPreferences)
lib/
βββ components/ # Reusable widgets (buttons, text fields, etc.)
βββ models/ # Data models (User, Group, Post, etc.)
βββ screens/ # UI pages (Login, Signup, Home, etc.)
βββ services/ # API communication (ApiService)
βββ constants.dart # Colors, fonts, sizes
βββ main.dart # App entry point and route management
- Purpose: Authenticate users using email and password.
- Components:
- Email/Password fields
- Login button
- Links: Signup, Forgot password
- Features:
- Input validation
- API POST to
/users/login - Store user session (SharedPreferences)
- Redirect to HomePage
- Purpose: Register new users with personal and academic info.
- Fields: name, email, password, DOB, phone, address, country, AboutMe, profile & cover images
- Flow:
- Validates form
- Submits multipart request to
/users/register - Uploads files to Cloudinary (via backend)
- Redirects to login page on success
- Purpose: Acts as a navigation hub using a bottom navigation bar.
- Tabs: Home, Groups, Notifications, Profile
- Behavior:
- Displays default home view
- Navigates using
NavigatororPageController
- Purpose: List all groups joined by the user.
- Features:
- Fetches
/groups/user/{userId} - Displays cards with image, name, description
- Search bar for filtering groups
- Clickable cards open Group Detail Page
- Fetches
- Tabs: Contents, Posts, Members, News
- Features:
- Contents: Upload/download academic files (PDF, DOCX, etc.)
- Posts: View/create posts, like, comment
- News: Post updates, view group activities
- Members: View group members
- Edit Group: If admin, update group info
- APIs Used:
/content/upload,/news/post,/chats/groups/{groupId}/posts, etc.
- Purpose: Show user-specific notifications
- Features:
- Fetch from
/notifications/getnotifications/{userId} - Supports marking as read
- Clickable for redirection to target (group/post)
- Fetch from
- Purpose: View and update user profile
- Features:
- Display profile info + images
- Edit functionality with API:
/users/profile/{userId} - Images uploaded to Cloudinary
The ApiService class communicates with the backend through the following endpoints:
POST /users/loginβ Login userPOST /users/registerβ Register new userPOST /users/forgot-passwordβ Send password reset linkPOST /users/reset-passwordβ Reset user passwordGET /users/$userIdβ Get user profilePUT /users/profile/$userIdβ Update user profile
POST /email-verification/send-email-codeβ Send verification codePOST /email-verification/validate-email-codeβ Verify entered code
GET /groups/user/$userIdβ Get groups joined by userGET /groups/notjoined/user/$userIdβ Get groups not joined by userPOST /groups/createβ Create a new groupPUT /groups/update/$groupIdβ Update a groupDELETE /groups/remove/$groupId/user/$userIdβ Remove user from groupGET /groups/$groupId/countsβ Get group content, news, member countsGET /groups/$groupId/usersβ Get all users in a group
POST /content/uploadβ Upload academic filesGET /content/group/$groupIdβ Get files for a group
GET /news/group/$groupIdβ Get all news for a groupPOST /news/postβ Post a news update
POST /chats/groups/$groupId/postsβ Add a new post in groupPOST /chats/posts/$postId/commentsβ Add comment to a postPOST /chats/posts/$postId/likesβ Like a postGET /chats/posts/$postId/likes?userId=$userIdβ Get all likes on a postGET /chats/posts/$postId/likes?currentUserId=$userIdβ Check if current user liked
GET /notifications/getnotifications/$userIdβ Fetch user notificationsPUT /notifications/markallasread/$userIdβ Mark all notifications as read
- User data is saved locally using
SharedPreferences - Keys like
userId,email,token(if any) are persisted - Session persists across app restarts unless explicitly logged out
- Input validation: email format, required fields, password strength
- Error messages:
- Invalid login:
"Incorrect email or password" - Server error:
"Please check your connection"
- Invalid login:
- Fallbacks:
- Default images for null profile/group images
- Try-catch blocks on network calls
- Flutter SDK (3.x)
- Dart SDK
- Android Studio or VS Code
git clone https://github.com/studyfi/StudyFi_Frontend.git
cd StudyFi_Frontend
flutter pub get
flutter run