Skip to content

SvobodaOcode/SportLog

Repository files navigation

SportLog

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.

Features

  • 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.

Architecture

The project is structured as a monorepo containing three main components:

  1. SportLog (Client): The SwiftUI application for iOS and macOS. It handles the user interface and local data storage.
  2. SportLogServer (Server): The Vapor backend that provides a RESTful API for the client. It manages user authentication and data persistence in a SQLite database.
  3. SportLogShared (Shared): A Swift package containing shared code, such as data models and storage protocols, used by both the client and the server.

Project Structure

.
├── SportLog/           # iOS/macOS client application
├── SportLogServer/     # Vapor backend server
├── SportLogShared/     # Shared Swift package
├── SportLogTests/      # Unit tests for the client
└── ...

Technology Stack

  • Client: Swift, SwiftUI
  • Server: Swift, Vapor 4
  • Database: SQLite (using SQLite.swift)
  • Authentication: Sign in with Apple
  • Deployment: Docker, Google Cloud Run

Getting Started

Prerequisites

  • macOS with Xcode installed
  • Swift
  • Docker (for running the server locally)

Running the Client

  1. Open the project in Xcode:
    xed SportLog.xcworkspace
  2. Select the SportLog scheme for either iOS or macOS.
  3. Run the application from Xcode.

Running the Server

The server is containerized using Docker for easy setup and deployment.

  1. Navigate to the server directory:
    cd SportLogServer
  2. Build and run the Docker container using Docker Compose:
    docker-compose up --build

The server will be running at http://localhost:8080.

Deployment

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors