GithubHelp home page GithubHelp logo

typcn / leanclub Goto Github PK

View Code? Open in Web Editor NEW
215.0 12.0 38.0 577 KB

C++ forum system

Home Page: https://leanclub.org/

License: Other

CMake 0.41% Shell 0.09% C++ 55.19% C 34.55% Objective-C 0.03% Lua 0.38% Makefile 0.49% HTML 3.81% CSS 5.06%

leanclub's Introduction

LeanClub

Build Status

High performance C++ forum system

WARNING: Not recommended for production

DEMO: https://leanclub.org/

Features

  1. Extremely Fast , 20000 RPS on i7 iMac.
  2. Simple and clean frontend.
  3. Full ajax and API.
  4. Google GitHub Twitter OAuth sign in.

Minimum Requirements

  • GCC 4.8
  • CMake 2.8

(Windows is not supported)

Setup

Datebase

  1. Install Apache Couchdb
  2. Create 4 databases named “category” “notification” “topics” and “user”.
  3. Import design docs from “databases” directory.

Environment

  1. apt-get install build-essential cmake libcurl4-nss-dev libboost-all-dev redis-server libhiredis-dev libtcmalloc-minimal4 && sudo ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc_minimal.so
  2. Install hiredis from sources ( redis3m is already included )

Config

cp src/config.h.example.h src/config.h
vi src/config.h

Build and run

mkdir Build
cd Build
cmake ..
make
./leanclub

Nginx

server {
    listen 80;
    server_name leanclub.org;
    client_max_body_size MAX_UPLOAD_SIZE;
    root /path/to/leanclub/;

    location / {
        proxy_pass http://127.0.0.1:18080;
        proxy_redirect off;
        proxy_set_header X-Forwarded-For $http_x_forwarded_for;
        proxy_set_header Host leanclub.org;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Frame-Options DENY;
    }
    	
    # Cache the avatar (Optional) 
    # location /info/ {
    #    proxy_pass http://127.0.0.1:18080;
    #    proxy_redirect off;
    #    proxy_set_header X-Forwarded-For $http_x_forwarded_for;
    #    proxy_set_header Host leanclub.org;
    #    proxy_cache one;
    #    proxy_cache_key "$request_uri";
    #    proxy_cache_valid  200 302  120m;
    # }

    location /static/ {
        expires 10d;
    }
    location /attachments/ {
        expires 365d;
    }
}   

reverse proxy 127.0.0.1:18080 , and map the "static" and "attachments" folder.

About

This program based on: Crow

I’m newbie for c++ , the code may “buggy" , not recommended for production.

License

MIT

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.