Giter Club home page Giter Club logo

scaffold's Introduction

What is scaffold

Manual (PDF, Simplified Chinese)

scaffold is a cross-platform toy web framework. I develop it for finishing my C++ course.

Inspired by Express, scaffold is a minimal and flexible C++ web application framework that provides a set of features for web and mobile applications, and provides a thin layer of fundamental web application features.

Environment

To build this project, cmake, make and a proper C++ compiler is required. The compiler should at least support C++11 standard.

I use macOS 10.12.5 for developing and Fedora 25 for testing. With the help of cesanta/mongoose, scaffold can run on various operating systems and hardware architectures.

Dependencies

To solve these dependencies:

  • Mongoose: do nothing.
  • RapidJSON: use package manager, or get the source from GitHub.
  • OpenSSL: use package manager, usually.
  • Boost C++ Libraries: use package manager, or download from the website.
  • MySQL Connector/C++: please build from source! packages downloaded from official website may crash your program!

How to use

Firstly, we need to build the scaffold library.

  1. Clone the repository.

    git clone https://github.com/Bokjan/scaffold
  2. Create a directory for building.

    cd scaffold
    mkdir build && cd build

    All the following commands run under /path/to/scaffold/build.

  3. Run CMake to configure the project.

    cmake .. -DCMAKE_BUILD_TYPE=RELEASE

    If you don't need HTTPS support, add a definition when configuring.

    cmake .. -DDISABLE_SSL=1

    Note that OpenSSL is required (by Mongoose).

    You can set environment variables. For example, you specify clang++ as the C++ compiler by setting the CXX environment variable as following:

    CXX=clang++ cmake ..

    You can specify the root directory where program files will install by defining CMAKE_INSTALL_PREFIX (default: /usr/local). If you would like to install scaffold in /home/bokjan/install, run:

    cmake .. -DCMAKE_INSTALL_PREFIX=/home/bokjan/install
  4. Build and install.

    make && make install

    Add VERBOSE=1 to display the programs invoked by make: VERBOSE=1 make.

After running make install, library (both static and dynamic) and headers are installed. You can build web applications with scaffold now. Make sure the environment variables are configured properly.

Following are some demonstrations of specifying the path:

  • Using command line (dynamic linking)
    g++ -o app app.cpp -I/path/to/headers -L/path/to/libraries -lscaffold
  • Using CMake (static linking)
    INCLUDE_DIRECTORIES(/path/to/headers)
    FIND_LIBRARY(LIBSCAFFOLD_STATIC libscaffold.a /path/to/libraries)
    TARGET_LINK_LIBRARIES(${LIBSCAFFOLD_STATIC})
  • Using SCons (dynamic linking)
    Env = Environment()
    Env.Append(LIBS = ['scaffold'])
    Env.Append(CPPPATH = ['/path/to/headers'])
    Env.Append(LIBPATH = ['/path/to/libraries'])

Miscellaneous

  • License: GNU General Public License v2.0

scaffold's People

Contributors

bokjan avatar

Stargazers

新城旧梦 avatar

Watchers

 avatar Tom Shuai avatar

Forkers

itxcjm

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.