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
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
PillowTalk - An iOS & SwiftUI server monitor tool for linux based machines using remote proc file system with script execution.

An iOS & SwiftUI server monitor tool for linux based machines using remote proc file system with script execution.

Lakr Aream 416 Dec 16, 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
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 Dec 29, 2022
💧 A server-side Swift HTTP web framework.

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

Vapor 22.4k Jan 3, 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
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 Dec 27, 2022
A light-weight server-side service framework written in the Swift programming language.

Smoke Framework The Smoke Framework is a light-weight server-side service framework written in Swift and using SwiftNIO for its networking layer by de

Amazon 1.4k Dec 22, 2022
HTTP Implementation for Swift on Linux and Mac OS X

Swift HTTP Server Simple HTTP implementation for Swift using POSIX socket API. Running on Mac OS X and Linux. For Mac users: You can install new Swift

Huy 451 Jul 28, 2022
Swift Express is a simple, yet unopinionated web application server written in Swift

Documentation <h5 align="right"><a href="http://demo.swiftexpress.io/">Live ?? server running Demo <img src="https://cdn0.iconfinder.com/data/icons/

Crossroad Labs 850 Dec 2, 2022
Simple server APIs in Swift

Simple server APIs in Swift

null 4 Apr 25, 2022
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Dec 31, 2022
Swift HTTP server using the pre-fork worker model

Curassow Curassow is a Swift Nest HTTP Server. It uses the pre-fork worker model and it's similar to Python's Gunicorn and Ruby's Unicorn. It exposes

Kyle Fuller Archive 397 Oct 30, 2022
High Performance (nearly)100% Swift Web server supporting dynamic content.

Dynamo - Dynamic Swift Web Server Starting this project the intention was to code the simplest possible Web Server entirely in Swift. Unfortunately I

John Holdsworth 68 Jul 25, 2022
Reliable Server Side Swift ✭ Make Apache great again!

mod_swift mod_swift is a technology demo which shows how to write native modules for the Apache Web Server in the Swift 3 programming language. The de

The ApacheExpress Alliance 174 Oct 22, 2022
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Jan 5, 2023
A small, lightweight, embeddable HTTP server for Mac OS X or iOS applications

CocoaHTTPServer CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications. Sometimes developers need an embedde

Robbie Hanson 5.5k Jan 7, 2023
GCDWebServer is a modern and lightweight GCD based HTTP 1.1 server designed to be embedded in iOS, macOS & tvOS apps.

GCDWebServer is a modern and lightweight GCD based HTTP 1.1 server designed to be embedded in iOS, macOS & tvOS apps. It was written from scr

Pierre-Olivier Latour 6.3k Dec 27, 2022
iOS Tweak to redirect Discord API calls to a Fosscord server.

FosscordTweak iOS Tweak to redirect Discord API calls to a Fosscord server. Installation Manual Download .deb file from release and install on jailbro

null 8 May 16, 2022