Giter Club home page Giter Club logo

ppnet's Introduction

PPnet

What is this?

"We need something like Facebook, but just not Facebook." If you heard that from your client, or thought that yourself, PPnet might be for you.

PPNet is a middleware that can be used to create a social network, either temporarily or permanently for a group of users. It provides the functionality of social interactions in the digital world (like posting status messages and images) apart from the major, proprietary social networks (like Facebook). It is particularly useful for intra- or extranet based social networks since users maintain the sovereignty about their own data.

image

Watch this video to see what it can do:

ScreenShot

This project is partly funded by the Europian Union through the FI-CONTENT2 project which is part of FI-PPP (It is called 'Social Network Enabler' there . We chose another name here on Github, because most people are not aware of the FI-PPP lingo).

Disclaimer: it was successfully tested in the Cologne Carnival with poor network connectivity in a small-scale experiment with less than hundred people. So, yes it works. But no, it's not ready yet. If you need something bigger, go for http://pump.io/ for the moment (but this is alpha).

Team

PPnet is mainly developed by Tobias Rotter (@tobiasrotter) and Philipp Reinking (@PhilReinking); project lead is Dirk Krause (@dirkk0).

PPnet 2.0

PPnet is built as a single page application (SPA) in the JavaScript framework AngularJS, and uses a PouchDB/CouchDB combination for data synchronisation. The nice thing about this architecture is that you only need a CouchDB as a server side component (plus a simple HTTP Server) and that it works in online/offline mode.

Steps for running PPnet 2.0 as WebApp

Quickstart

If you don't want to go through the hassle of installing development tools you can test PPnet by following these steps:

  • simply download the zip file of this repository,
  • navigate to the www directory (cd www)
  • start a web server right there (python -m SimpleHTTPServer or python3 -m http.server ) If you navigate to http://localhost:8000 you should see PPnet with that latest entries of our test database.

To connect to your own database, you only need to change the remoteentry in the config file to a running, CORS enabled CouchDB.

Changing this is the minimum thing you want to do to create your own database for your own social network. You will want to change the other entries too, to change the name of the application, the default location and so forth.

Building the project

These steps project lead you to the required steps to build the www folder that contains the web application.

Requirements PPnet 2.0 Installation

  • Node.js (including NPM)
  • Bower ('npm install -g bower')

Ruby and Compass/Sass

Installation

  • Checkout PPnet 2.0 Repository and "cd" into ppnet folder
git clone https://github.com/pixelpark/ppnet
cd ppnet
  • Install all required NPM Packages
npm install
  • Install all Bower dependencies
bower install
  • Run Gulp
npm run gulp

Build the Phonegap App

We use gulp for building an optimized version of the app-folder. The output is saved to the www-folder.

npm run build

Then phonegap is able to run its own build task:

phonegap build android

PPnet 1.0

note: most of the information below is still working. we are currently in the process of documenting the 2.x version

Installation as a web application

There are just two components needed to get your own social network up and running:

  • a CouchDB database server (Version 1.3+)
  • a simple webserver with the root directory pointing to the 'www' directory in this Git.

The application uses a PouchDB/CouchDB replication to handle offline/online scenarios.

Setting up the CouchDB

First, you need to install it (this is not mandatory, but additionally you might want to install these enhancements. Once you did that, you can access the administration interface on http://yourip.com:5984 where you need to enable CORS.

You do that by editing these values:

httpd enable_cors  true
cors credentials   true	
headers            accept, authorization, content-type, origin, Cookie	
methods            GET, PUT, POST, HEAD, DELETE	
origins            *

The adminstration interface looks like this admin

If your CouchDB is not on a local machine, you need to edit the configfile (usually at /usr/local/etc/couchdb) and edit this line:

[httpd]
bind_address = 0.0.0.0

To connect the web app to your own database, you only need to change the remoteentry in config file located in the www-folder.

Once you did that, you are good to go.

Setting up the web server

The easiest way to do this is to

  • clone or unzip this repository
  • cd to the 'www' directory
  • enter python -m SimpleHTTPServer (if your on Python 2.*) or python3 -m http.server for python3.

Then open a Chrome or a Firefox browser and browse to http://yourip.com:8000 and you should see the login screen:

login

You can enter any name and any number and you are logged in.

The viewport to the map view is hardcoded to some place in Cologne. You can change the Map-Viewport by changing the loadMapView-Function in the ViewController (ppmet/www/js/controller/view_controller.js - Lines 391-400).

    394: map = L.map('map').setView([50.9188, 6.9242], 15);

Create the Android application

Additionally, you can enjoy the benefits of having a native app, kudos to the Phonegap / Cordova project.

Important: since the app needs Chromium as the default engine, only KitKat (Android 4.4.2) is supported. If someone knows how to install Chromium with phonegap, give as a holler. You can, however, also use the Chrome browser on any Android.

To install Phonegap locally on a machine read the next chapter. Alternatively you can also try a service like http://build.phonegap.com or http://www.telerik.com/appbuilder, but your mileage may vary.

Local install

If you want to set up the software in its own directory, you can clone the git repository, so:

$ git clone https://github.com/pixelpark/ppnet
$ cd ppnet

Add Android as a platform to cordova (I don't think you need to do that?):

$ cordova platform add android

Add Plugins

$ phonegap plugin add org.apache.cordova.device-orientation
$ phonegap plugin add org.apache.cordova.file
$ phonegap plugin add org.apache.cordova.file-transfer
$ phonegap plugin add org.apache.cordova.device
$ phonegap plugin add org.apache.cordova.camera
$ phonegap plugin add org.apache.cordova.statusbar
$ phonegap plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git

Build Android APK

$ phonegap build android

OR

Build Android APK and deploy to device

$ phonegap run android

Requirements

  • NodeJS
  • Java
  • Ant
  • Android SDK
  • Phonegap

Windows

If everything worked out you can type java -version in a terminal and it should return the version number without errors.

  • Install ANT http://ant.apache.org/manual/install.html (Kudos to Tobias Seckinger)

  • Move the content of the zip file to c:\ant.

  • Add c:\ant\bin to the environment variable PATH:

  • Create the environment variable ANT_HOME and set it to C:\ant.

  • Create the environment variable ANT_OPTS and set it to -Xmx256M.

If everything worked out you can type ant -version in a terminal and it should return the version number without errors.

  • Install Android SDK http://developer.android.com/sdk/

  • Move the installation to C:\android.

  • Create the environment variable ANDROID_HOME and set it to c:\android\sdk.

If everything worked out you can type android -h in a terminal and it should return the help text without errors.

Ubuntu

On Ubuntu 12.04 this should be:

#install latest node
sudo add-apt-repository --yes ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install --yes nodejs
 
# java
sudo apt-get -y install openjdk-7-jdk
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=${PATH}:${JAVA_HOME}/bin
 
# ant
sudo apt-get --yes install ant
 
# Android SDK
wget http://dl.google.com/android/android-sdk_r20-linux.tgz
tar -xvzf android-sdk_r20-linux.tgz
 
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
 
sudo apt-get -y install expect
 
# install packages, for reference see:
#   android list sdk --all
 
# install Platform-tools (2)
expect -c '
set timeout -1   ;
spawn android update sdk -u -a -t 2; 
expect { 
    "Do you accept the license" { exp_send "y\r" ; exp_continue }
    eof
}
'
 
# install Tools (1)
expect -c '
set timeout -1   ;
spawn android update sdk -u -a -t 1; 
expect { 
    "Do you accept the license" { exp_send "y\r" ; exp_continue }
    eof
}
'
 
# install Build-tools (3)
expect -c '
set timeout -1   ;
spawn android update sdk -u -a -t 3; 
expect { 
    "Do you accept the license" { exp_send "y\r" ; exp_continue }
    eof
}
'
 
# install 4.4.2 (10) a.k.a. KitKat
expect -c '
set timeout -1   ;
spawn android update sdk -u -a -t 12; 
expect { 
    "Do you accept the license" { exp_send "y\r" ; exp_continue }
    eof
}
'
 
# install 32-bit dependencies
# http://sixarm.com/about/ubuntu-apt-get-install-ia32-for-32-bit-on-64-bit.html
sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6
sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev
sudo apt-get install -y g++-multilib
 
# phonegap
sudo npm install -g phonegap
 
sudo apt-get -y install git

Version History

v0.1: 2/28/2014

Initial Release.

  • Working system.
  • Three views.
  • Offline Support.
v0.2: 5/2/2014

Second Release.

  • Bower and npm support
  • refactored, cleaner code base

ppnet's People

Contributors

tobiasrotter avatar philreinking avatar dirkk0 avatar hertho avatar basti280482 avatar

Watchers

Christophe Deverre 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.