GithubHelp home page GithubHelp logo

kristian-94 / logbook Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 6.79 MB

An app to track billing towards different clients in their different buckets of hours

Home Page: https://kristian-94.github.io/logbook

HTML 0.47% JavaScript 30.41% SCSS 0.31% PHP 67.12% Batchfile 0.14% CSS 0.51% Shell 0.29% Dockerfile 0.76%
billing react yii2 javascript php

logbook's Introduction

Client Hours Logbook

Tracks hours billed to clients - different to total hours actually spent on a project.

Demo Site

Check out a demo at https://kristian-94.github.io/logbook

Logbook screenshot

Setup

  1. Install docker CE: https://docs.docker.com/install/linux/docker-ce/ubuntu/

  2. Install docker-compose https://docs.docker.com/compose/install/

  3. Clone this code

    git clone [email protected]:kristian-94/logbook.git
    
  4. Spin up environment

    cd logbook
    docker-compose up
    
  5. Now you should be able to visit the site in your browser at localhost and log in with username = 'admin' and password = 'admin'

Local docker compose containers

  • Ubuntu 1804 apache webserver for the API
  • Ubuntu 1804 node sever for the front end
  • Postgres database

Utility Commands

Use the following command to enter the bash shell of each container. Replaces using the docker exec function. Enter web container (react, frontend app):

./control web

Enter postgres database shell:

./control db

Enter yii PHP backend container (eg. to run yii commands from command line):

./control api

Development vs production build

Prod & dev share the same db container service as the database.

Development

Development uses the client and api containers specified in the docker-compose.yml file. We separate the backend and frontend into separate containers and mount the front end react directory ./client:/siteroot inside the client, so that we can take advantage of hot reloading. We don't use npm run build.

Production Build

In production, we need the back and front end served from the same origin. This is achieved with a reverse proxy, some special nginx config to serve the backend at localhost/api, and the front end at localhost. This config is found in docker/build/nginx-site.conf.

We need to also create the build folder expected in the nginx config at root /var/www/site/client/build;. To create that we manually exec into the build container and run npm run build to build a prod react app.

The reason we wouldn't do development using this build container is because we have no hot reloading.

logbook's People

Contributors

dependabot[bot] avatar guillogo avatar kenneth-hendricks avatar kristian-94 avatar

Stargazers

 avatar

Watchers

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