Coder Social home page Coder Social logo

zewo's Introduction

Zewo

Swift Platform License Slack Travis

Getting StartedContributingUmbrella PackageZewo Packages

Zewo

Zewo is a set of libraries for server side development. With Zewo you can write your web app, REST API, command line tool, database driver, etc. Our goal is to create an ecosystem around the modules and tools we provide so you can focus on developing your application or library, instead of doing everything from scratch.

Currently, we have around 50+ packages. This list grows very fast so it might be outdated. To be sure just check our organization.

Getting started

Swiftenv

Swiftenv allows you to easily install, and switch between multiple versions of Swift. You can install swiftenv following official instructions.

⚠️ With homebrew use brew install kylef/formulae/swiftenv --HEAD.

Once you have it, install the Swift Development Snapshot from April 12, 2016.

swiftenv install DEVELOPMENT-SNAPSHOT-2016-04-12-a

Create your first Zewo web application

First we need to create a directory for our app.

mkdir hello && cd hello

Now we initialize the project with Swift Package Manager (SPM) and select the 04-12 toolchain with Swiftenv.

swift build --init
swiftenv local DEVELOPMENT-SNAPSHOT-2016-04-12-a

This command will create the basic structure for our app.

.
├── Package.swift
├── Sources
│   └── main.swift
└── Tests

Open Package.swift with your favorite editor and add HTTPServer, Router as dependencies.

import PackageDescription

let package = Package(
    name: "hello",
    dependencies: [
        .Package(url: "https://github.com/VeniceX/HTTPServer.git", majorVersion: 0, minor: 5),
        .Package(url: "https://github.com/Zewo/Router.git", majorVersion: 0, minor: 5),
    ]
)

Do your magic

Open main.swift and make it look like this:

import HTTPServer
import Router

let router = Router { route in
    route.get("/hello") { _ in
        return Response(body: "hello world")
    }
}

try Server(responder: router).start()

This code:

  • Creates an HTTP server that listens on port 8080 by default.
  • Configures a router which will route /hello to a responder that responds with "hello world".

Build and run

Now let's build the app.

swift build

After it compiles, run it.

.build/debug/hello

Now open your favorite browser and go to http://localhost:8080/hello. You should see hello world in your browser's window. 😊

What's next?

Zewo has a lot of modules, check out our organization for more. You can also take a look at our documentation which is growing every day. If you have any doubts you can reach us at our slack. We're very active and always ready to help.

See also:

Umbrella Package

To make your life easier we provide the Zewo umbrella package which resides in this repository. This package provides the most important modules so you don't have to add all of them one by one.

import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/Zewo/Zewo.git", majorVersion: 0, minor: 5)
    ]
)

Contributing

Hey! Like Zewo? Awesome! We could actually really use your help!

Open source isn't just writing code. Zewo could use your help with any of the following:

  • Finding (and reporting!) bugs.
  • New feature suggestions.
  • Answering questions on issues.
  • Documentation improvements.
  • Reviewing pull requests.
  • Helping to manage issue priorities.
  • Fixing bugs/new features.

If any of that sounds cool to you, send a pull request! After a few contributions, we'll add you to the organization team so you can merge pull requests and help steer the ship 🚢

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Issues

Because we have lots of modules we use the main repo (this one) to track all our tasks, bugs, features, etc. using Github issues.

Some of us use ZenHub to manage the issues. Unfortunately ZenHub only supports Google Chrome and Firefox, but looks like they're working on Safari support.

Zewo Packages

External Packages

Code

If you want to contribute with code you should use our development tool zewo-dev. It makes it much easier to deal with the multitude of packages we maintain.

Community

Slack

The entire Zewo code base is licensed under MIT. By contributing to Zewo you are contributing to an open and engaged community of brilliant Swift programmers. Join us on Slack to get to know us!

License

Zewo is released under the MIT license. See LICENSE for details.

zewo's People

Contributors

alex-alex avatar antonmes avatar barbosa avatar benchr267 avatar bre7 avatar briancroom avatar danappelxx avatar davidask avatar dreymonde avatar fengluo avatar goloveychuk avatar paulofaria avatar rabc avatar scottbyrns avatar shingt avatar terhechte avatar togira avatar unnamedd avatar vsouza avatar

Watchers

 avatar  avatar  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.