Skip to content

Commit

Permalink
Merge pull request #6 from Worklenz/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
chamikaJ authored May 17, 2024
2 parents 67696d6 + 3040923 commit 6f9eeb1
Show file tree
Hide file tree
Showing 3,534 changed files with 193,240 additions and 4 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
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
12 changes: 9 additions & 3 deletions SETUP_THE_PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Getting started with development is a breeze! Follow these steps and you'll be c
3. **Run the frontend:**
```bash
npm start
```

4. Navigate to [http://localhost:4200](http://localhost:4200)

Expand All @@ -56,15 +57,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 +92,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
57 changes: 57 additions & 0 deletions worklenz-backend/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Server
NODE_ENV=development
PORT=3000
SESSION_NAME=worklenz.sid
SESSION_SECRET="YOUR_SESSION_SECRET_HERE"
COOKIE_SECRET="YOUR_COOKIE_SECRET_HERE"

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

# Database
DB_USER=DATABASE_USER_HERE # default : worklenz_backend (update "user-permission.sql" if needed)
DB_PASSWORD=DATABASE_PASSWORD_HERE
DB_NAME=DATABASE_NAME_HERE # default : worklenz_db
DB_HOST=DATABASE_HOST_HERE # default : localhost
DB_PORT=DATABASE_PORT_HERE # default : 5432
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"
AWS_SECRET_ACCESS_KEY="AWS_SECRET_ACCESS_KEY_HERE"

# 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"

# SES email
SOURCE_EMAIL="SOURCE_EMAIL_HERE" #Worklenz <noreply@worklenz.com>
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 6f9eeb1

Please sign in to comment.