Giter Site home page Giter Site logo

nishant8bits / koan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soygul/koan

1.0 1.0 0.0 3.49 MB

KOAN Stack (Koa, Angular, Node, Mongo, WebSockets) for real-time full-stack JavaScript web development.

Home Page: https://koan.herokuapp.com

License: MIT License

JavaScript 67.48% CSS 2.65% HTML 29.86%

koan's Introduction

KOAN

Build Status

KOAN Stack is a boilerplate that provides a nice starting point for full stack JavaScript Web development with Koa, AngularJS, and Node.js along with MongoDB and WebSockets. A summary of tech stack:

  • Client: AngularJS and Twitter Bootstrap with pure html partials (no server side rendering so it's fully static and CDN ready). Bower packages are located at client\bower_packages.
  • Server: Koa for RESTful API on top of Node.js v0.12 with the use of --harmony flag and ES6 generators.
  • WebSockets along with JSON-RPC is used for real-time client-server communication and browser sync.
  • OAuth 2 is used for social authentications. Instead of auth cookies, we use JWT along with HTML5 local storage.
  • Grunt tasks are used to facilitate development and testing.
  • MongoDB for persistence.

Live Example

Browse the live KOAN example on https://koan.herokuapp.com which is a Facebook like real-time sharing app.

Getting Started

Make sure that you have Node.js v0.12 (or io.js) and MongoDB v2.x (running on the default port 27017) installed on your computer. To get started with KOAN stack, do following:

git clone --depth 1 https://github.com/soygul/koan.git
cd koan
npm install
npm start

Your application should run on the 3000 port so in your browser just go to http://localhost:3000. If you want to run tests, simply type:

npm test

Configuration

All configuration is specified in the server/config folder, particularly the config.js file. Here you can hook up any social app keys if you want integration with Twitter, Facebook, or Google.

Heroku Deployment

Before you start make sure you have heroku toolbelt installed.

git init
git add .
git commit -m "initial version"
heroku apps:create
heroku addons:add mongohq
heroku config:add NODE_ENV=production
git push heroku master
heroku open

Optionally, you can pass credentials to KOAN via environment variables as it might not be secure to store them in your repo. Note that if you do this, you'll need to adjust other configuration options accordingly (i.e. FB/Google client IDs, etc.).

heroku config:add SECRET=jwt_secret PASS=login_pass FACEBOOK_SECRET=facebook_oauth_secret GOOGLE_SECRET=google_oauth_secret

Testing

You can run all the tests with npm test. Tests are run with:

  • Client (unit): Jasmine + Karma (Angular default)
  • Client (e2e): Jasmine + Protractor (Angular default)
  • Server: Mocha/SuperTest/Should (Koa default)

Server tests utilize co so you can use */yield expressions while writing tests. See /test/server/users.js as an example.

Credits

Client side is entirely based on the official: Angular Seed. Server side simply utilizes generally accepted Koa middleware and Node.js best practices.

The Name

The project name is an acronym for Koa, Angular, and Node. It also is the name for a Zen Buddhist riddle used to focus the mind during meditation and to develop intuitive thinking.

License

MIT

koan's People

Contributors

soygul avatar

Stargazers

Angus H. avatar

Watchers

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