Coder Social home page Coder Social logo

socialnetwork's Introduction

SocialNetwork

works pretty similar to a well known social network, but you can host it on your very own infrastructure or intranet.

Demo

http://social.codejungle.org/

Donate

Bitcoins: 1GqMSGseij18JnAoB9f3LHJRozNr1QeHkh

Ethereum: 0x6788024D1D36641DDE7832ce9B0300eBbD7C4832

API Documentation

http://www.dasmerkendienie.com/help/

Features

  • Share (Websites, Images, Videos, SourceCode)
  • Like / Dislike / Comments
  • #hash tag search (orderd by popularity)
  • @user mentions and notifications via websockets
  • REST API
  • Oauth2 (Facebook, Google+)
  • Backend with Dashboard

Side Projects

Requirement

  • Webserver (Apache2 or Nginx)
  • PHP

Installation

Download Sourcecode

Via GIT:

git clone https://github.com/andreas83/SocialNetwork.git

Via direct Download:

https://github.com/andreas83/SocialNetwork/archive/andrea.zip

Install dependencies

We use composer for our PHP dependencies. To install necessary dependencies like phpmailer, oauth2 libs, altorouter etc just run following cmd

cd SocialNetwork
composer install

Configuration

you can adjust the db credentials in app/config/main.cfg

db_name="dmdn"
db_user="user"
db_pass="pass"

You will find the database.sql file in repro.

Also you should adopt following configuration parameter

address="http://www.yourdomain.com"
dir="/var/www/vhost";

the upload_address is useful for large installation, if you plan to host your images on a server optimitzed for static content delivery,

# Upload path & address
upload_path="/public/upload/"
upload_address="http://static.youdomain.com/"

For security reasons please don`t forget to change the salat to some other random string

salat="KJMnmnNUU&/§N(JH/h80h87fnunu43h8u7"

If you like to use the Facebook or Google login, following settings are required:

# Facebook Auth
facebook_auth=true; //set to false if you dont like fb login
facebook_app_id="";
facebook_app_secret="";

# Google Auth
google_auth=true;
google_app_id="";
google_app_secret="";

##Permissions

Please make sure that following directories are writeable by webserver

public/css/scss/
public/upload

via

sudo chown www-data:www-data public/css/scss
sudo chown www-data:www-data public/upload

Webserver

If you run Apache, you need also activate mod_rewirte

a2enmod rewrite

Sample nginx configuration

server {
  listen 217.11.57.227:80;
  listen [2a00:1828:2000:148::3]:80;

  server_name .dasmerkendienie.com;

  access_log /var/log/nginx/www.dasmerkendienie.com.access.log;
  error_log /var/log/nginx/www.dasmerkendienie.com.error.log info;

  root /home/dasmerkendienie/www/dasmerkendienie.com;
  index index.php;

  location ^~ /(css|img|js|upload|bootstrap) {
    # enable CORS (http://enable-cors.org/server_nginx.html)
    if ($http_origin ~ (https?://.*\.dasmerkendienie\.com(:[0-9]+)?)) {
      add_header "Access-Control-Allow-Origin" $http_origin;
    }
    root /home/dasmerkendienie/www/dasmerkendienie.com;
    expires 1d;
  }
  location /public/upload {
    deny all;
  }
  location /app/config {
    deny all;
  }
  location / {

    try_files $uri /index.php?$args;

    location ~ .php$ {
      try_files $uri $uri/ =404;
      fastcgi_index index.php;
      fastcgi_read_timeout 1800s;
      fastcgi_send_timeout 1800s;
      fastcgi_pass phpcgi;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    }

    # deny access to apache .htaccess files
    location ~ /\. {
      deny all;
    }
  }
}

Notification Server (experimental)

You can start the websocket server by following command:

php app/server/runnotificationServer.php

Also you need to change following configuration parameter in main.cfg:

notification_server="ws://127.0.0.1:9000/notification";

Optional toolchain for development

npm install
bower install
gulp

socialnetwork's People

Contributors

andreas83 avatar besn avatar chilimatic avatar

Stargazers

 avatar

Watchers

 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.