GithubHelp home page GithubHelp logo

rngadam / pgexercises Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alisdairo/pgexercises

0.0 1.0 0.0 4.17 MB

PostgreSQL Exercises web site code

License: Other

Shell 0.05% JavaScript 43.04% Perl 2.60% Java 5.68% Elixir 12.40% CSS 2.11% HTML 33.87% Dockerfile 0.25%

pgexercises's Introduction

PostgreSQL Exercises

This is the code for the SQL tutorial site PostgreSQL Exercises. It's made using a simple static site generator and some template html files.

Directories/Files under this project root:

  • database - contains sample database configuration files, SQL file to create+populate pgexercises database.
  • nginx - contains sample nginx configurations files.
  • questions - contains the files that define the exercises. These are used to generate static html files based on the templates under site/website.
  • scripts - various scripts to do stuff like generate the html files, upload them to the site, and so on.
  • site - web site files and html templates.
  • SQLForwarder - simple web application to send queries to and from the DB.
  • dbdata.xlsx - just an excel file containing all the db data.

Instructions to get a dev environment working:

Install nginx, apache tomcat 7, PostgreSQL, ant, perl.

Set a password

Modify database/clubdata.sql and database/context.xml to set a password of your choosing

Set up your database

su - postgres
cd $PGEXERCISES_HOME/database
psql -f clubdata.sql

Set up nginx

  • Copy nginx/nginx-dev.conf and nginx/mime.type to your nginx config directory (e.g. /etc/nginx/).
  • Rename nginx-dev.conf to nginx.conf, and change the root location and SQLForwarder blocks to match your setup.

Configure SQL Forwarder servlet

  • Modify the SQLForwarder/build.properties file to tell the build where to get the apache tomcat libraries
  • Run 'ant war' on the SQLForwarder project to get a WAR file in SQLForwarder/build/war
  • Copy war to $TOMCAT_HOME/webapps
  • Copy the database/context.xml file to $TOMCAT_HOME/conf, and modify it appropriately to point at the server/port Postgres uses (default is 5432), use the user name and password you've set up, and so on.
  • Copy the SQLForwarder/WebContent/WEB-INF/lib/postgresql-9.3-1100.jdbc4.jar file to $TOMCAT_HOME/lib

Run the pgexercises build

The following should build your html files in site/website/questions:

cd $PGEXERCISES_HOME/scripts
./processdocs.pl ../ 1

Start everything up

Start postgres, tomcat, and nginx if not already started. Hopefully you should be able to see a web page at your nginx port (default localhost:80)!

pgexercises's People

Contributors

alisdairo avatar zachvalenta avatar dimidd avatar a-robinson avatar candrews800 avatar feikesteenbergen avatar morenoh149 avatar i-akhmadullin avatar mritterhoff avatar qwo avatar talam avatar

Watchers

Novem 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.