GithubHelp home page GithubHelp logo

felix-b / nwheels Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nwheels-io/nwheels

1.0 2.0 0.0 28.18 MB

Super productive C#-first full-stack application framework

License: MIT License

C# 98.57% HTML 0.15% JavaScript 0.70% CSS 0.02% PowerShell 0.47% Batchfile 0.09%

nwheels's Introduction

Linux Windows Coverage
TBD Build status codecov

Welcome to NWheels

From our experience, commonality in the needs of enterprise application projects is significantly higher than variability.

Based on that, we aim to let flexibly designed, performant, feature-rich software systems be built at significantly lower costs, within significantly shorter timeframes.


How It Works

What vs. How is half the key

We eliminate manual coding and maintenance of mechanically repetitive parts throughout the stack (UI, RESTful API, DB, including fine-grained access control and deployment images, to name just a few).

These are derived from application models enriched with what as opposed to how. The rich models allow deriving sensible implementations with minimal effort (the 80/20 law, and we want 90/10).

Yet, NWheels won't stand on your way when creativity and uniqueness are desired. Manual control can easily be taken at any level.

Share & Reuse is the second half

We provide an API medium and foundation for creating, sharing, and reusing pluggable building blocks. These scale from solving small recurring problems, to implementing feature-rich subsystems in common business and infrastructural domains (examples are CMS; CRM; Shopping cart; Stock exchange; SaaS & customizations; Application security; i18n - to name just a few).

The core of NWheels is built itself in the same way.

30,000 Feet View


ATTENTION: we are redoing from scratch after successful proof of concept. Features listed here may not yet exist, or be unstable.

Responsibility segregation

NWheels: Application developers:
Implements industrial-strength architectures with full-stack coverage of typical requirements and DevOps/ALM aspects. Subjects covered include information security, business intelligence, testability, multitenancy, scalability, health monitoring with production profiling, fault tolerance, customizability, internationalization, continuous delivery, and more. Get an automated customizable DevOps workflow, and a production-ready software system right off, which only misses unique features of the application being developed.
Provides application developers with full-stack concise programming models, abstracted from concrete technology stacks. Dramatically reduces size of application codebase. Allows writing code clean from underlying technology details. Enforces common conventions throughout the codebase. Allows projects to work both fast and right, starting on day one. Implement application features in C# on top of NWheels programming models, including UI, business logic, data access, communication endpoints, and more.
Supplies building blocks for common problem domains, based on field-proven patterns and designs. Such domains include e-commerce, CRM, booking, marketing, accounting, and many more. Flexible vertical and horizontal composability of NWheels domain models enables easy extension and adaptation of building blocks to application requirements. Whenever possible, reuse domain building blocks; extend and adapt them to application requirements. Save on effort and mistakes. Avoid reinvention of the wheel.
Supplies pluggable adapters to concrete technology stacks, including databases, provisioning/scalability platforms, messaging middleware, UI technologies, DevOps infrastructure, and many more. Adapters generate implementations of application programming models per underlying technologies. Adapters also include and configure required 3rd-party services in automated deployments (e.g., Redis, MongoDB). Pick ready technology stacks to plug in, according to application requirements. Save on technology learning curve and technology expert services. Easily afford changes in technology choices.

Demo

NWheels is already capable of bootstrapping a microservice which has business logic and exposes a simple web app, as shown in the figure below.

Demo data flow

Currently, the demo uses mockup assets for the single-page web app. Planned are pluggable SPA themes and code generation of assets on top of the theme. Implementation code listed below will not be affected by the change.

Code

NWheels-based implementation is about 50 lines of code in C#, all layers included. More details and explanations can be found here.

Program.cs - microservice entry point

public static int Main(string[] args)                          
{
    var microservice = new MicroserviceHostBuilder("hello")  
        .AutoDiscoverComponents()
        .UseDefaultWebStack(listenPortNumber: 5000)
        .Build(); 

    return microservice.Run(args);
}

HelloWorldTx.cs - business logic

[TransactionScriptComponent]
[SecurityCheck.AllowAnonymous]
public class HelloWorldTx
{
    [TransactionScriptMethod]
    public async Task<string> Hello(string name)
    {
        return $"Hello world, from {name}!";
    }
}

HelloWorldApp.cs - web app

[WebAppComponent]
public class HelloWorldApp : WebApp<Empty.SessionState>
{
    [DefaultPage]
    public class HomePage : WebPage<Empty.ViewModel>
    {
        [ViewModelContract]
        public class HelloWorldViewModel 
        {
            [FieldContract.Required]
            public string Name;
            [FieldContract.Semantics.Output, FieldContract.Presentation.Label("WeSay")]
            public string Message;
        }

        [ContentElement] 
        [TransactionWizard.Configure(SubmitCommandLabel = "Go")]
        public TransactionWizard<HelloWorldViewModel> Transaction { get; set; }

        protected override void ImplementController()
        {
            Transaction.OnSubmit.Invoke<HelloWorldTx>(
                tx => tx.Hello(Transaction.Model.Name)
            ).Then(
                result => Script.Assign(Transaction.Model.Message, result)
            );
        }
    }
}

Running the demo

System requirements

  • Running on your machine:

    • Linux, Windows, or macOS machine
    • .NET Core SDK 1.1 or later (download here)
  • Running in Docker (Linux container):

    $ docker run --name nwheels-demo -p 5000:5000 -it microsoft/dotnet:1.1-sdk /bin/bash

Get sources and build

$ git clone https://github.com/felix-b/NWheels.git nwheels
$ cd nwheels/Source/
$ dotnet restore
$ dotnet build

Run microservice

$ dotnet NWheels.Samples.FirstHappyPath.HelloService/bin/Debug/netcoreapp1.1/hello.dll

Open web application

  • If running on your machine:
  • If running in docker container:
    • Print container IP address:
      $ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nwheels-demo
    • Browse to http://container_ip_address:5000

Feature Highlights

  • Programming languages: applications are developed in C#, and primarily target cross-plafrorm .NET Core or .NET Standard. Targeting Windows-only .NET Framework is also supported.

  • Kinds of applications:

    • Multi-tier systems consisting of UI apps, microservices, and databases
    • API backends and high-throughput low-latency data processing middleware, optionally based on in-memory data/actor grids
    • B2B integration solutions
    • Fat standalone or peer-to-peer UI apps that include business logic
    • Any combination of the above
  • Runtime environments

    • Servers will run on Linux, Windows, any macOS. Any compatible IaaS/CaaS cloud, hybrid, and on-premises deployments will be supported.
    • UI will run as native mobile apps, web single-page apps, desktop apps on Linux/Windows/macOS; UI on top of IVR, SmartTV, and IoT platforms will be supported.
  • Scalability and high availability

    • Scalable, fault-tolerant, containerized, microservice- and lambda-based architectures.
    • Elastic scalability and high availability with zero-downtime deployments; cross-zone and cross-cloud-vendor DR environments will be supported for mission-critical systems.
  • Extensibility: NWheels is extensible all the way; we welcome contributions by the community

    • Technology stack adapters: adapter modules can be contributed to support wide range of technology stacks
    • Domain building blocks: expertise in problem domains can be shared through contribution of domain building block modules
    • Programming models (for the most advanced): new programming models can be developed to introduce new development concepts and paradigms.
    • Modularity all the way: both NWheels and NWheels-based applications are customizable and extensible through the mechanism of pluggable modules and features. For SaaS and off-the-shelf software products, this means out-of-the-box support for modular licensing and customer-specific solutions.    

More Info

More info on NWheels can be found in resources listed below:

Getting Involved

Excited? We'd like having you onboard!

Community is a vital part of the NWheels project. Here we are building a welcoming and friendly ecosystem for expertise sharing and contribution.

Where to start

  1. Please make yourself familiar with our Code of Conduct.
  2. Run the demo (if you haven't already done that)
  3. Carefully read our Contribution Guidelines.
  4. Please feel free to communicate your thoughts and reach out for help.

Current Status

Starting from February 2017, we are developing our second take at NWheels.

Current milestone: 02 - Convergence

PRIMARY GOAL: complete gaps in the core concept, and demonstrate productivity boost through short create-and-deploy cycle.

  1. Make NWheels consumable through NuGet packages
  2. Make server-side code generation work
  3. Support deployment in a cloud

SECONDARY GOAL: upgrade to .NET Core 2.0 and provide compatibility with the legacy .NET Framework.

  1. Target .NET Standard 2.0 and .NET Core 2.0
  2. Allow developing NWheels-based applications on .NET Framework 4.6.1

MILESTONE LINKS

History

The first take at NWheels was named Milestone Afra. It is now in use by two proprietary real-world applications. Further development was abandoned for high technical debt, few architectural mistakes, and in favor of targeting cross-platform .NET Core.

Concept proven

Applications built on top of NWheels milestone Afra shown us that the core concept is correct and robust. With that, we learned a lot of lessons, and faced few mistakes in architecture and implementation.

Timeline

Year Summary
2013 Started development of Hapil library for code generation, which is an essential part of NWheels concept.
2014 Hapil library gained enough features. Started development of NWheels milestone Afra. Implemented server bootstrapping and metadata-based composition of domain objects. Added support for data persistence through Entity Framework.
2015 Development of NWheels milestone Afra continued. Added support for Mongo DB. Started development of model-based UI, and web UI stack based on a Bootstrap theme, AngularJS, and ASP.NET Web API.
2016 NWheels milestone Afra reached enough maturity to support full-stack development. Two proprietary real-world applications developed on top of NWheels milestone Afra: one released to production, one is in the beta stage. These applications proved that the concept of NWheels works, but taught us a few lessons.
2017 Further development of NWheels milestone Afra abandoned; started development of second take at NWheels, completely from scratch.

nwheels's People

Contributors

felix-b avatar ilyail83 avatar

Stargazers

Ilker Halil Turer avatar

Watchers

James Cloos 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.