Skip to content
@ZamzamApplication

ZamzamApplication

Zamzam Application

A local-first mobile application for tracking halaqa (Islamic study circle) progress, designed to work offline with seamless synchronization to a backend API.

Overview

Zamzam Application enables users to manage organizations, halaqat, and track daily learning progress. The app prioritizes offline functionality, storing data locally on the device and syncing changes when connectivity is available. This ensures uninterrupted usage in areas with poor internet access.

Architecture

The application consists of two main components:

Backend (zamzam-api)

  • Framework: Spring Boot 3.5.6 with Java 21
  • Database: PostgreSQL with JPA/Hibernate
  • Security: JWT-based authentication
  • Features: RESTful API for user management, organizations, halaqat, and progress tracking
  • Sync: Incremental sync endpoint for data synchronization

Frontend (zamzam-flutter)

  • Framework: Flutter with Dart 3.9+
  • Database: SQLite for local storage
  • State Management: Provider pattern
  • Features: Offline-first UI with automatic sync
  • Connectivity: Checks network status for sync operations

Features

  • User Authentication: Secure login/logout with JWT tokens
  • Organization Management: Create and join organizations
  • Halaqa System: Manage study circles with member assignments
  • Progress Tracking: Record daily learning progress (hifz, revision, remarks)
  • Offline Support: Full functionality without internet connection
  • Automatic Sync: Background synchronization when online
  • Cross-Platform: iOS and Android support

Tech Stack

Backend

  • Spring Boot 3.5.6
  • Java 21
  • PostgreSQL
  • Spring Security
  • Maven
  • Docker

Frontend

  • Flutter 3.9+
  • Dart
  • SQLite (sqflite)
  • Provider
  • HTTP client
  • Connectivity checking

Prerequisites

  • Backend:

    • Java 21 or higher
    • Maven 3.6+
    • Docker and Docker Compose
    • PostgreSQL (or use Docker)
  • Frontend:

    • Flutter SDK 3.9+
    • Android Studio or Xcode for mobile development
    • Android/iOS device or emulator

Setup

1. Clone the Repository

git clone <repository-url>
cd zamzamapplication

2. Backend Setup

Navigate to the backend directory:

cd zamzam-api

Option A: Using Docker (Recommended)

docker-compose up --build

This will start PostgreSQL and the Spring Boot API.

Option B: Manual Setup

  1. Install PostgreSQL and create a database:

    CREATE DATABASE zamzam_db;
    CREATE USER zamzam_user WITH PASSWORD 'zamzam_password';
    GRANT ALL PRIVILEGES ON DATABASE zamzam_db TO zamzam_user;
  2. Configure Database: Update src/main/resources/application.properties if needed (default is set for Docker).

  3. Run the Application:

    mvn clean install
    mvn spring-boot:run

The API will be available at http://localhost:8080.

3. Frontend Setup

Navigate to the frontend directory:

cd ../zamzam-flutter
  1. Install Dependencies:

    flutter pub get
  2. Run the Application:

    flutter run

This will launch the app on connected device/emulator.

API Documentation

  • Swagger UI: Available at http://localhost:8080/swagger-ui.html when backend is running
  • Postman Collection: Import zamzam-api/zamzam-api.postman_collection.json
  • Sync Endpoint: GET /api/sync?since=<timestamp> for incremental data sync

Project Structure

zamzamapplication/
├── zamzam-api/              # Spring Boot backend
│   ├── src/main/java/com/zamzam/zamzamapi/
│   │   ├── controller/      # REST endpoints
│   │   ├── entity/          # JPA entities
│   │   ├── repository/      # Data access
│   │   ├── service/         # Business logic
│   │   └── dto/            # Data transfer objects
│   ├── src/main/resources/
│   │   └── application.properties
│   ├── pom.xml
│   ├── docker-compose.yml
│   └── README.md
├── zamzam-flutter/          # Flutter frontend
│   ├── lib/
│   │   ├── models/          # Data models
│   │   ├── pages/           # UI screens
│   │   ├── services/        # API and sync services
│   │   ├── providers/       # State management
│   │   └── database/        # Local DB helper
│   ├── pubspec.yaml
│   └── README.md (if exists)
└── README.md                # This file

Development

Backend Testing

cd zamzam-api
mvn test

Frontend Testing

cd zamzam-flutter
flutter test

Linting

cd zamzam-flutter
flutter analyze

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Guidelines

  • Follow existing code style
  • Write tests for new features
  • Update documentation as needed
  • Ensure offline functionality works

TODO

Backend

  • Add CI/CD pipeline
  • Write comprehensive tests
  • Move JWT secret to environment variables
  • Fix sync POST endpoint

Frontend

  • Implement forget password functionality
  • Add logout in burger menu
  • Complete organization and halaqa pages
  • Finalize API integration and storage

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For questions or support, please open an issue in the repository.

Popular repositories Loading

  1. .github .github Public

    .github repo for the zamzam application

Repositories

Showing 1 of 1 repositories

Top languages

Loading…

Most used topics

Loading…