GithubHelp home page GithubHelp logo

alokmishra / yesod Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yesodweb/yesod

1.0 2.0 0.0 6.03 MB

A RESTful Haskell web framework built on WAI.

Home Page: http://www.yesodweb.com/

License: MIT License

yesod's Introduction

Yesod

An advanced web framework using the Haskell programming language. Featuring:

  • safety & security guaranteed at compile time
  • developer productivity: tools for all your basic web development needs
  • raw performance
    • fast, compiled code
    • techniques for constant-space memory consumption
  • asynchronous IO
    • this is built in to the Haskell programming language (like Erlang)
    • handles a greater concurrent load than any other web application server

Install the latests stable Yesod: http://www.yesodweb.com/page/quickstart

cabal update && cabal install yesod

Create a new project after installing

yesod init

Your application is a cabal package and you use cabal to install its dependencies.

Installing & isolation

Install conflicts are unfortunately common in Haskell development. If you are not using any sandbox tools, you may discover that some of the other haskell installs on your system are broken. You can prevent this by using sandbox tools: cabal-dev or hsenv.

Isolating an entire project with a virtual machine is also a great idea, you just need some tools to help that process. Vagrant is a great tool for that and there is a Haskell Platform installer for it.

Using cabal-dev

cabal-dev creates a sandboxed environment for an individual cabal package. Instead of using the cabal command, use the cabal-dev command which will use the sandbox.

Use yesod devel --dev when developing your application.

Installing the latest development version from github for use with your application

cabal update
cabal install cabal-meta cabal-src

In your application folder, create a sources.txt file with the following contents:

./
https://github.com/yesodweb/yesod
https://github.com/yesodweb/shakespeare
https://github.com/yesodweb/persistent
https://github.com/yesodweb/wai

./ means build your app. The yesod repos will be cloned and placed in a vendor repo. Now run: cabal-meta install. If you use cabal-dev, run cabal-meta --dev install

This should work almost all of the time. You can read more on cabal-meta If you aren't building from an application, remove the ./ and create a new directory for your sources.txt first.

hsenv (Linux only)

hsenv prevents your custom build of Yesod from interfering with your currently installed cabal packages:

  • hsenv creates an isolated environment like cabal-dev
  • hsenv works at the shell level, so every shell must activate the hsenv
  • cabal-dev by default isolates a single cabal package, but hsenv isolates multiple packages together.
  • cabal-dev can isolate multiple packages together by using the -s sandbox argument

cabal-src

The cabal-src tool helps resolve dependency conflicts when installing local packages. This capability is already built in if you are using cabal-dev or cabal-meta. Otherwise install cabal-src with:

cabal install cabal-src

Whenever you would use cabal install to install a local package, use cabal-src-install instead. Our installer script now uses cabal-src-install when it is available.

Cloning the repos

The above instructions for building the latest should work well. But you can clone the repos without the help of cabal-meta:

for repo in shakespeare persistent wai yesod; do
  git clone http://github.com/yesodweb/$repo
  (
    cd $repo
    git submodule update --init
  )
done

Building your changes to Yesod

Yesod is composed of 4 "mega-repos", each with multiple cabal packages. ./script/install will run tests against each package and install each package.

install package in all repos

for repo in shakespeare persistent wai yesod; do
    pushd $repo
    ./scripts/install
    popd
done

Clean build (sometimes necessary)

./scripts/install --clean

Building individual packages

# move to the individual package you are working on
cd shakespeare-text

# build and test the individual package
cabal configure -ftest --enable-tests
cabal build
cabal test

yesod's People

Contributors

aculich avatar adamtulinius avatar alexkay avatar alios avatar bjornbm avatar chreekat avatar dlthomas avatar dudebout avatar ehamberg avatar gregwebs avatar iand675 avatar khanage avatar konn avatar luite avatar markwright avatar meteficha avatar michaelxavier avatar mlinksva avatar nubis avatar paronsson avatar pbrisbin avatar piyush-kurur avatar psub avatar raphaelj avatar rianhunter avatar shimuuar avatar snoyberg avatar softmechanics avatar sol avatar tarrasch avatar

Stargazers

 avatar

Watchers

 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.