Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 74 additions & 16 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,82 @@
# Intranet of schools
# Intranet of Schools (INS) Project Context

The intranet of schools is a flutter project worked on by the 'Record Breakers'.
It is a flutter application made to work on android, linux and the web. It communicates
with a web backend via hooks exported from lib/backend.dart.
This document provides essential context for the "Intranet of Schools" Flutter project to aid in development and maintenance.

## project structure
## 1. Project Overview

source code in lib/, arb translations at lib/l19n, backend models at lib/models/ . utility
widgets at lib/widgets/, utilities at lib/utils, app at lib/app.dart, theme at lib/theme.dart.
- **Name:** `ins` (Intranet of Schools)
- **Description:** A responsive Flutter application providing a user interface for the Intranet of Schools platform. It's designed for managing user accounts, interacting with platform features, and accessing school-related information across mobile, web, and desktop.
- **Target Platforms:** Android, iOS, Linux, macOS, Windows, and Web.

## startup
## 2. Project Structure

When the app startups, the app state is loaded using utilities at lib/appstate.dart
Where is stored the session, user, and other date.
The project follows a standard Flutter structure.

When a user has signin or signup using the two assistant pages folders at lib/sign/signup/ and lib/sign/signin/
a session and/or user is created and saved in appstate.
If the user is login, depending if he integrated school or not and the role in the school,
it opens the set of pages at lib/pages/dashboard/*/.
- `lib/`: Main application source code.
- `main.dart`: Application entry point.
- `app.dart`: Root application widget and setup.
- `appstate.dart`: Manages global application state (session, user data) likely using `provider`.
- `backend.dart`: Contains hooks and functions for communicating with the backend API.
- `models/`: Data models for entities like `User`, `School`, `Session`, `ChatMessage`, etc.
- `pages/`: UI screens for different parts of the app (e.g., `home`, `signin`, `dashboard`).
- `widgets/`: Reusable UI components (e.g., `locale_chooser`, `loading`).
- `utils/`: Utility functions (e.g., `logger`, `email_validator`).
- `theme.dart`: Application-wide theme and styling.
- `l10n/`: Localization files.
- `assets/`: Static assets.
- `assets/icon/`: Application icons.
- `test/`: Widget and unit tests.
- Platform-specific directories: `android/`, `ios/`, `linux/`, `macos/`, `windows/`, `web/`.

## assets
## 3. Dependencies

app assets are at assets, icons at assets/icons/ and the app icon at assets/icons/is.png
Key dependencies from `pubspec.yaml`:

- **State Management:**
- `provider`: For managing application state.
- **UI & UX:**
- `google_fonts`: For custom fonts.
- `cupertino_icons`: iOS style icons.
- `flutter_markdown`: To render Markdown content.
- `cached_network_image`: To display and cache network images.
- `transparent_image`: For placeholder images.
- `intl_phone_number_input`: For formatted phone number input.
- **Networking & Backend:**
- `http`: For making HTTP requests to the backend.
- **Storage:**
- `shared_preferences`: For simple key-value storage.
- **Utilities:**
- `url_launcher`: To launch URLs.
- `logger`: For application logging.
- **Localization:**
- `flutter_localizations` & `intl`: For internationalization and localization.

## 4. Code Style and Linting

- The project uses the standard `package:flutter_lints/flutter.yaml` ruleset.
- Custom linting rules can be configured in `analysis_options.yaml`.

## 5. Localization (l10n)

- **Configuration:** `l10n.yaml`
- **Source Directory:** `lib/l10n`
- **Template File:** `app_en.arb` (English)
- **Process:** The app supports internationalization. New translations should be added as `.arb` files in `lib/l10n/` and code generation must be run to update localizations.

## 6. Build & Deployment

- **Firebase Hosting:** The project is configured to deploy the web build to Firebase Hosting.
- The public directory is `build/web`.
- Configuration is in `firebase.json`.
- **CI/CD:** A GitHub Actions workflow is set up in `.github/workflows/firebase-hosting-pull-request.yml`.
- **Trigger:** On pull requests to the main repository.
- **Job:** It builds the Flutter web application (`flutter build web`) and deploys it to a Firebase Hosting preview channel.
- **Secrets:** Requires `FIREBASE_SERVICE_ACCOUNT_INTRANET_OF_SCHOOLS` for deployment.

## 7. Application Startup Flow

1. The app starts via `main.dart`.
2. The global `AppState` is loaded from `appstate.dart`, which likely restores session/user data from `shared_preferences`.
3. If a user is not logged in, they are directed to the sign-in/sign-up pages (`lib/pages/sign/`).
4. Upon successful login, a session and user object are created and stored in `AppState`.
5. The user is then navigated to the appropriate dashboard (`lib/pages/dashboard/`) based on their role and school association.
Empty file.
Empty file.
3 changes: 2 additions & 1 deletion android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ android {
applicationId = "cm.rbs.ins"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
minSdk = 21
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
multiDexEnabled = true
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.ins
package cm.rbs.ins

import io.flutter.embedding.android.FlutterActivity

Expand Down
80 changes: 58 additions & 22 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -1,36 +1,72 @@
{
"acceptContinue": "Accept & Continue",
"contactInformation": "Contact Information",
"accountCreatedSuccesfuly": "#Account succefsully created",
"invalidDomainComponent": "Invalid domain component",
"loadingTerms": "Loading terms of service",
"passwordsDoNotMatch": "Passwords do not match",
"noSchoolFound": "No school found",
"nothingHere": "Nothing here",
"errorLoadingYourDashboard": "Error loading your dashboard",
"fullName": "Full name",
"welcomeToIS": "Welcome to IS",
"emailShouldContain1": "Email should contain 1 '@'",
"whatDoYouWantToApplyFor": "What do you want to apply for?",
"wasNotTranslated": "Was not translated",
"students": "Students",
"sloganShort": "Empowering connections, empowering futures",
"emailAddress": "Email address",
"optionalInformations": "Optional information",
"reenterPassword": "Reenter password",
"accountCreatedSuccesfuly": "Account created succesfuly",
"optionalInformations": "#Informations optionnelles",
"waitingMessages": "We're getting this done...|Please wait a little more...|Things are going as expected...|...|Wait once more...|A few moments...",
"pleaseReviewAndAcceptOurTermsAndConditionsToContinue": "Please review and accept our terms and conditions to continue.",
"signupAssistant_phoneNumberError": "Phone number should be 9 digits long (without country code)",
"loadingTerms": "Loading terms of service",
"homeLoadingMessages": "Loading app state...|Verifying user details...|Getting permissions from your schools..|Verifying the age on your birth certificate...|Please wait...|Almost there...",
"passwordsDoNotMatch": "Password do not match",
"invalidEmailDomainsecondPart": "#Domaine de l'e-mail invalide (deuxième partie)",
"couldNotGetSchooolApplicationForms": "#Nous n'avons pas pu recevoid les formulaires d'inscription",
"passwordShouldHaveAtLeast8Characters": "Password should have at least 8 characters length",
"rating": "Rating",
"openDashboard": "Open dashboard",
"username": "Username",
"addEmailaoPhoneNumber": "Add email and/or phone number",
"loginInformations": "Login information",
"editPreferences": "Edit Preferences",
"addEmailaoPhoneNumber": "#Renseigner une adresse e-mail et/ou un numéro de téléphone",
"campus": "Campus",
"applyNow": "Apply Now",
"usernameDesc": "A short public name visible by others",
"usernameMustHaveBetween4And20Characters": "Username must have between 3 and 20 characters",
"usernameMustHaveBetween4And20Characters": "###Le nom d'utilisateur doit contenir entre 3 et 20 caractères",
"helloWorldOfThings": "hello world of things",
"password": "Password",
"thisUsernameIsAlreadyTaken": "This username is already taken",
"fullName": "Full name",
"creatingYourAccount": "Creating you account",
"welcomeToIS": "Welcome to IS",
"welcomeConnectOrCreateAccount": "Connect an existing account or create a new one to embark on your journey with us",
"connectAccount": "Connect account",
"usernameMustHaveBetween3And20Characters": "Username must have between 3 and 20 characters",
"emailShouldContain": "Email should contain '@'",
"continueGt": "Continue >",
"accountCreatedSuccessfully": "Account created successfully",
"emailAddress": "Email address",
"optionalInformation": "Optional information",
"pleaseReviewAndAcceptOurTermsAndConditionsToContinue": "Please review and accept our terms and conditions to continue.",
"signupAssistant_phoneNumberError": "Phone number should be 9 digits long (without country code)",
"online": "Online",
"homeLoadingMessages": "Loading app state...|Verifying user details...|Getting permissions from your schools..|Verifying the age on your birth certificate...|Please wait...|Almost there...",
"atAGlance": "At a Glance",
"browseSchools": "Browse Schools",
"thisUsernameIsAlreadyTaken": "This username is already taken",
"creatingYourAccount": "Creating your account",
"emailNameTooShort": "Email name too short",
"loadingYourDashboard": "Loading your dashboard",
"couldNotGetSchoolApplicationForms": "Could not get school application forms",
"welcomeExcl": "Welcome!",
"schoolApplication": "School Application",
"noDescriptionProvided": "No description provided.",
"errorLoadingTerms": "Error loading terms of service",
"areWeGoing": "Are we going?",
"editProfile": "Edit Profile",
"reenterPassword": "Re-enter password",
"username": "Username",
"loginInformations": "Login information",
"invalidCharacterInEmail": "Invalid character in email ",
"exploreSchools": "Explore Schools",
"invalidEmailDomainSecondPart": "Invalid email domain (second part)",
"iHaveReadAndAgreeToTheTermsAndConditions": "I have read and agree to the terms and conditions.",
"welcomeConnectOrCreateAccount": "Connect an existing account or create a new one to embark on your journey with us",
"phoneNumber": "Phone number",
"termsAndConditions": "Terms and Conditions",
"continueGt": "Continue >",
"passwordShouldHaveAtleast8Characters": "Password should have atleast 8 characters length",
"addEmailOrPhoneNumber": "Add email or phone number",
"establishedIn2023": "Established in 2023",
"passwordShouldHaveAtleast8Characters": "#Le mot de passe doit contenir au moins 8 caractères",
"createAccount": "Create an account",
"errorLoadingTerms": "Error loading terms of service",
"wasNotTranslated": "Was not translated",
"retry": "Retry"
}
98 changes: 67 additions & 31 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
@@ -1,36 +1,72 @@
{
"sloganShort": "Construire des liens puissants, bâtir des avenirs prometteurs",
"emailAddress": "Addresse email",
"optionalInformations": "Informations optionelles",
"reenterPassword": "Re-entrez votre mot de passe",
"accountCreatedSuccesfuly": "Compte cree avec succes",
"waitingMessages": "Nous ourons bientot fini...|Attendez encore un peu...|Tout ce passe bien...|...|Un peu plus de temps...|Quelques instants d'attente...",
"pleaseReviewAndAcceptOurTermsAndConditionsToContinue": "#Please review and accept our terms and conditions to continue.",
"signupAssistant_phoneNumberError": "Le numero devrais faire 9 chiffres de long (Sans code iso)",
"loadingTerms": "#Loading terms of service",
"homeLoadingMessages": "Verification des details d'utilisateur...|Acquisition de permission de votre ecole..|Veuillez patienter...|Nous y sommes presque...",
"passwordsDoNotMatch": "Les mot-de-passe ne coincident pas",
"openDashboard": "Ouvrir le tableaux de bord",
"username": "Nom d'utilisateur",
"addEmailaoPhoneNumber": "Renseigner une addresse email et/ou numero de telephone",
"loginInformations": "Informations de connection",
"usernameDesc": "Un surnom court, et visible des autres",
"usernameMustHaveBetween4And20Characters": "Le nom d'utilisateur doit faire entre 3 et 20 characteres de long",
"helloWorldOfThings": "hello world of things",
"password": "Mot de passe",
"thisUsernameIsAlreadyTaken": "Ce nom d'utilisateur est deja prit",
"acceptContinue": "Accepter & Continuer",
"contactInformation": "Informations de contact",
"accountCreatedSuccesfuly": "##Account succefsully created",
"invalidDomainComponent": "Composant de domaine invalide",
"loadingTerms": "Chargement des conditions d'utilisation",
"passwordsDoNotMatch": "Les mots de passe ne correspondent pas",
"noSchoolFound": "Aucune école trouvée",
"nothingHere": "Rien ici",
"errorLoadingYourDashboard": "Erreur lors du chargement de votre tableau de bord",
"fullName": "Nom complet",
"creatingYourAccount": "Nous creons votre compte",
"welcomeToIS": "Bienvenue sur IS",
"welcomeConnectOrCreateAccount": "Connectez un compte existant ou creez en un nouveau pour utiliser IS",
"connectAccount": "Connectez votre compte",
"welcomeExcl": "Bienvenue!",
"phoneNumber": "Numero de telephone",
"termsAndConditions": "#Terms and Conditions",
"emailShouldContain1": "L'e-mail doit contenir un '@'",
"whatDoYouWantToApplyFor": "Pour quoi voulez-vous postuler ?",
"wasNotTranslated": "N'a pas été traduit",
"students": "Étudiants",
"sloganShort": "Des liens forts, un avenir prometteur",
"optionalInformations": "##Informations optionnelles",
"waitingMessages": "Nous aurons bientôt fini...|Attendez encore un peu...|Tout se passe bien...|...|Un peu plus de temps...|Quelques instants d'attente...",
"invalidEmailDomainsecondPart": "##Domaine de l'e-mail invalide (deuxième partie)",
"couldNotGetSchooolApplicationForms": "##Nous n'avons pas pu recevoid les formulaires d'inscription",
"passwordShouldHaveAtLeast8Characters": "Le mot de passe doit contenir au moins 8 caractères",
"rating": "Évaluation",
"openDashboard": "Ouvrir le tableau de bord",
"editPreferences": "Modifier les préférences",
"addEmailaoPhoneNumber": "##Renseigner une adresse e-mail et/ou un numéro de téléphone",
"campus": "Campus",
"applyNow": "Postuler maintenant",
"usernameDesc": "Un surnom court, et visible des autres",
"usernameMustHaveBetween4And20Characters": "####Le nom d'utilisateur doit contenir entre 3 et 20 caractères",
"helloWorldOfThings": "Salut le monde des choses",
"password": "Mot de passe",
"connectAccount": "Connecter votre compte",
"usernameMustHaveBetween3And20Characters": "Le nom d'utilisateur doit contenir entre 3 et 20 caractères",
"emailShouldContain": "L'e-mail doit contenir '@'",
"continueGt": "Continuer >",
"passwordShouldHaveAtleast8Characters": "Le mot-de-passe doit faire au moins 8 characteres de long",
"createAccount": "Creez un compte",
"errorLoadingTerms": "#Error loading terms of service",
"wasNotTranslated": "#Was not translated",
"retry": "Reessayer"
"accountCreatedSuccessfully": "Compte créé avec succès",
"emailAddress": "Adresse e-mail",
"optionalInformation": "Informations optionnelles",
"pleaseReviewAndAcceptOurTermsAndConditionsToContinue": "Veuillez consulter et accepter nos conditions d'utilisation pour continuer.",
"signupAssistant_phoneNumberError": "Le numéro de téléphone doit comporter 9 chiffres (sans l'indicatif du pays)",
"online": "En ligne",
"homeLoadingMessages": "Chargement de l'état de l'application...|Vérification des détails de l'utilisateur...|Obtention des autorisations de vos écoles...|Vérification de l'âge sur votre acte de naissance...|Veuillez patienter...|Presque là...",
"atAGlance": "En un coup d'œil",
"browseSchools": "Parcourir les écoles",
"thisUsernameIsAlreadyTaken": "Ce nom d'utilisateur est déjà pris",
"creatingYourAccount": "Création de votre compte",
"emailNameTooShort": "Nom d'e-mail trop court",
"loadingYourDashboard": "Chargement de votre tableau de bord",
"couldNotGetSchoolApplicationForms": "Impossible de récupérer les formulaires de demande d'école",
"welcomeExcl": "Bienvenue !",
"schoolApplication": "Candidature scolaire",
"noDescriptionProvided": "Aucune description fournie.",
"errorLoadingTerms": "Erreur de chargement des conditions d'utilisation",
"areWeGoing": "On y va ?",
"editProfile": "Modifier le profil",
"reenterPassword": "Retapez votre mot de passe",
"username": "Nom d'utilisateur",
"loginInformations": "Informations de connexion",
"invalidCharacterInEmail": "Caractère invalide dans l'e-mail",
"exploreSchools": "Explorer les écoles",
"invalidEmailDomainSecondPart": "Domaine de l'e-mail invalide (deuxième partie)",
"iHaveReadAndAgreeToTheTermsAndConditions": "J'ai lu et j'accepte les conditions d'utilisation.",
"welcomeConnectOrCreateAccount": "Connectez un compte existant ou créez-en un nouveau pour commencer votre voyage avec nous",
"phoneNumber": "Numéro de téléphone",
"termsAndConditions": "Conditions d'utilisation",
"addEmailOrPhoneNumber": "Ajouter une adresse e-mail ou un numéro de téléphone",
"establishedIn2023": "Établi en 2023",
"passwordShouldHaveAtleast8Characters": "##Le mot de passe doit contenir au moins 8 caractères",
"createAccount": "Créer un compte",
"retry": "Réessayer"
}
Loading