Swift backend / server framework (Pure Swift, Supports Linux)

Overview

NetworkObjects

Join the chat at https://gitter.im/colemancda/NetworkObjects Carthage compatible

NetworkObjects is a #PureSwift backend. This framework compiles for OS X, iOS and Linux and serves as the foundation for building powerful Swift servers. Powered by SwiftFoundation and CoreModel, the framework comes with server and client classes which abstract away advanced networking code.

Example

  • NetworkObjectsDemo - Demo App / Server for NetworkObjects
  • NetworkObjectsUI - iOS framework that provides view and controller classes for easily integrating NetworkObjects into your iOS app.

Support and Documentation

If you have any questions you can contact me on Twitter at @colemancda or send me an IM me on Gitter.

Comments
  • Replace NOResourceProtocol with delegate protocol

    Replace NOResourceProtocol with delegate protocol

    Change the design. Instead of the NSManagedObjects being subclasses and asked about access control, etc., have NOServer have a delegate that is queried those methods. This new design would drastically change how NOServer is implemented, although the functionally would remain the same. The main reason for this is to concatenate behavior (like having all the resources be public), so that entities can point to different objects and behave differently in different NOServers. Currently, all behavior is global (especially the class methods of NOResourceProtocol).

    bug enhancement 
    opened by colemancda 3
  • Add Web Socket support

    Add Web Socket support

    GCDAsyncSocket supports Web Sockets and Objective-C libraries exist for client side WS. This could be implemented as a separate NOServer, with possibly the current one being a subclass of a abstract superclass with HTTP and WS implementations, as well as NOAPI being an abstract class with two implementations. Or the the current class could somehow support both interfaces.

    enhancement 
    opened by colemancda 3
  • Remote fetch requests

    Remote fetch requests

    Implementing this would really invalidate fix #12. The idea is to introduce a search API based on NSFetchRequest that would allow fetch requests to be executed over the network. The response would return the resource IDs of objects returned by the fetch request that the session has permission to view.

    enhancement 
    opened by colemancda 2
  • Add three letter prefix

    Add three letter prefix

    "In order to keep class names unique, the convention is to use prefixes on all classes. You’ll have noticed that Cocoa and Cocoa Touch class names typically start either with NS or UI. Two-letter prefixes like these are reserved by Apple for use in framework classes."

    https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html

    opened by 3lvis 2
  • CoreData -validateForDelete not working properly

    CoreData -validateForDelete not working properly

    Deleting a managed object in Server will result in a validation error if the managed object contains a relationship with a non-nil value.

    This project's test cases document the problem: https://github.com/evandelaney/StackOverflow-20722804

    Here's the SO discussion: http://stackoverflow.com/questions/20722804/coredata-how-to-use-validatefordelete-to-determine-if-a-managed-object-should

    bug invalid 
    opened by colemancda 1
  • move -fetchEntity: methods to internal NSMangedObjectContext extension

    move -fetchEntity: methods to internal NSMangedObjectContext extension

    If possible, move -fetchEntity: methods to internal NSMangedObjectContext extension so the Store class can take advantage of it. Would help solve #62.

    enhancement 
    opened by colemancda 1
  • Add recursive fetch support

    Add recursive fetch support

    For both WS and HTTP requests, the fetch requests should include a recursive flag (as a header in HTTP) so that the server will return the JSON representation of relationships instead of their resource ID.

    bug enhancement wontfix 
    opened by colemancda 1
  • Correctly implement includesSubentities for search

    Correctly implement includesSubentities for search

    Currently, the client will create and cache the entity specified by the fetch request. The server currently does not provide enough information for the client to cache sub entities. the JSON response could be something like this:

    { "entity1" : [1,2,3], "entity2" : [4,5,6 ] }

    it is important that the keys in these response dictionaries correspond to the resource path of the entities and not the name of the entities themselves. This allows for more cross platform compatibility and also abstraction from the internal details.

    bug 
    opened by colemancda 1
  • NOServer subclass that is more concurrent.

    NOServer subclass that is more concurrent.

    Or maybe a MySQL NSIncrementalStore subclass that NOStore uses and NOServer creates a context for each request and saves it. This would work great with #47 .

    enhancement 
    opened by colemancda 1
  • Optimize NOStore and save on worker thread

    Optimize NOStore and save on worker thread

    NOStore should adopt even more concurrency with multiple contexts (maybe one per session, connection, request, etc...?) and perform saves on worker queue.

    bug enhancement wontfix 
    opened by colemancda 1
  • NOIncrementalStore support

    NOIncrementalStore support

    NOIncrementalStore will block its thread while fetching data. NOAPI and NOAPICached store will be integrated into NOIncrementalStore (as properties, categories, in the implementation itself. SNCStore will have a context that serves as cache and a child store that uses NSIncremental store.

    bug 
    opened by colemancda 1
Releases(3.0.0)
  • 3.0.0(Sep 18, 2015)

  • 2.0.0(Jun 29, 2015)

    • Migrated to Swift 2.0
    • Cleaned up Store and separated validation and caching methods
    • Separated enumerations and other code into separate source files
    • Removed -Server prefix from enum types
    • Removed ExSwift dependency
    Source code(tar.gz)
    Source code(zip)
  • 1.1.5(Jun 19, 2015)

  • 1.1.4(Jun 16, 2015)

    • Restored Universal OS X / iOS framework target
    • Removed Carthage support
    • Switched back to Git submodule dependencies
    • Updated dependencies and silenced warnings
    • defe002 Removed temporary fix for NSSortDescriptor key on OS X
    • 6018e35 Added func fetchResource() to Store
    • 888b543 Fixed incorrect bundle identifiers
    • 177f59f Added defaultURLSession to Store
    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(Jun 11, 2015)

  • 1.1.2(Jun 7, 2015)

  • 1.1.1(Apr 18, 2015)

  • 1.1(Feb 11, 2015)

    • #104 Applied workaround for CoreData's -validateForDelete not working properly
    • #102 Added Gitter Chat badge
    • #101 Framework version is set from commit count on develop
    • #83 Converting Transformed value from bad JSON no longer raises an exception
    • #82 Server saves managed object context at the end of each successful request
    • #93 Fully integrated Travis CI
    • #63 Added Test Cases
    • de98e90975c1c009c140bb1847be4f58201a7971 Fixed Server crashing when delegate is nil
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Feb 7, 2015)

    • #99 Fixed Unit Tests crashing at runtime
    • #95 Added ExSwift as a dependency
    • #93 Tried to add Travis CI integration
    • #89 Search now handles complex predicates
    • #87 Added JSON validation to Store
    • #86 Moved Server -fetchEntity: method into internal function
    • ef5a50eebd514a3dcd79ac3c4abc3f79c8136c73 Added CoreDataAttributeJSONCompatibilityOptions
    Source code(tar.gz)
    Source code(zip)
  • 1.0.2(Jan 12, 2015)

    • #88 Fixed nil values not being applied to managed objects in Store
    • #84 Ordered to-many relationships are now supported
    • #81 Server now informs delegate of failed requests
    • #80, #79 Sub entities are now properly supported
    • #71 Resource ID attribute is added at runtime (in Server and Store)
    • f60d3c1a46c9264681ab61df12805306f18206a4 Transformable values no longer crash
    • 246641569df8e1472ae0a2b96d450b05a2b0a509 Fixed Server's Search handler not supporting predicate options correctly
    • 5ba1fabb3397abe2ca054ce72e982050d8d095f0 Store no longer crashes when merging changes from private managed object context
    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Dec 7, 2014)

    • #78 Refactored Store's URL Request code for subclassing
    • #77 All properties are optional at runtime in Store
    • #75 Entity paths are now directly mapped to their names
    • #71 Resource ID attribute is added at runtime (in Store)
    • 086bba7 Added temporary fix for NSSortDescriptor inconsistency in OS X
    • 82508d9 Added Core Data validation for insert, update, and delete requests in Server
    • 914d607 Added -server:didInsertManagedObject:context: to ServerDelegate
    • Fixed bugs related to optionals in Swift
    • Fixed Server request handlers returning incorrect values and crashing
    Source code(tar.gz)
    Source code(zip)
  • 1.0(Oct 4, 2014)

  • 0.9.6(Jun 15, 2014)

    • Framework rewritten from scratch (with some code being migrated)
    • Framework only defines two classes, NOServer and NOStore
    • New NOStore class replaces NOAPI and NOAPICachedStore
    • Old NOStore functionality is now implemented by NOServer's delegates
    • Old example server and client removed
    • NOResourceProtocol removed
    Source code(tar.gz)
    Source code(zip)
  • 0.9.5.1(Apr 23, 2014)

    • #18 NOServer has a delegate for internal error reporting
    • #34 NOServer no longer broadcasts abstract entities
    • #46 Renamed NOServer constants and added prefixes
    • Optimized NOServer
    Source code(tar.gz)
    Source code(zip)
  • 0.9.5-beta(Apr 20, 2014)

    • #43 Replaced custom value validation methods with KVC ones
    • #40 added optional, client-side date attribute for date when cached
    • NOStore and NOServer have been optimized
    • Disabled deletion of other users' posts in example client
    Source code(tar.gz)
    Source code(zip)
  • 0.9.4.3-beta(Apr 19, 2014)

    • #19 Added dependencies as submodules
    • #43 Replaced custom value validation methods with KVC ones
    • Fixed UI in example client when creating new post
    • Fixed file references
    • Removed old code
    Source code(tar.gz)
    Source code(zip)
  • 0.9.4.2-beta(Apr 19, 2014)

    • Fixed Issue when displaying tableview cells in example client
    • Added a main thread context to client example
    • NOAPI now deletes a resource in cache when the server returns a not found error
    • NOAPI now saves its context after every request
    • Fixed Model.xcdatamodel reference in example client and server
    Source code(tar.gz)
    Source code(zip)
  • 0.9.4.1-beta(Apr 1, 2014)

    • Fixed search API bug
    • Updated read me
    • NOAPI now uses a options dictionary for initialization
    • Removed NOIncrementalStore (can still be found in branches)
    Source code(tar.gz)
    Source code(zip)
  • 0.9.4-beta(Mar 30, 2014)

  • 0.9.3-alpha(Mar 30, 2014)

    • Added more documentation
    • Added search capabilities to the server and client.
    • Added NOIncrementalStore (experimental)
    • Fixed bug that caused missing references when copying project
    • Minor bug fixes and optimizations
    Source code(tar.gz)
    Source code(zip)
  • 0.9.2.4-alpha(Mar 9, 2014)

    • Changed NOAPICachedStore internally so that, when fetching a resource, it would only update values that have changed. This is so that NSFetchedResultsController will not update constantly.
    • Server example now uses NSArrayController and Cocoa Bindings for its SNSBrowserVC
    Source code(tar.gz)
    Source code(zip)
  • 0.9.2.3-alpha(Mar 8, 2014)

  • 0.9.2.2-alpha(Mar 8, 2014)

    • Removed old examples and completed new examples (could use improvements though)
    • NSURLSession is an argument in NOAPI's methods for communicating with server
    • Fixed example client bugs
    Source code(tar.gz)
    Source code(zip)
  • 0.9.2.1-alpha(Feb 23, 2014)

    • Updated README
    • Added login screen to new client example (the old client example is still included and functional)
    • Implemented authentication in new client example
    Source code(tar.gz)
    Source code(zip)
  • 0.92(Feb 17, 2014)

    • The server example was rewritten from scratch for more clarity
    • Created template for rewrite of client example
    • Fixed NOStore saving bug
    • Added more documentation
    Source code(tar.gz)
    Source code(zip)
  • 0.911(Dec 30, 2013)

  • 0.91(Dec 30, 2013)

    The server code had some bugs relating to JSON representation of Resources which were fixed and some code was added to the example's client iOS app. HTTPS support was added too.

    Source code(tar.gz)
    Source code(zip)
Owner
Alsey Coleman Miller
IoT Swift Developer working on cross-platform projects
Alsey Coleman Miller
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Embassy Super lightweight async HTTP server in pure Swift. Please read: Embedded web server for iOS UI testing. See also: Our lightweight web framewor

Envoy 540 Dec 15, 2022
TheraForge's Client REST API framework to connect to TheraForge's secure CloudBox Backend-as-a-Service (BaaS)

OTFCloudClientAPI TheraForge's Client REST API Framework to Connect to TheraForg

TheraForge 0 Dec 23, 2021
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.

Why Zewo? • Support • Community • Contributing Zewo Zewo is a lightweight library for web applications in Swift. What sets Zewo apart? Zewo is not a w

Zewo 1.9k Dec 22, 2022
A tool to build projects on MacOS and a remote linux server with one command

DualBuild DualBuild is a command line tool for building projects on MacOS and a remote Linux server. ##Setup Install the repository git clone https://

Operator Foundation 0 Dec 26, 2021
A simple GCD based HTTP client and server, written in 'pure' Swift

SwiftyHTTP Note: I'm probably not going to update this any further - If you need a Swift networking toolset for the server side, consider: Macro.swift

Always Right Institute 116 Aug 6, 2022
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.

BlueSocket Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. Prerequisites Swift Swift Open Source swift-5.1

Kitura 1.3k Dec 26, 2022
A Ruby on Rails inspired Web Framework for Swift that runs on Linux and OS X

IMPORTANT! We don't see any way how to make web development as great as Ruby on Rails or Django with a very static nature of current Swift. We hope th

Saulius Grigaitis 2k Dec 5, 2022
DispatchSource based socket framework written in pure Swift

SwiftDSSocket Overview SwiftDSSocket is a purely swift based asynchronous socket framework built atop DispatchSource. Function signatures are pretty m

Yi Huang 65 Nov 15, 2022
NWReachability - a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.

NWReachability is a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.

null 4 Dec 2, 2022
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

PerfectlySoft Inc. 13.9k Jan 6, 2023
💧 A server-side Swift web framework.

Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project. Take

Vapor 22.4k Jan 2, 2023
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

Kitura 7.6k Jan 6, 2023
libuv base Swift web HTTP server framework

Notice Trevi now open a Trevi Community. Yoseob/Trevi project split up into respective Trevi, lime, middlewares and sys packages at our community. If

leeyoseob 46 Jan 29, 2022
Lightweight, flexible HTTP server framework written in Swift

Hummingbird Lightweight, flexible server framework written in Swift. Hummingbird consists of three main components, the core HTTP server, a minimal we

Hummingbird 245 Dec 30, 2022
Meet Corvus, the first strongly declarative server-side framework.

Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get

null 42 Jun 29, 2022
SwiftCANLib is a library used to process Controller Area Network (CAN) frames utilizing the Linux kernel open source library SOCKETCAN.

SwiftCANLib SwiftCANLib is a library used to process Controller Area Network (CAN) frames utilizing the Linux kernel open source library SOCKETCAN. Th

Tim Wise 4 Oct 25, 2021
StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It supports apps which hide the status bar and The Notch

StatusBarOverlay StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It support

Idle Hands Apps 160 Nov 2, 2022
The Oakland Post iOS app, written in pure Swift

Now available on the App Store! Check it out! The Oakland Post App The mobile companion for The Oakland Post's website, written entirely in Swift! Scr

Andrew Clissold 280 Dec 13, 2022
A resource based, protocol oriented networking library designed for pure-SwiftUI applications.

Monarch ?? - WIP A resource based, protocol oriented networking library designed for pure-SwiftUI applications. Features: Async/Await Resource Based P

Emilio Pelaez Romero 4 Oct 17, 2022