Giter Club home page Giter Club logo

proofbox_client's Introduction

Skeleton

Skeleton is a template of website using API REST with a postgresql DB and writter in OCaml.

Setup

You need to have postgresql installed (>= 9.5). You need to have a working setup of opam/ocaml (>=4.08.1): Manual, with sandbox mode disabled (article) for postgresql to be working. In postgresql you should have a user with the same name as your computer user, with some specific rights:

sudo -i -u postgres
psql
CREATE USER <user>;
ALTER ROLE <user> CREATEDB;
ALTER ROLE <user> SET search_path TO db, public;

Building Dependencies

make init

Project Configuration

You can set up your project configuration (name, web server ports, ect..) by creating a file Makefile.config with these optional fields:

PROJECT_NAME=skeleton              # name of your project
DATABASE:=skeleton                 # name of your database
WEB_HOST:=http://localhost:8888    # external address of your WEB server
API_HOST:=http://localhost:8080    # external address of your API server
API_PORT:=8080                     # internal port of your API server
RLS_DIR:=www                       # release folder (/var/www/...)
CONTACT_EMAIL:=                    # email address displayed on API doc
VERSION:=1.0                       # API version displayed on API doc

After this configuration, you can build some JSON files used by the servers by doing:

make config

Building

make

If you need to release your files on the /var/www/... folder, you can also run:

make release

Launching

To launch the API server:

./bin/api-server config/api_conf.json

There are also some useful bash script or service to run the API server in the scripts folder

To test the web server on your localhost, you can use:

cd www
php -S localhost:8888     # if you didn't change the WEB_HOST variable

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.