Coder Social home page Coder Social logo

workplace's Introduction

Workplace

Time sheet application for organizations.

Workplace demonstration

Created with Loopback, Angular and Angular Material

UI for this project is compiled from repository: Workplace UI

Installation

Method 1 (With docker and docker-compose)

  • Clone the repository.
  • Modify configuration files in the repository directory as needed.
  • Open terminal in the repository directory and run command docker-compose up -d mysql adminer.
  • Navigate to http://localhost:8085/?server=mysql&username=root in your browser.
  • Login by providing password as password.
  • Create a database named workplace.
  • Head back to terminal and run command docker-compose up.

Method 2 (Run directly on your workstation)

  • Install NodeJs(version >=8).
  • Install and start mysql(version >= 5.7.21) server.
  • Create a database table workplace
  • Clone this repository.
  • Modify configuration files in the repository directory as needed(modify db host address, smtp configuration etc).
  • Install dependencies by running command npm install --production.
  • Run the application with command npm run start-production.

After installation application can be accessed with url: http://localhost:3000.

When you start the application for the first time a default admin user is created with email: [email protected] and password password. Default admin user email can be set in the configuration files and password is read from the environment variable WORKPLACE_ADMIN_PASSWORD.

Note: Admin user is only created once when you start the application for the first time, once you have an admin user created, changing admin email in te configuration files will not have any effect.

Admin users will have admin functionality enabled in the app.

Configuration

  • Application general configuration files can be found in config directory.
  • Database and email connectivity configuration file is in path server/datasources.json

Conventions

  • When a time sheet is created an associated task is created for the time sheet.
  • Open tasks can be linked to new time sheets by using the link button from the top right corner of time sheet entry popup.
  • When a time sheet is marked as completed the associated task will be marked as closed.

To do

  • Employee clock in/out.

workplace's People

Contributors

harishanchu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workplace's Issues

unable to start the application

Hello,
i have been trying to set up the application for testing. but i cannot seem to be abl to even start the application. all y configuration are correct but it still wont start. am etting this error.

[email protected] start-production /home/admin/workplace
NODE_ENV=development node .

Connection fails: Error: getaddrinfo ENOTFOUND mysql mysql:3306
It will be retried for the next request.
events.js:183
throw er; // Unhandled 'error' event
^

Error: getaddrinfo ENOTFOUND mysql mysql:3306
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
--------------------
at Protocol._enqueue (/home/admin/workplace/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/home/admin/workplace/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at PoolConnection.connect (/home/admin/workplace/node_modules/mysql/lib/Connection.js:118:18)
at Pool.getConnection (/home/admin/workplace/node_modules/mysql/lib/Pool.js:48:16)
at MySQL.connect (/home/admin/workplace/node_modules/loopback-connector-mysql/lib/mysql.js:90:17)
at Object.initializeDataSource [as initialize] (/home/admin/workplace/node_modules/loopback-connector-mysql/lib/mysql.js:44:28)
at DataSource.setup (/home/admin/workplace/node_modules/loopback-datasource-juggler/lib/datasource.js:493:19)
at new DataSource (/home/admin/workplace/node_modules/loopback-datasource-juggler/lib/datasource.js:138:8)
at Registry.createDataSource (/home/admin/workplace/node_modules/loopback/lib/registry.js:364:12)
at dataSourcesFromConfig (/home/admin/workplace/node_modules/loopback/lib/application.js:570:19)
at Function.app.dataSource (/home/admin/workplace/node_modules/loopback/lib/application.js:269:14)
at /home/admin/workplace/node_modules/loopback-boot/lib/executor.js:191:9
at /home/admin/workplace/node_modules/loopback-boot/lib/executor.js:282:5
at Array.forEach ()
at forEachKeyedObject (/home/admin/workplace/node_modules/loopback-boot/lib/executor.js:281:20)
at setupDataSources (/home/admin/workplace/node_modules/loopback-boot/lib/executor.js:181:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start-production: NODE_ENV=development node .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start-production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/admin/.npm/_logs/2019-03-25T07_10_46_940Z-debug.log

And in the /home/admin/.npm/_logs/2019-03-25T07_10_46_940Z-debug.log it give me this:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'start-production' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart-production',
4 verbose run-script 'start-production',
4 verbose run-script 'poststart-production' ]
5 info lifecycle [email protected]prestart-production: [email protected]
6 info lifecycle [email protected]
start-production: [email protected]
7 verbose lifecycle [email protected]start-production: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start-production: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/admin/workplace/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
9 verbose lifecycle [email protected]start-production: CWD: /home/admin/workplace
10 silly lifecycle [email protected]
start-production: Args: [ '-c', 'NODE_ENV=development node .' ]
11 silly lifecycle [email protected]start-production: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start-production: Failed to exec start-production script
13 verbose stack Error: [email protected] start-production: NODE_ENV=development node .
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/admin/workplace
16 verbose Linux 4.15.0-46-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start-production"
18 verbose node v8.11.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start-production: NODE_ENV=development node .
22 error Exit status 1
23 error Failed at the [email protected] start-production script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

workplace_workplace_1 exited with code 127

Method 1 (With docker and docker-compose)

  • this appear when run docker-compose up
    MY docker-compose.yaml
version: "2"
networks:
  mysql:
    driver: bridge
services:

  mysql:
    image: mysql:5.7.21
    networks:
      - mysql
    volumes:
      - ${PWD}/data/mysql:/var/lib/mysql
    ports:
      - "3307:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=12345
      - MYSQL_DATABASE=db
      - MYSQL_USER=user
      - MYSQL_PASSWORD=12345
      - ALLOW_EMPTY_PASSWORD=NO

  adminer:
    image: adminer
    networks:
      - mysql
    ports:
      - "8085:8080"

  workplace:
    build: .
    networks:
      - mysql
    ports:
      - "3000:3000"
    depends_on:
      - mysql


image
image
image

I didn't change anything on datasources.json , How to solve this?

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.