GithubHelp home page GithubHelp logo

divyanshu707 / amethyst Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amethyst-framework/amethyst

0.0 1.0 0.0 1.44 MB

Amethyst is a Rails inspired web-framework for Crystal language

Home Page: http://codcore.github.io/amethyst/

License: MIT License

Crystal 100.00%

amethyst's Introduction

#Amethyst-logo Pledgie Build Status Join the chat at https://gitter.im/Codcore/Amethyst

Amethyst is a web framework written in the Crystal language. The goals of Amethyst are to be extremely fast and to provide agility in application development, much like Rails. Why did I call it "Amethyst"? Because Github uses a light purple color for the Crystal language similar to the amethyst gemstone.

Latest version - 0.1.7 Note that Amethyst is at it early stages, so it lacks for whole bunch of things. But you can give a hand with contributing.

Amethyst examples

For detailed information, see docs on our wiki below:

Here are some benchmarking results

For now, next things are implemented:

  • class-based controllers with method-based actions
  • views for actions (*.ecr)
  • filters for action
  • middleware support
  • simple REST routing
  • default routes for controller
  • path, GET and POST params inside actions
  • basic cookies support
  • static files serving
  • http logger and timer for developers
  • simple environments support
  • simple session support

Example

Here is classic 'Hello World' in Amethyst

require "amethyst"

class WorldController < Base::Controller
  actions :hello

  view "hello", "#{__DIR__}/views"
  def hello
    @name = "World"
    respond_to do |format|
      format.html { render "hello" }
    end
  end
end

class HelloWorldApp < Base::App
  routes.draw do
    all "/",      "world#hello"
    get "/hello", "world#hello"
    register WorldController
  end
end

app = HelloWorldApp.new
app.serve

# /views/hello.ecr
Hello, <%= name %>

Using amethyst-bin to quickly generate your application

amethyst-bin is an executable shell script to help you quickly generate your Amethyst application.

It handles installing the base dependencies, views / controllers folder generation and main application file generation.

curl https://raw.githubusercontent.com/Sdogruyol/amethyst-bin/master/amethyst > amethyst && chmod +x amethyst
./amethyst sample

Voila! Your app is ready now you can run it

cd sample && crystal run src/sample.cr

Development

Feel free to fork project and make pull-requests.

Contributing

I would be glad for any help with contributing.

  1. Fork it ( https://github.com/Codcore/amethyst/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Support

Amethyst is not a commercial project,it is developed on pure enthusiasm, so if you want to support Amethyst developing, you can help with donating.

Pledgie

amethyst's People

Contributors

codcore avatar sdogruyol avatar yamadayuki avatar zamith avatar jhass avatar davydovanton avatar paa001 avatar cocuh avatar artintal avatar widdershin avatar gitter-badger avatar

Watchers

Divyanshu Upreti 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.