NetFun-Backend - BFF layer (written in Swift)

Overview

NetFun-Backend

BFF layer (written in Swift). One can setup BFF using Core Classess (which is already added as a dependency of this package. See Package.swift).

Setup

  • Clone repo

  • Wait for dependecies to resolve.

  • Go to root folder & run swift run. This should start a server and show something like below in console.

    • [ NOTICE ] Server starting on http://127.0.0.1:8080
  • Note: Now your BaseURL is http://127.0.0.1:8080/api

Access Data Using API Endpoint

1. Fetch Profiles for a User

Endpoint: /{BaseURL}/profiles

e.g. => http://127.0.0.1:8080/api/profiles

Response

[
   {
       "id": 1,
       "name": "John Doe",
       "username": "john32"
   },
   {
       "id": 2,
       "name": "Mike Hanigan",
       "username": "mikeH"
   },
   {
       "id": 3,
       "name": "Max Payne",
       "username": "max-8000"
   },
   {
       "id": 4,
       "name": "ZK Bill",
       "username": "zkb1212"
   },
   {
       "id": 5,
       "name": "Sarah M.",
       "username": "sarah"
   }
]

2. Fetch Data for Home Page for a Profile

Endpoint: {BaseURL}/profilehome/{profileId}

e.g. : http://127.0.0.1:8080/api/profilehome/700 where 700 is profileId

Response

{
    "id": 7,
    "profile": {
        "id": 2,
        "name": "Mike Hanigan",
        "username": "mikeH"
    },
    "collection": [
        {
            "id": 500,
            "title": "Continue Watching",
            "items": [
                {
                    "id": 1,
                    "cast": [
                        {
                            "id": 12,
                            "name": "Actor 1"
                        },
                        {
                            "id": 13,
                            "name": "Actor 2"
                        }
                    ],
                    "title": "Ice Age 1",
                    "media": [
                        {
                            "mediaType": "video",
                            "duration": 95
                        }
                    ],
                    "releasedDate": "2003-08-12T20:17:46Z",
                    "type": "movie",
                    "writers": [
                        {
                            "id": 14,
                            "name": "Writer 1"
                        }
                    ],
                    "director": {
                        "id": 11,
                        "name": "John Parker"
                    }
                },
                {
                    "id": 2,
                    "cast": [
                        {
                            "id": 12,
                            "name": "Actor 1"
                        },
                        {
                            "id": 13,
                            "name": "Actor 2"
                        }
                    ],
                    "title": "Arya 2",
                    "media": [
                        {
                            "id": 1001,
                            "title": "Episode 1",
                            "mediaType": "video",
                            "duration": 45
                        },
                        {
                            "id": 1002,
                            "title": "Episode 2",
                            "mediaType": "video",
                            "duration": 40
                        },
                        {
                            "id": 1003,
                            "title": "Episode 3",
                            "mediaType": "video",
                            "duration": 55
                        }
                    ],
                    "releasedDate": "2019-08-12T20:17:46Z",
                    "type": "series",
                    "writers": [
                        {
                            "id": 14,
                            "name": "Writer 1"
                        }
                    ],
                    "director": {
                        "id": 11,
                        "name": "John Parker"
                    }
                }
            ]
        },
        {
            "id": 502,
            "title": "Kids Movies",
            "items": [
                {
                    "id": 1,
                    "cast": [
                        {
                            "id": 12,
                            "name": "Actor 1"
                        },
                        {
                            "id": 13,
                            "name": "Actor 2"
                        }
                    ],
                    "title": "Madagaskar",
                    "media": [
                        {
                            "mediaType": "video",
                            "duration": 85
                        }
                    ],
                    "releasedDate": "2003-08-12T20:17:46Z",
                    "type": "movie",
                    "writers": [
                        {
                            "id": 14,
                            "name": "Writer 1"
                        }
                    ],
                    "director": {
                        "id": 11,
                        "name": "John Parker"
                    }
                },
                {
                    "id": 2,
                    "cast": [
                        {
                            "id": 12,
                            "name": "Actor 1"
                        },
                        {
                            "id": 13,
                            "name": "Actor 2"
                        }
                    ],
                    "title": "Micky Mouse & Friends",
                    "media": [
                        {
                            "id": 1001,
                            "title": "Episode 1",
                            "mediaType": "video",
                            "duration": 45
                        },
                        {
                            "id": 1002,
                            "title": "Episode 2",
                            "mediaType": "video",
                            "duration": 40
                        },
                        {
                            "id": 1003,
                            "title": "Episode 3",
                            "mediaType": "video",
                            "duration": 55
                        },
                        {
                            "id": 1004,
                            "title": "Episode 4",
                            "mediaType": "video",
                            "duration": 42
                        },
                        {
                            "id": 1005,
                            "title": "Episode 5",
                            "mediaType": "video",
                            "duration": 47
                        }
                    ],
                    "releasedDate": "1995-08-12T20:17:46Z",
                    "type": "series",
                    "writers": [
                        {
                            "id": 14,
                            "name": "Writer 1"
                        }
                    ],
                    "director": {
                        "id": 11,
                        "name": "John Parker"
                    }
                }
            ]
        }
    ]
}

A Client App (iOS/SwiftUI)

Repository: NetFun-ios-app

Just Clone and follow instructions of README file.

References

Planned + Future Tasks

setup using vapor

create enpoints

implement database & write connectivity. i.e. Postgresql, MongoDB, etc.

implement authentication + accesstoken

docker setup

You might also like...
A compiler with very basic capabilities written in Swift

BasicCompiler A compiler with very basic capabilities written in Swift. This project is not intended for real-world use; it's implemented just for fun

AuroraEditor is a IDE built by the community, for the community, and written in Swift for the best native performance and feel for macOS.
AuroraEditor is a IDE built by the community, for the community, and written in Swift for the best native performance and feel for macOS.

AuroraEditor AuroraEditor is a IDE built by the community, for the community, and written in Swift for the best native performance and feel for macOS.

iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android).
iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android).

FinanceReactNative iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android). Data is pulled from Yahoo Finance

A simple To Do application written in React Native

Example To Do List application in react-native Requirements, install as needed: React Native: $ npm i -g react-native-cli watchman: $ brew install wa

A property finder application written using React Native

React Native PropertyFinder App This repository accompanies the tutorial I published on Ray Wenderlich's website, which describes the process of build

The Bitwarden mobile application is written in C# with Xamarin Android, Xamarin iOS, and Xamarin Forms.
The Bitwarden mobile application is written in C# with Xamarin Android, Xamarin iOS, and Xamarin Forms.

Bitwarden Mobile Application The Bitwarden mobile application is written in C# with Xamarin Android, Xamarin iOS, and Xamarin Forms. Build/Run Require

A Hacker News client written in React Native
A Hacker News client written in React Native

React Native Hacker News A modern cross-platform HackerNews client built on React Native Features The app currently has the following functionality: H

Cross-platform instrumentation and introspection library written in C

Gum Cross-platform instrumentation and introspection library written in C. This library is consumed by frida-core through its JavaScript bindings, Gum

A Swift package for encoding and decoding Swift Symbol Graph files.
A Swift package for encoding and decoding Swift Symbol Graph files.

SymbolKit The specification and reference model for the Symbol Graph File Format. A Symbol Graph models a module, also known in various programming la

Owner
Minhaz Panara
iOS | Swift | Objective C | React Native | Redux | JavaScript
Minhaz Panara
Alchemy, an elegant, batteries included backend framework for Swift.

Elegant, batteries included web framework for Swift.

Alchemy 313 Jan 2, 2023
Turbo-iOS base project that's entirely driven from your backend Rails app.

Turbo-iOS base project that's entirely driven from your backend Rails app.

Dale Zak 109 Dec 11, 2022
Delightful code generation for OpenAPI specs for Swift written in Swift

Create API Delightful code generation for OpenAPI specs for Swift written in Swi

Alexander Grebenyuk 286 Dec 23, 2022
A thread safe throttle written in Swift

SwiftThrottle - A thread safe throttle written in Swift licensed under MIT. Introduction This throttle is intended to prevent the program from crashing

Lakr Aream 6 Jan 3, 2023
This project is a minimalistic Pomodoro timer for OS X written in Swift

Minimalistic Pomodoro for OSX This project is a minimalistic Pomodoro timer for OS X written in Swift started by @bengsfort, and substantially enhance

Kushal Shingote 2 Nov 17, 2021
An interpreter for Lox written in Swift.

slox An interpreter for Lox written in Swift. Provided for with an MIT License.

Manuel Werder 1 Nov 8, 2021
KnockToReact is an iOS library written in Swift and Objective-C that brings an exclusive feature to interact with users just by receiving and recognizing "knocks" in the device.

KnockToReact is an iOS library written in Swift and Objective-C that brings an exclusive feature to interact with users just by receiving and recognizing "knocks" in the device.

Matheus Cavalca 25 Feb 10, 2022
A usermanager written in swift 3.0 saves you from hassle of saving your active user session.

SwiftUserManager A usermanager written in swift 3.0 saves you from hassle of saving your active user session. Call api and give the json to MOProfile

Zeeshan Haider 22 Sep 30, 2022
IBSKit - an Xcode Fat Framework written in Swift 5

IBSKit framework is designed to solve everyday tasks that any iOS developer faces when developing a new project.

IBS Mobile iOS 9 Nov 11, 2022
TTipBoxView is a simple and flexible UI component fully written in Swift

TTipBoxView is a simple and flexible UI component fully written in Swift. It is developed to help you create a hint/prompt view quickly, saving your time and avoiding having to write many lines of codes.

Nguyen Duc Thinh 3 Aug 18, 2022