• Stars
    star
    5,324
  • Rank 7,385 (Top 0.2 %)
  • Language
    C#
  • License
    Other
  • Created about 13 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all

Follow @ServiceStack or view the docs, use StackOverflow or the Customer Forums for support.

View the Release Notes for latest features or see servicestack.net/features for an overview.

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 that can leverage an integrated Service Gateway for the creation of loosely-coupled Modularized Service Architectures. ServiceStack Services are consumable via an array of built-in fast data formats (inc. JSON, XML, CSV, JSV, ProtoBuf, Wire and MsgPack) as well as XSD/WSDL for SOAP endpoints and Rabbit MQ, Redis MQ and Amazon SQS MQ hosts.

Its design and simplicity focus offers an unparalleled suite of productivity features that can be declaratively enabled without code, from creating fully queryable Web API's with just a single Typed Request DTO with Auto Query supporting every major RDBMS to the built-in support for Auto Batched Requests or effortlessly enabling rich HTTP Caching and Encrypted Messaging for all your existing services via Plugins.

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 that are able to deliver instant interactive experiences using ServiceStack's real-time Server Events.

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.

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 Applications as well as targeting the most popular .NET PCL platforms including Xamarin.iOS, Xamarin.Android, Windows Store, WPF, WinForms and Silverlight:

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

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

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!

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

The ServiceStack IDEA plugin is installable directly from IntelliJ's Plugin repository and enables seamless integration with IntelliJ Java Maven projects for generating a Typed API to quickly and effortlessly consume remote ServiceStack Web Services from pure cross-platform Java or Kotlin Clients.

The unmatched productivity offered by Java Add ServiceStack Reference is also available in the ServiceStackEclipse IDE Plugin that's installable from the Eclipse MarketPlace to provide deep integration of Add ServiceStack Reference with Eclipse Java Maven Projects enabling Java Developers to effortlessly Add and Update the references of their evolving remote ServiceStack Web Services.

In addition to our growing list of supported IDE's, the servicestack-cli cross-platform command-line npm scripts makes it easy for build servers, automated tasks and command-line runners of your favorite text editors to easily Add and Update ServiceStack References!

Simple Customer Database REST Services Example

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

//Web Service Host Configuration
public class AppHost : AppSelfHostBase
{
    public AppHost() 
        : base("Customer REST Example", typeof(CustomerService).Assembly) {}

    public override void Configure(Container container)
    {
        //Register which RDBMS provider to use
        container.Register<IDbConnectionFactory>(c => 
            new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider));

        using (var db = container.Resolve<IDbConnectionFactory>().Open())
        {
            //Create the Customer POCO table if it doesn't already exist
            db.CreateTableIfNotExists<Customer>();
        }
    }
}

//Web Service DTO's
[Route("/customers", "GET")]
public class GetCustomers : IReturn<GetCustomersResponse> {}

public class GetCustomersResponse
{
    public List<Customer> Results { get; set; } 
}

[Route("/customers/{Id}", "GET")]
public class GetCustomer : IReturn<Customer>
{
    public int Id { get; set; }
}

[Route("/customers", "POST")]
public class CreateCustomer : IReturn<Customer>
{
    public string Name { get; set; }
}

[Route("/customers/{Id}", "PUT")]
public class UpdateCustomer : IReturn<Customer>
{
    public int Id { get; set; }

    public string Name { get; set; }
}

[Route("/customers/{Id}", "DELETE")]
public class DeleteCustomer : IReturnVoid
{
    public int Id { get; set; }
}

// POCO DB Model
public class Customer
{
    [AutoIncrement]
    public int Id { get; set; }

    public string Name { get; set; }
}

//Web Services Implementation
public class CustomerService : Service
{
    public object Get(GetCustomers request)
    {
        return new GetCustomersResponse { Results = Db.Select<Customer>() };
    }

    public object Get(GetCustomer request)
    {
        return Db.SingleById<Customer>(request.Id);
    }

    public object Post(CreateCustomer request)
    {
        var customer = new Customer { Name = request.Name };
        Db.Save(customer);
        return customer;
    }

    public object Put(UpdateCustomer request)
    {
        var customer = Db.SingleById<Customer>(request.Id);
        if (customer == null)
            throw HttpError.NotFound("Customer '{0}' does not exist".Fmt(request.Id));

        customer.Name = request.Name;
        Db.Update(customer);

        return customer;
    }

    public void Delete(DeleteCustomer request)
    {
        Db.DeleteById<Customer>(request.Id);
    }
}

No code-gen required, can re-use above Server DTOs:

var client = new JsonServiceClient(BaseUri);

//GET /customers
var all = client.Get(new GetCustomers());                         // Count = 0

//POST /customers
var customer = client.Post(new CreateCustomer { Name = "Foo" });

//GET /customer/1
customer = client.Get(new GetCustomer { Id = customer.Id });      // Name = Foo

//GET /customers
all = client.Get(new GetCustomers());                             // Count = 1

//PUT /customers/1
customer = client.Put(
    new UpdateCustomer { Id = customer.Id, Name = "Bar" });       // Name = Bar

//DELETE /customers/1
client.Delete(new DeleteCustomer { Id = customer.Id });

//GET /customers
all = client.Get(new GetCustomers());                             // Count = 0

Same code also works with Android, iOS, Xamarin.Forms, UWP and WPF clients.

F# and VB.NET can re-use same .NET Service Clients and DTO's

const client = new JsonServiceClient(baseUrl);
const { results } = await client.get(new GetCustomers());
let client = JsonServiceClient(baseUrl: BaseUri)

client.getAsync(GetCustomers())
    .then {
        let results = $0.results;
    }
JsonServiceClient client = new JsonServiceClient(BaseUri);

GetCustomersResponse response = client.get(new GetCustomers());
List<Customer> results = response.results; 
val client = JsonServiceClient(BaseUri)

val response = client.get(GetCustomers())
val results = response.results
var client = new JsonServiceClient(BaseUri);

var response = await client.get(GetCustomers());
var results = client.results;
$.getJSON($.ss.createUrl("/customers", request), request, (r: GetCustomersResponse) => {
    var results = r.results;
});

Using TypeScript Definitions with Angular HTTP Client:

this.http.get<GetCustomersResponse>(createUrl('/customers', request)).subscribe(r => {
    this.results = r.results;
});

Calling from jQuery

$.getJSON(baseUri + "/customers", function(r) {
	var results = r.results;
});

That's all the application code required to create and consume a simple database-enabled REST Web Service!

Getting Started

Download

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

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

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

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 docs 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:

Find out More

Follow @ServiceStack and +ServiceStack for project updates.


Core Team

Contributors

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


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

More Repositories

1

redis-windows

Vagrant redis configuration and the binary releases of MS Open Tech redis port of windows
Shell
2,694
star
2

ServiceStack.Redis

.NET's leading C# Redis Client
C#
2,290
star
3

ServiceStack.OrmLite

Fast, Simple, Typed ORM for .NET
C#
1,530
star
4

ServiceStack.Text

.NET's fastest JSON, JSV and CSV Text Serializers
C#
1,220
star
5

ServiceStack.Examples

Example Projects built with ServiceStack, C# RedisClient, OrmLite, etc
HTML
327
star
6

Bundler

Compile & Minify Less/Sass/Stylus/Css/JS/CoffeeScript/LiveScript files. Integrates with MVC and ServiceStack
JavaScript
264
star
7

Stripe

Typed .NET clients for stripe.com REST APIs
C#
193
star
8

ServiceStackVS

ServiceStackVS - Visual Studio extension for ServiceStack
C#
118
star
9

redis-config

Configuration, scripts and docs for setting up redis servers and sentinels in popular configurations
Batchfile
101
star
10

Gistlyn

Run Roslyn Gists
TypeScript
82
star
11

ServiceStack.UseCases

Repository contains the projects with common use cases for ServiceStack.
C#
65
star
12

rabbitmq-windows

Installation and configuration instructions for installing Rabbit MQ on windows
C#
60
star
13

Admin

AutoQuery + Admin UI for ServiceStack Projects
C#
50
star
14

ServiceStack.Gap

Creating cross-platform Native Desktop apps with ServiceStack
JavaScript
45
star
15

PocoDynamo

C# .NET Typed POCO Client for AWS Dynamo DB
40
star
16

docs

Home of ServiceStack documentation.
JavaScript
38
star
17

ServiceStack.Aws

ServiceStack adapters and bindings for AWS backend services
C#
32
star
18

ServiceStack.Extras

Related but non-critical resources for the ServiceStack project
JavaScript
26
star
19

dotnet-app

ServiceStack app and web tools for developing ServiceStack's .NET Core Web Apps
C#
23
star
20

servicestack-client

ServiceStack Service Client, Server Events and validation library
TypeScript
20
star
21

Test

Test ServiceStack Services, Features and DTO's
JavaScript
15
star
22

ServiceStack.Java

ServiceStack Java Libraries and Apps
Java
11
star
23

ServiceStack.CefGlue

CefGlue bindings for .NET Standard 2.0
C#
11
star
24

Issues

Issue Tracker for the commercial versions of ServiceStack
11
star
25

MonoTouch.Examples

ServiceStack examples with MonoTouch
C#
11
star
26

Discuss

GitHub Discussions for ServiceStack
11
star
27

servicestack-dart

Dart servicestack client pub
Dart
9
star
28

ServiceStack.Swift

Swift support used in ServiceStack
Swift
9
star
29

ServiceStack.Azure

ServiceStack adapters and bindings for Azure backend services
C#
9
star
30

servicestack-editor

ServiceStack Markdown Editor for Vuetify
Vue
8
star
31

Studio

ServiceStack Studio
TypeScript
7
star
32

Templates

Popular starting templates and configurations for ServiceStack
JavaScript
6
star
33

servicestack-vue2

Vue controls for ServiceStack Apps
Vue
6
star
34

vuedesktop.com

vuedesktop.com
JavaScript
6
star
35

Assets

Image and Web assets used in Docs and Demos
CSS
6
star
36

script-unity

Script Unity 3D objects from a #Script Lisp REPL
C#
5
star
37

servicestack-cli

node.js command-line utilities for ServiceStack
TypeScript
4
star
38

servicestack-vue

Vue3 Tailwind Components
JavaScript
4
star
39

servicestack-angular

Angular controls for ServiceStack Apps
TypeScript
4
star
40

images

Collection of free images and resources for Websites and Apps
JavaScript
4
star
41

gulp-msdeploy

gulp wrapper for msdeploy
JavaScript
4
star
42

AutoQueryViewer

Back-end services used by AutoQuery Viewer
C#
4
star
43

protoc-api

HTTP API for generating gRPC clients using protoc
C#
3
star
44

ss-utils

npm package for ss-utils.js
JavaScript
3
star
45

servicestack-python

Python ServiceStack Client
Python
3
star
46

jupyter-notebooks

Examples of ServiceStack Jupyter Notebooks
Jupyter Notebook
2
star
47

docs.servicestack.net

ServiceStack Docs built with Razor SSG
JavaScript
2
star
48

WebWin

.NET Core 2.1 Self-Contained Cef Binaries (Windows 64)
2
star
49

servicestack.net

servicestack.net website
JavaScript
2
star
50

locode

Locode website
Vue
2
star
51

gistcafe-dart

gist.cafe utils for Dart
Dart
2
star
52

Web

Binaries for ServiceStack .NET Core 2.1 Web Apps
2
star
53

servicestack-react

React controls for ServiceStack Apps
TypeScript
2
star
54

apps

apps.cafe
C#
1
star
55

gistcafe-kotlin

gist.cafe utils for Kotlin
Kotlin
1
star
56

ServiceStackIDEA

Jetbrains IDE plugin for ServiceStack
Java
1
star
57

gistcafe-deno

gist.cafe utils for Deno
TypeScript
1
star
58

vitepress-docs

C#
1
star
59

mix

Maintain web mix gists
C#
1
star