Git Product home page Git Product logo

servicestack's Introduction

See servicestack.net/features for an overview.

Join the ServiceStack Google+ Community or follow @ServiceStack for project updates.

Simple, Fast, Versatile and full-featured Services Framework

ServiceStack is a simple, fast, versatile and highly-productive full-featured Web and Web Services Framework that's thoughtfully-architected to reduce artificial complexity and promote remote services best-practices with a message-based design that allows for maximum re-use where ServiceStack Services are able to be consumed via an array of built-in fast data formats (inc. JSON, XML, CSV, JSV, ProtoBuf and MsgPack) as well as XSD/WSDL for SOAP endpoints and Rabbit MQ and Redis MQ hosts.

Your same Services also serve as the Controller in ServiceStack's Smart Razor Views reducing the effort to serve both Web and Single Page Apps as well as Rich Desktop and Mobile Clients.

ServiceStack Services also maximize productivity for consumers providing an instant end-to-end typed API without code-gen enabling the most productive development experience for developing .NET to .NET Web Services.

Generate Instant Typed API's from a Remote Url!

ServiceStack now integrates with all Major IDE's used for creating the best native experiences on the most popular platforms to enable a highly productive dev workflow for consuming Web Services, making ServiceStack the ideal back-end choice for powering rich, native iPhone and iPad Apps on iOS with Swift, Mobile and Tablet Apps on the Android platform with Java, OSX Desktop Appications as well as targetting the most popular .NET PCL platforms including Xamarin.iOS, Xamarin.Android, Windows Store, WPF, WinForms and Silverlight:

VS.NET integration with ServiceStackVS

Providing instant Native Typed API's for C#, F#, VB.NET and TypeScript directly in Visual Studio for the most popular .NET platforms including iOS and Android using Xamarin.iOS and Xamarin.Android on Windows.

Xamarin Studio integration with ServiceStackXS

Providing C# Native Types support for developing iOS and Android mobile Apps using Xamarin.iOS and Xamarin.Android with Xamarin Studio on OSX. The ServiceStackXS plugin also provides a rich web service development experience developing Client applications with Mono Develop on Linux

Xcode integration with ServiceStackXC Plugin

Providing an instant Native Typed API in Swift including generic Service Clients enabling a highly-productive workflow and effortless consumption of Web Services from native iOS and OSX Applications - directly from within Xcode!

Android Studio integration with ServiceStackIDEA

Providing an instant Native Typed API in Java including idiomatic Java Generic Service Clients supporting Sync and Async Requests by levaraging Android's AsyncTasks to enable the creation of services-rich and responsive native Java Mobile Apps on the Android platform - directly from within Android Studio!

Simple REST service example

This example is also available as a stand-alone integration test:

//Web Service Host Configuration
public class AppHost : AppSelfHostBase
{
    public AppHost() : base("TODOs Tests", typeof(Todo).Assembly) {}

    public override void Configure(Container container)
    {
        container.Register(new TodoRepository());
    }
}

//REST Resource DTO
[Route("/todos")]
[Route("/todos/{Ids}")]
public class Todos : IReturn<List<Todo>>
{
    public long[] Ids { get; set; }
    public Todos(params long[] ids)
    {
        this.Ids = ids;
    }
}

[Route("/todos", "POST")]
[Route("/todos/{Id}", "PUT")]
public class Todo : IReturn<Todo>
{
    public long Id { get; set; }
    public string Content { get; set; }
    public int Order { get; set; }
    public bool Done { get; set; }
}

public class TodosService : Service
{
    public TodoRepository Repository { get; set; }  //Injected by IOC

    public object Get(Todos request)
    {
        return request.Ids.IsEmpty()
            ? Repository.GetAll()
            : Repository.GetByIds(request.Ids);
    }

    public object Post(Todo todo)
    {
        return Repository.Store(todo);
    }

    public object Put(Todo todo)
    {
        return Repository.Store(todo);
    }

    public void Delete(Todos request)
    {
        Repository.DeleteByIds(request.Ids);
    }
}

Calling the above TODO REST service from any C#/.NET Client

//no code-gen required, can re-use above DTO's

var client = new JsonServiceClient(BaseUri);
List<Todo> all = client.Get(new Todos());     		// Count = 0

var todo = client.Post(
    new Todo { Content = "New TODO", Order = 1 }); 	// todo.Id = 1
all = client.Get(new Todos());						// Count = 1

todo.Content = "Updated TODO";
todo = client.Put(todo);							// todo.Content = Updated TODO

client.Delete(new Todos(todo.Id));
all = client.Get(new Todos());						// Count = 0

Calling the TODO REST service from jQuery

$.getJSON(baseUri + "/todos", function(todos) {
	alert(todos.length == 1);
});

Calling the TODO REST service from Dart JsonClient

var client = new JsonClient(baseUri);
client.todos()
	.then((todos) => alert(todos.length == 1)); 

That's all the application code required to create a simple REST web service.

Getting Started

Release Notes

Download

If you have NuGet installed, the easiest way to get started is to:

Install ServiceStack via NuGet.

Latest v4+ on NuGet is a commercial release with free quotas.

Docs and Downloads for older v3 BSD releases

Examples

The Definitive list of Example Projects, Use-Cases, Demos, Starter Templates

Download published NuGet binaries without NuGet

GitHub has disabled its download feature so currently NuGet is the best way to get ServiceStack published releases. For environments that don't have NuGet installed (e.g. OSX/Linux) you can still download the published binaries by extracting them from the published NuGet packages. The url to download a nuget package is:

http://packages.nuget.org/api/v1/package/{PackageName}/{Version}

So to get the core ServiceStack and ServiceStack.Text libs in OSX/Linux (or using gnu tools for Windows) you can just do:

wget -O ServiceStack http://packages.nuget.org/api/v1/package/ServiceStack/3.9.71
unzip ServiceStack 'lib/*'

wget -O ServiceStack.Text http://packages.nuget.org/api/v1/package/ServiceStack.Text/3.9.71
unzip ServiceStack.Text 'lib/*'

which will download and extract the dlls into your local local lib/ folder.

Copying

Since September 2013, ServiceStack source code is available under GNU Affero General Public License/FOSS License Exception, see license.txt in the source. Alternative commercial licensing is also available, see https://servicestack.net/pricing for details.

Contributing

Contributors need to approve the Contributor License Agreement before any code will be reviewed, see the Contributing wiki for more details. All contributions must include tests verifying the desired behavior.

OSS Libraries used

ServiceStack includes source code of the great libraries below for some of its core functionality. Each library is released under its respective licence:

Similar open source projects

Similar Open source .NET projects for developing or accessing web services include:

  • Nancy Fx - A Sinatra-inspired lightweight Web Framework for .NET:
  • Fubu MVC - A "Front Controller" pattern-style MVC framework designed for use in web applications built on ASP.NET:
  • Rest Sharp - An open source REST client for .NET

Find out More

Follow @ServiceStack and +ServiceStack for project updates.


Core Team

Contributors

A big thanks to GitHub and all of ServiceStack's contributors:


Runs on both Mono and .NET (Live preview hosted on Mono / Ubuntu)

servicestack's People

Contributors

aaronlerch avatar adamfowleruk avatar angelcolmenares avatar bpruitt-goddard avatar danbarua avatar dbeattie71 avatar dchurchland avatar desunit avatar dsimunic avatar franklinwise avatar ggeurts avatar gshackles avatar iamruss avatar iristyle avatar jeffgabhart avatar joncanning avatar julrichkieffer avatar kevinhoward avatar layoric avatar mattjohnsonpint avatar mythz avatar pdegenhardt avatar prasannavl avatar pseabury avatar sneal avatar steff-mueller avatar tvjames avatar tystol avatar yeurch avatar zerhacken avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.