SportLog is a full-stack application for logging sports activities, featuring a native iOS and macOS client built with SwiftUI and a backend server powered by Vapor.
- Cross-platform Client: A single codebase for iOS and macOS providing a seamless user experience.
- User Authentication: Secure sign-in using Sign in with Apple.
- Sport Activity Tracking: Create, view, and manage sports records including sport name, location, and duration.
- Persistent Storage: Data is stored locally on the device and can be synced with the server.
- Backend Server: A Vapor server handles user data and record synchronization across devices.
The project is structured as a monorepo containing three main components:
SportLog(Client): The SwiftUI application for iOS and macOS. It handles the user interface and local data storage.SportLogServer(Server): The Vapor backend that provides a RESTful API for the client. It manages user authentication and data persistence in a SQLite database.SportLogShared(Shared): A Swift package containing shared code, such as data models and storage protocols, used by both the client and the server.
.
├── SportLog/ # iOS/macOS client application
├── SportLogServer/ # Vapor backend server
├── SportLogShared/ # Shared Swift package
├── SportLogTests/ # Unit tests for the client
└── ...
- Client: Swift, SwiftUI
- Server: Swift, Vapor 4
- Database: SQLite (using SQLite.swift)
- Authentication: Sign in with Apple
- Deployment: Docker, Google Cloud Run
- macOS with Xcode installed
- Swift
- Docker (for running the server locally)
- Open the project in Xcode:
xed SportLog.xcworkspace
- Select the
SportLogscheme for either iOS or macOS. - Run the application from Xcode.
The server is containerized using Docker for easy setup and deployment.
- Navigate to the server directory:
cd SportLogServer - Build and run the Docker container using Docker Compose:
docker-compose up --build
The server will be running at http://localhost:8080.
The server is configured for deployment to Google Cloud Run. The deploy-cloud-run.sh script can be used to build and deploy the production Docker image.