Skip to content

SiddDevCS/ZermeloSwiftIntegration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZermeloSwiftIntegration

A Swift integration for Zermelo API, allowing users to authenticate, fetch their schedules, and manage their school timetable seamlessly. This project showcases how to interact with the Zermelo API using Swift and SwiftUI.

Features

  • OAuth Authentication with Zermelo API
  • Fetch and display schedules dynamically
  • QR Code Scanning for quick authentication
  • User session persistence using UserDefaults
  • Clean and modular Swift codebase

Installation

  1. Clone the repository:
    git clone https://github.com/Siddharth11sehgal/ZermeloSwiftIntegration.git
    cd ZermeloSwiftIntegration
    
    

🔑 Authentication

Zermelo uses OAuth for authentication. Users can:

  • Enter their school name and auth code manually.
  • Scan a QR code to automatically fetch authentication details.

Example: Authenticate with Zermelo API

Task {
    do {
        try await ZermeloAuthManager.shared.authenticate(code: "YOUR_AUTH_CODE", school: "YOUR_SCHOOL_NAME")
    } catch {
        print("Authentication failed: \(error)")
    }
}

📆 Fetching Schedule

Retrieve your school schedule using:

let appointments = try await ZermeloManager.shared.fetchSchedule(start: startTime, end: endTime)

🏗 Project Structure

  • ZermeloAuthView.swift → Handles user authentication (manual & QR code).
  • ZermeloAuthManager.swift → Manages OAuth token storage and authentication.
  • ZermeloManager.swift → Fetches schedules from the API.
  • ZermeloModels.swift → Defines data structures for Zermelo responses.

📝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m "Add new feature").
  4. Push and submit a Pull Request.

📜 License

This project is licensed under the MIT License.


📬 Contact

If you have questions, reach out via GitHub or email me at [email protected].

About

Fetching school lessons data using Zermelo API and Swift!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages