Giter Site home page Giter Site logo

schmave / overseer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from steveshogren/overseer

0.0 2.0 0.0 35.31 MB

An attendance tracking system

License: GNU General Public License v3.0

JavaScript 34.32% Makefile 0.97% Shell 0.22% Clojure 37.38% HTML 2.74% SQLPL 9.19% PLpgSQL 2.87% CSS 2.56% PLSQL 0.06% TSQL 9.70%

overseer's Introduction

Overseer

Overseer is a clojure web application which runs on the Jetty server. The site uses postgres for persistence.

Lein

You will need to get lein 2 installed and running.

To ensure you have the correct version, run: lein --version and verify that it is greater than 2.0.

Postgres

You will need a running postgres database on your system. Once that is complete, create a new database for overseer to use to run.

Profiles.clj

To run the site locally, you need to configure lein to pass the correct database connection settings to your running web site. To make this easier, lein allows for a file to be put in the same folder as the project.clj with machine-specific settings.

Make a file called profiles.clj in the base project directory. NEVER ADD IT TO GIT. Add in the following:

{
  :dev {:repl-options {:init-ns overseer.web}
        :migratus {:store :database
                  :migration-dir "migrations"
                  :db {:classname "org.postgresql.Driver",
                       :subprotocol "postgresql",
                       :user "USER",
                       :password "PASSWORD",
                       :subname "//localhost:5432/DATABASE"}}
        :dependencies [[clj-webdriver "0.7.2"]
                       [org.apache.httpcomponents/httpclient "4.3.5"]
                       [org.seleniumhq.selenium/selenium-java "2.48.1"]]
        :plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]
                  [venantius/ultra "0.5.4"]]
        :env {:database-url "postgres://USER:PASSWORD@localhost:5432/DATABASE"
             :adminpass "web"
             :userpass "web"
             :host "0.0.0.0"
             :port "5000"
             :dev "true"
             :migratedb "true"
             :notify "false"
           }
        :jvm-opts ["-Duser.timezone=GMT"]
  }
}

Replace the following words in your profiles.clj:

  • DATABASE - your desired local database name
  • USER - your local postgres username
  • PASSWORD - your local postgres username's password

Keep in mind that the assumed port number (5432) in the two connection strings is the postgres default. If your postgres uses a different port, you will need to change that too.

When starting with a new database, or when you want to "reset" your current database, set the key :newdb to true before you start the application. That will cause the database to be recreated empty, then some sample data be put inside it. CAUTION: leaving it set to true will cause it to drop EVERY TIME. You might want it true for the first time, then immediately set it to false after the application starts.

If you want to apply a new migration to an existing database, set the key :migratedb to true.

The application also sets up five default users for local testing. They are "admin", "super", "admin2", "user", and "demo". They all have the password "web". Typically, you will use "super" for local testing.

NPM

You will need to install Node.js and npm.

Running Locally

$ git clone https://github.com/steveshogren/overseer.git
$ cd overseer
$ npm install

To build the frontend and serve it while listening for changes, run make watch

To run the backend, run make start.

If both the frontend and backend are running, the app will be available at localhost:5000.

Logging

Exception and debugging logging can be added to the system via the log4j.properties in the src/ directory.

An example that logs all INFO messages to a file but only WARN to the console would look like this:

log4j.rootLogger=INFO, A1, CA

log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.CA.Threshold = WARN

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=log/app.log
log4j.appender.A1.MaxFileSize=500MB
log4j.appender.A1.MaxBackupIndex=2
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p%c - %m%n

License: GPL-3.0+

overseer's People

Contributors

schmave avatar steveshogren avatar technomancy avatar thedreadpirate avatar

Watchers

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