Giter VIP home page Giter VIP logo

bachelorthesis2---todolist-couchapp's Introduction

Todolist example CouchApp

CouchApps are web applications which can be served directly from CouchDB. More info about CouchApps here.

This applikation demonstrates authentification, write- and readautorisation. Three different readautorisation-approches where implemented. You can find them in the branches "encryption", "per-user-database" and "proxy-lists". It consists out of two Couchapps, todolist_app and users_app. Both need to be deployed.

Deploying this app

Define an admin for CouchDB so that it's not running an Admin Party.

Change into the app directory in your terminal, and push it to your CouchDB with the CouchApp command line tool, like this:

couchapp push

Do this with both apps. You'll need to configure your admin credentials in the .couchapprc files first.

To visit the app, navigate to http://localhost:5984/todolist(public)/_design/todolist/todolist/todolist.html

Branches

If you deploy the code of any of the three branches, there are some extra setup steps to follow:

Per-User-Database

You'll need an Apache2 server with mod_rewirte, mod_proxy enabled and PHP. Create a VirtualHost like this one:

<VirtualHost *:80>
    DocumentRoot /home/gaul/AptanaWorkspace/todolist/www
    ServerName todolist.localhost.de

    RewriteEngine on

    RewriteCond %{REQUEST_URI} ^/couch/_replicate.*$
    RewriteRule ^/(.*)$ proxy:http://todolist.localhost.de/404.html

    ProxyPass /couch http://localhost:5984

    <Location /couch/todolist(master)>
	    <LimitExcept POST PUT>
		    order deny,allow
		    deny from all
	    </LimitExcept> 
    </Location>
</VirtualHost>

Now create an additional CouchDB Database named "todolist(master)" and replicate once from "todolist(public)" in "todolist(master)"

To visit the app, navigate to http://todolist.localhost.de/couch/todolist(public)/_design/todolist/todolist/todolist.html

Proxy-Lists

You'll ned an Apache2 server with mod_rewrite. Create a VirtualHost like this one:

<VirtualHost *:80>
    ServerName todolist.localhost.de

    RewriteEngine on

    RewriteCond %{THE_REQUEST} ^DELETE|POST|PUT\ /.*$|^GET\ /todolist\(public\)/_design/todolist/(static|_list).*$|^GET\ /(_session|_users)
    RewriteRule ^/(.*)$ proxy:http://localhost:5984/$1

</VirtualHost>

To visit the app, navigate to http://todolist.localhost.de/todolist(public)/_design/todolist/static/todolist/todolist.html

Encryption

No additional software needed.

To visit the app, navigate to http://localhost:5984/todolist(public)/_design/todolist/todolist/todolist.html

bachelorthesis2---todolist-couchapp's People

Stargazers

 avatar  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.