Overview
Full-stack iOS fitness assistant made in nodejs and Swift deployed with a demo SQL backend.
Technical Implementation Highlights
-
Three-Tier Architecture: Frontend (SwiftUI), application logic (Node.js), and database (PostgreSQL) layers.
-
RESTful API Design: Implemented 15+ API endpoints following REST principles with SWAGGER Documentation.
-
Protocol-Oriented Network Layer: Custom Swift NetworkManager implementing protocol-oriented design for testability and abstraction.
-
Semantic AI Engine: Workout recommendation system utilizing NLP techniques to analyze workout history and generate personalized plans.
-
Database Optimization: Normalized PostgreSQL schema with proper indexing strategies.
Background
RepBook was developed as a database optimization project, demonstrating backend architecture, and database design.
Implementation
System Architecture
RepBook follows a strict three-tier architecture with clear boundaries between system components:
- Presentation Tier (iOS): Swift and Objective-C implementation using MVVM architecture for separation of UI and business logic
- Application Tier (Node.js): Express-based API server with middleware
- Data Tier (PostgreSQL): 3NF relational database
API Documentation
The RESTful API follows the OpenAPI specification with comprehensive documentation. Core endpoints include:
POST /signup
- Register a new user with account and metrics data.
POST /login
- Authenticate a user and generate an auth key.
GET /checkUsername/:username
- Check if a username is available.
POST /exercises
- Add exercises to a workout.
POST /updateUserInfo/:memberId
- Update personal user information.
GET /userDataAndMetrics/:memberId
- Retrieve user data and physical metrics.
POST /setGymMembership
- Set or update gym membership details.
GET /workouts/:memberId
- Retrieve all workouts for a specific member.
GET /membersMetrics/:memberId
- Retrieve a member's physical metrics.
POST /createWorkout/:memberId
- Create a new workout.
GET /exercises
- Retrieve a list of all exercises.
GET /exercises/search?workoutId=:workoutId
- Retrieve exercises for a specific workout.
GET /exercises/search?q=
- Search exercises by name.
DELETE /workouts/:workoutId
- Delete a specific workout.
PUT /workouts/:workoutId
- Rename an existing workout.
POST /loggedWorkouts
- Log a completed workout session.
GET /fetchSafeData/:memberId
- Fetch filtered user data and workout details.
AI Recommendation Engine
The recommendation system implements semantic analysis of workout data to generate personalized plans:
- Data Processing: Historical workout data is processed to extract training patterns and preferences
- Feature Engineering: Extraction of meaningful features from raw workout data
- Pattern Recognition: Analysis of exercise combinations, intensity progression, and recovery patterns
- Recommendation Generation: Contextual recommendation based on user goals, history, and physiological constraints
Technology Stack
- Mobile Frontend: Swift, Objective-C, SwiftUI
- Backend: Node.js, Express
- Database: PostgreSQL with rigorous normalization and indexing
- API: RESTful endpoints with Swagger documentation
- Architecture: Three-tier (Presentation, Application, Data)
- Development Tools: Xcode, Visual Studio Code