GithubHelp home page GithubHelp logo

tuchang / karhu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from endor/karhu

0.0 1.0 0.0 695 KB

Products data management as HTML5 Web App

Ruby 12.66% JavaScript 34.05% Gherkin 24.64% C# 10.41% ASP 0.06% HTML 10.73% CSS 7.45%

karhu's Introduction

#Products data management as HTML5 Web App

This is a basic business-oriented application which catalogues products and divides them into categories. Those categories as well as the products can be created, updated and deleted. In addition to this typical CRUD approach, there are other standard tasks that will be handled: internationalization, validation of input and controlling the application via the keyboard. One of the most important aspects of the app is that it will use HTML5 local storage in order to allow offline editing.

Running the App

There are two possibilities to run the backend.

Sinatra

If you have Sinatra installed you can simply run the app with the following command:

ruby lib/proxy.rb

ASP.NET

If you prefer to run the app with ASP.NET MVC3 you have to have the following prerequisites:

* SQL Server Express
* ASP.NET MVC3 with the latest Tools update

Setup karhu to run in the ASP.NET Backend

First thing to do is to install Entity Framework 4.1 via nuget. To do this just open the package manager console and type

install-package EntityFramework. 

To use the Karhu client with this backend please copy the contents of the public folder into the Karhu.Backend project in Visual Studio 2010. Ensure that index.html and config.js is in the root of Karhu.Backend and the subdirectories

* css
* images
* js
* locales
* templates
* vendor

are in place. Then just simply execute the application by starting in debug mode and you should have a running copy of Karhu with appropriate .NET backend.

More information is written down in todo.html in the Karhu.Backend directory.

Testing

  • Install Cucumber and Jasmine Gems
  • Run
    • rake for all tests
    • rake cucumber for acceptance tests
    • rake jasmine:ci for unit tests
  • Note: testapp.rb is the ruby backend used for the acceptance tests.

Architecture

The app is built upon Sammy.js and the master branch is the most current and productive one. There is however a backbone_js branch which implements some of the functionality with Backbone.js.

API

Categories

GET /categories
GET /categories/1
POST /categories - expect created object back
PUT /categories/1 - expect updated object back
DELETE /categories/1


Category {
  id: "1234",
  name: "Kategorie 1",
  description: "Die erste Kategorie"
}    

Products

GET /products
GET /products/1
POST /products - expect created object back
PUT /products/1 - expect updated object back
DELETE /products/1


Product {
  id: "5678",
  name: "Product1",
  description: "Beschreibung hier",
  unit_price: "232,00",
  valid_to: "20.12.2012",
  category_id: "1234"
}

Pagination

Request

GET /products?page=1&per_page=5

Response

{
  current_page: 1,
  total_pages: 2,
  total_entries: 7,
  per_page: 5,
  values: [{product1}, {product2}, ...]
}

Sorting

GET /products?sort=description

Filtering

GET /products?filter=Strawberry

Author

Contributions

Thank you!

karhu's People

Contributors

endor avatar kunstreich avatar hernad 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.