Skip to content

Commit

Permalink
Merge pull request Worklenz#3 from Worklenz/initial-commit
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
chamikaJ committed May 17, 2024
2 parents 67696d6 + 298ca6b commit 25b6d7e
Show file tree
Hide file tree
Showing 3,549 changed files with 193,559 additions and 4 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<img
src="https://worklenz.s3.amazonaws.com/assets/screenshots/hero.png"
alt="Worklenz"
width="1024"
width="1200"
/>
</a>
</p>
Expand Down
11 changes: 8 additions & 3 deletions SETUP_THE_PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,20 @@ Getting started with development is a breeze! Follow these steps and you'll be c
- Create a copy of the `.env.template` file and name it `.env`.
- Update the required fields in `.env` with the specific information.

4. **Install Dependencies:**
4. **Restore Database**
- Create a new database named `worklenz_db` on your local PostgreSQL server.
- Update the `DATABASE_NAME` and `PASSWORD` in the `database/6_user_permission.sql` with your DB credentials.
- Open a query console and execute the queries from the .sql files in the `database` directories, following the provided order.

5. **Install Dependencies:**

```bash
npm install
```

This command installs all the necessary libraries required to run the project.

5. **Run the Development Server:**
6. **Run the Development Server:**

**a. Start the TypeScript compiler:**

Expand All @@ -86,7 +91,7 @@ Getting started with development is a breeze! Follow these steps and you'll be c

This starts the development server allowing you to work on the project.

6. **Run the Production Server:**
7. **Run the Production Server:**

**a. Compile TypeScript to JavaScript:**

Expand Down
5 changes: 5 additions & 0 deletions worklenz-backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
npm-debug.log
build
.scannerwork
coverage
19 changes: 19 additions & 0 deletions worklenz-backend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.pug,]
indent_style = tab
indent_size = 4

[*.sql]
indent_style = space
indent_size = 4
55 changes: 55 additions & 0 deletions worklenz-backend/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Server
NODE_ENV=development
PORT=3000
SESSION_NAME=worklenz.sid
SESSION_SECRET="%7Z3Vn$d2sJdhbwXdZp2GhhDH6f5Z%_43bX#B-@fA=ntXVDsq$b=AuUm_NXZ7hTX?3EKpHwdAsnbUm-Sv!&bcX=xy2pfkwnTfeW$qhVu4_L&N-+s6gUY2V$%E=fDU^a?8ghjav?b!aGPfvAb7yKzSRR#4YsfgrHfMARQBmgF*_AzsHV@2=Jgz?wtERUHLDPh4R6t3VH7UydrgtQG24SaD?q_qFM_PX*_QDYs!8*An=aEpbbMJMVFj5t43_wWM$mM"
COOKIE_SECRET="CeD=C+_2LSSFF_qJ@cCz_$=KQv=ZrxU?DDL9$9%Yrd^yeeZ&h#QCSvX@u9^M!y%fnw^SU$-MQetU!eKLWR@n_pafJSU%*?nvr&qKgnUsj?5+Jnw$rFuPGWej-L&Cznk+rcKZ#8%Wcr$y%KAzCp597Z2Tnt?gkx=xsc%RNjcfkYeA=94JnLJxKur8p*HJ4?Q#5U%@BMhR4n67a-rZJEvnkFgxVcvaLdmEjXFe#26UkJV799MPP5wU7-&fpx4Vfkf="

# CORS
SOCKET_IO_CORS=http://localhost:4200
SERVER_CORS=*

# Database
DB_USER=DATABASE_USER_NAME_HERE
DB_PASSWORD=DATABASE_PASSWORD_HERE
DB_NAME=DATABASE_NAME_HERE
DB_HOST=DATABASE_HOST_HERE # localhost
DB_PORT=DATABASE_PORT_HERE
DB_MAX_CLIENTS=50

# Google Login
GOOGLE_CLIENT_ID="GOOGLE_CLIENT_ID_HERE"
GOOGLE_CLIENT_SECRET="GOOGLE_CLIENT_SECRET_HERE"
GOOGLE_CALLBACK_URL="http://localhost:3000/secure/google/verify"
LOGIN_FAILURE_REDIRECT="/"
LOGIN_SUCCESS_REDIRECT="http://localhost:4200/auth/authenticate"

# CLI
ANGULAR_DIST_DIR="/path/worklenz_frontend/dist/worklenz"
ANGULAR_SRC_DIR="/path/worklenz_frontend"
BACKEND_PUBLIC_DIR="/path/worklenz_backend/src/public"
BACKEND_VIEWS_DIR="/path/worklenz_backend/src/views/admin"
COMMIT_BUILD_IMMEDIATELY=true

# HOST
HOSTNAME=localhost:4200

# SLACK
SLACK_WEBHOOK=SLACK_WEBHOOK_HERE
USE_PG_NATIVE=true

# JWT SECRET
JWT_SECRET=JWT_SECRET_CODE_HERE

# AWS
AWS_REGION="us-west-2"
AWS_ACCESS_KEY_ID="AWS_ACCESS_KEY_ID_HERE" # "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
AWS_SECRET_ACCESS_KEY="AWS_SECRET_ACCESS_KEY_HERE" # "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

# S3 Credentials
REGION="us-west-2"
BUCKET="BUCKET_NAME_HERE"
S3_URL="S3_URL_HERE"
S3_ACCESS_KEY_ID="S3_ACCESS_KEY_ID_HERE"
S3_SECRET_ACCESS_KEY="S3_SECRET_ACCESS_KEY_HERE"

109 changes: 109 additions & 0 deletions worklenz-backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:security/recommended"
],
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"spread": true,
"experimentalObjectRestSpread": true
}
},
"globals": {
"window": true,
"document": true,
"angular": true
},
"rules": {
"constructor-super": 2,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-console": 1,
"no-const-assign": 2,
"no-constant-condition": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-empty": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"no-fallthrough": 2,
"no-func-assign": 2,
"no-global-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-mixed-spaces-and-tabs": 2,
"no-new-symbol": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-self-assign": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-undef": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unsafe-negation": 2,
"no-unused-labels": 2,
"no-unused-vars": 1,
"no-useless-escape": 1,
"require-yield": 2,
"use-isnan": 2,
"valid-typeof": 2,
"no-var": 2,
"no-eval": 2,
"quotes": [
2,
"double",
{
"allowTemplateLiterals": true
}
],
"capitalized-comments": 0,
"no-use-before-define": 2,
"no-else-return": 2,
"no-invalid-this": 2,
"object-shorthand": 2,
"quote-props": 0,
"no-array-constructor": 2,
"no-new-func": 2,
"no-new-object": 2,
"prefer-destructuring": 1,
"prefer-template": 2,
"no-param-reassign": 2,
"prefer-spread": 2,
"arrow-spacing": 2,
"keyword-spacing": 2,
"space-infix-ops": 2,
"space-before-blocks": 2,
"object-curly-spacing": 0,
"semi": 2,
"no-underscore-dangle": 2,
"prefer-arrow-callback": 2,
"prefer-const": 2
},
"env": {
"node": true,
"jest": true,
"es6": true
}
}
65 changes: 65 additions & 0 deletions worklenz-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

.DS_Store
config.json
.idea
build
.vscode
*.code-workspace
3 changes: 3 additions & 0 deletions worklenz-backend/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "worklenz-email-templates"]
path = worklenz-email-templates
url = "URL_HERE"
2 changes: 2 additions & 0 deletions worklenz-backend/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engine-strict=true
fund=false # Don't print the trailing funding message
26 changes: 26 additions & 0 deletions worklenz-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the official Node.js 18 image as a base
FROM node:18

# Create and set the working directory
WORKDIR /usr/src/app

# Install global dependencies
RUN npm install -g ts-node typescript grunt grunt-cli

# Copy package.json and package-lock.json (if available)
COPY package*.json ./

# Install app dependencies
RUN npm ci

# Copy the rest of the application code
COPY . .

# Run the build script to compile TypeScript to JavaScript
RUN npm run build

# Expose the port the app runs on
EXPOSE 3000

# Start the application
CMD ["npm", "start"]
Loading

0 comments on commit 25b6d7e

Please sign in to comment.