-
Notifications
You must be signed in to change notification settings - Fork 0
Development Guide
This guide is for developers who want to contribute to AkademiTrack or understand its technical architecture.
Repository: https://github.com/CyberGutta/AkademiTrack
Tech Stack:
- Language: C# (.NET)
- UI Framework: Avalonia UI (cross-platform)
- HTTP Client: Built-in HttpClient
- Web Automation: Selenium WebDriver (for authentication)
- Update System: Velopack
Project Structure:
-
Services/- Program services -
Services/Interfaces- Program interfaces -
Views/- Avalonia AXAML UI views -
ViewModels/- MVVM view models -
Assets/- Images, icons, resources -
build_windows.py- Windows build script -
build-mac.py- macOS build script -
build-linux.py- Linux build script
- .NET SDK - Version 6.0 or later
- Git - For cloning the repository
- IDE - Visual Studio, Rider, or VS Code with C# extensions
- Python 3.x - For build scripts
git clone https://github.com/CyberGutta/AkademiTrack.git
cd AkademiTrack- Open
AkademiTrack.sln - Restore NuGet packages
- Build → Build Solution
- Run/Debug
Windows:
dotnet restore
dotnet build
dotnet runmacOS:
dotnet restore
dotnet build
dotnet runLinux:
dotnet restore
dotnet build
dotnet runFor production builds:
Windows:
python build_windows.pymacOS:
python build-mac.pyLinux:
python build-linux.pyBuild scripts handle:
- Compilation
- Packaging
- Icon management
- Creating distribution archives
AkademiTrack uses the MVVM (Model-View-ViewModel) pattern:
-
Views (
Views/) - AXAML files defining UI -
ViewModels (
ViewModels/) - Logic and state management - Models - Data structures (implicitly throughout)
MainWindow - Primary application window
- Start/Stop automation buttons
- Activity log display
- Status updates
FeideWindow - First-time setup for Feide credentials
- School selection dropdown
- Username/password input
- Encrypted credential storage
SettingsWindow - Configuration interface
- General settings
- Automation preferences
- Update management
Authentication System
- Selenium-based Feide login
- Cookie management
- Credential encryption
Schedule Fetching
- iSkole API integration
- Daily schedule retrieval
- STU session identification
Conflict Detection
- Compares STU sessions with regular schedule
- Identifies overlapping time periods
- Automatically skips conflicts
Registration System
- Window timing calculation
- Automatic attendance registration
- Error handling and retries
Notification System
- Queue-based notification management
- Priority handling
- Cross-platform notifications
Update System
- Velopack integration
- Automatic update checks (every 10 minutes)
- Background downloads
- Automatic installation and restart
Logging System
- Timestamped activity logs
- Multiple log levels (INFO, WARNING, ERROR, DEBUG)
- Automatic log cleanup
- File-based persistent logging
- Create a branch for your feature or fix
git checkout -b feature/your-feature-name-
Make your changes following the coding standards
-
Test thoroughly on your target platform(s)
-
Commit with clear messages
git add .
git commit -m "Add: Description of your changes"- Push to your fork
git push origin feature/your-feature-name- Create a Pull Request on GitHub
Use clear, descriptive commit messages:
Add: New feature descriptionFix: Bug fix descriptionUpdate: Changes to existing featureRefactor: Code restructuringDocs: Documentation updates
Example:
Fix: Resolve login timeout issue on slow connections
- Increased timeout from 30s to 60s
- Added retry logic for failed requests
- Improved error messages
Manual Testing Checklist:
- Test on target platform (Windows/macOS/Linux)
- Test first-time setup flow
- Test normal automation cycle
- Test with no STU sessions
- Test with conflicting sessions
- Test settings changes
- Test update mechanism
- Test error scenarios
Platform-Specific Testing:
- Windows: Test on Windows 10 and 11
- macOS: Test on macOS 10.15+
- Linux: Test on Ubuntu and Fedora
C# Conventions:
- Use PascalCase for classes, methods, properties
- Use camelCase for local variables, parameters
- Use meaningful variable names
- Add XML documentation comments for public APIs
- Keep methods focused and reasonably sized
Example:
/// <summary>
/// Fetches the schedule for the specified date.
/// </summary>
/// <param name="date">The date to fetch schedule for</param>
/// <returns>List of schedule sessions</returns>
public async Task<List<Session>> FetchScheduleAsync(DateTime date)
{
// Implementation
}AXAML/UI:
- Use proper spacing and indentation
- Group related UI elements
- Use meaningful x:Name attributes
- Comment complex layouts
AkademiTrack interacts with iSkole's API endpoints:
Authentication:
- Uses Feide SSO via Selenium
- Captures authentication cookies
- Maintains session across requests
Schedule Endpoint:
- Fetches daily schedule data
- Returns JSON with all sessions
- Includes timing and metadata
Registration Endpoint:
- Submits attendance registration
- Requires valid session cookies
- Returns success/failure status
Important Notes:
- Respect rate limits (one schedule fetch per day)
- Handle errors gracefully
- Don't overload iSkole servers
Used for Feide authentication:
// Example structure (simplified)
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
var driver = new ChromeDriver();
driver.Navigate().GoToUrl(feideLoginUrl);
// User logs in manually
// Extract cookies after successful login
var cookies = driver.Manage().Cookies.AllCookies;Browser drivers:
- ChromeDriver for cross-platform support
- Headless mode for background operation
- Automatic driver management
Update system integration:
// Example structure (simplified)
var updateManager = new UpdateManager(githubRepoUrl);
var updateInfo = await updateManager.CheckForUpdatesAsync();
if (updateInfo != null)
{
await updateManager.DownloadUpdatesAsync(updateInfo);
updateManager.ApplyUpdatesAndRestart(updateInfo);
}- Update Settings Model
public class AppSettings
{
public bool ExistingSetting { get; set; }
public bool NewSetting { get; set; } // Add this
}- Update SettingsWindow AXAML
<CheckBox IsChecked="{Binding NewSetting}">
New Setting Description
</CheckBox>- Update ViewModel
public bool NewSetting
{
get => _settings.NewSetting;
set
{
_settings.NewSetting = value;
OnPropertyChanged();
SaveSettings();
}
}-
Implement Feature Logic where needed
-
Test thoroughly
-
Update documentation (wiki pages)
- Define the endpoint in your API client class
public async Task<Response> NewEndpointAsync()
{
var response = await _httpClient.GetAsync(endpoint);
return await response.Content.ReadAsAsync<Response>();
}- Add error handling
try
{
var result = await NewEndpointAsync();
}
catch (HttpRequestException ex)
{
Logger.Error($"API call failed: {ex.Message}");
}-
Test with real API
-
Document behavior
In development, enable detailed logging:
Logger.SetLevel(LogLevel.Debug);Authentication Issues:
- Check Selenium driver output
- Verify cookie extraction
- Test with manual browser login
API Issues:
- Log full request/response
- Check HTTP status codes
- Verify endpoint URLs
UI Issues:
- Use Avalonia DevTools
- Check binding errors
- Verify AXAML syntax
- Avalonia DevTools - UI inspection and debugging
- Fiddler/Postman - HTTP request inspection
- Visual Studio Debugger - Breakpoints and step-through
- Browser DevTools - Network tab for Selenium operations
Use semantic versioning: MAJOR.MINOR.PATCH.BUILD
- MAJOR - Breaking changes
- MINOR - New features (backwards compatible)
- PATCH - Bug fixes
- BUILD - Build number (optional)
Example: 1.0.0.0 → 1.1.0.0 (new features)
- Update version number in project files
<Version>1.1.0.0</Version>-
Update CHANGELOG.md with changes
-
Build for all platforms
python build_windows.py
python build-mac.py
python build-linux.py-
Test release builds on each platform
-
Create GitHub release
- Tag:
v1.1.0 - Title:
v1.1.0 - Description: Copy from CHANGELOG
- Attach built files
- Announce update (if applicable)
Build scripts handle:
- Version string updates (with
--no-automaticflag to skip) - Icon cache clearing (Windows)
- Packaging into distributable formats
- Creating release archives
Example:
python build_windows.py --no-automatic- Fork the repository
- Create a feature branch
- Make your changes with clear commits
- Test thoroughly on relevant platforms
- Update documentation if needed
- Submit PR with clear description
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested on Windows
- [ ] Tested on macOS
- [ ] Tested on Linux
## Checklist
- [ ] Code follows project style
- [ ] Documentation updated
- [ ] No breaking changes (or documented)
- [ ] All tests passAll PRs require review from maintainers:
- Code quality and style
- Functionality and correctness
- Platform compatibility
- Documentation completeness
Linux Auto-Start Bug:
- "Start with system" doesn't work on Linux
- Investigating platform-specific implementation
- Workaround: Manual launch
Potential areas for contribution:
- Mobile companion app
- Email notifications
- Advanced scheduling features
- Multiple account support
- Custom notification sounds
- Statistics and analytics
Key NuGet packages:
-
Avalonia- UI framework -
Avalonia.Desktop- Desktop platform support -
Selenium.WebDriver- Browser automation -
Velopack- Update system -
Newtonsoft.Json- JSON parsing
Check AkademiTrack.csproj for complete list and versions.
- Avalonia Docs: https://docs.avaloniaui.net/
- .NET Docs: https://docs.microsoft.com/dotnet/
- Selenium Docs: https://www.selenium.dev/documentation/
- GitHub Issues - Bug reports and features
- GitHub Discussions - General questions
- Direct contact with maintainers
- iSkole API documentation (if available)
- Feide authentication documentation
Project Maintainers:
- Andreas Nilsen - [@CyberNilsen](https://github.com/CyberNilsen)
- Mathias Hansen - [@CyberHansen](https://github.com/CyberHansen)
For development questions:
- Create an issue on GitHub
- Tag maintainers in discussions
- Email for private matters
AkademiTrack is licensed under the MIT License. See LICENSE file for details.
By contributing, you agree that your contributions will be licensed under the MIT License.
Ready to contribute? Here's your path:
- Read this Development Guide thoroughly
- Set up your development environment
- Browse open issues for "good first issue" tags
- Fork and clone the repository
- Make your changes and test
- Submit a pull request
- Respond to review feedback
Welcome to the AkademiTrack development community! 🚀
AkademiTrack - Automated STU attendance registration for Akademiet schools
Made with ❤️ by CyberNilsen & CyberHansen
Website | Email Us | Licensed under MIT License