From eef905e84fc020e21d3409374fefd5d9c6345fa6 Mon Sep 17 00:00:00 2001
From: aradjafari <arad.jafari@gmail.com>
Date: Thu, 28 Oct 2021 18:28:45 +0200
Subject: [PATCH] Readme file updated by urls. CI pipeline removed from the
 project since we have used apache server

---
 .gitlab-ci.yml      | 61 ---------------------------------------------
 README.md           |  6 +++--
 server/package.json |  2 +-
 3 files changed, 5 insertions(+), 64 deletions(-)
 delete mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 971e4e5..0000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-image: node:14.17.6
-
-stages:
-  # - test
-  - build
-  - deploy
-
-cache:
-    paths:
-        - client/node_modules
-        - public/node_modules
-        - server/node_modules
-        - /node_modules
-
-# test:
-#   stage: test
-#   script:
-#     - echo "Testing App"
-#     - npm install
-#     - npm test
-#     - echo "Test successfully!"
-
-
-
-build-client-pages:
-  only: 
-    - master
-  stage: build
-  script: 
-    # - echo "Creating credential file"
-    # - echo $DB_HOST > .env
-    # - echo -n $DB_NAME >> .env
-    # - echo -n $DB_PASS >> .env
-    # - echo -n $DB_USER >> .env
-    # - echo "Start building App"
-    - cd client
-    - rm -rf build
-    - npm install
-    - npm run build
-    - rm -rf public
-    - cp build/index.html build/404.html
-    - mkdir ../public
-    - mv -v build/* ../public/
-    - ls
-    - echo "Build successfully!"
-  artifacts:
-    paths:
-      - public
-
-
-pages:
-  only: 
-    - master
-  stage: deploy
-  script:
-    - cd public
-    - ls 
-  artifacts:
-      paths:
-          - public
-
diff --git a/README.md b/README.md
index 9e123d0..34482b0 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,9 @@
 # URLs
 
-## The URL of the deployed app
+## The URL of the Client app
+http://it2810-54.idi.ntnu.no/
 
+*OBS: you need to be connected to NTNU VPN or use NTNU Network
 
 ## Timesheet
 The timesheet is uploaded on Blackboard too.<br>
@@ -34,7 +36,7 @@ The website was made using multiple different components composed together on on
 We tried to design it as simple and intuitively as possible so that any user will be able to use the website.
 
 ## Deployment
-We deployed the app to gitlab using CI pipeline by creating and adding gitlab-ci-yml file to the project. The CI pipeline works in our project, and the deployed website is linked at the top. The client was buildt simply using `npm run build`. However, the server side had to be compiled manually using TypeScript instead of nodemon to build. Then, we moved the project files over to the VM. Finally, we could run the server using the Library 'NoHup' instead of nodemon for the server to complete the pipeline and keep running.
+We deployed the client APP into NTNUs users server by createing an Apache server and pushed the build folder directly to /tmp folder (Using SSH) and then copied to /var/www/html/ folder. For the server, we have used "forever" for running the server. We manualy uploaded server files to ntnuhome folder and then by "tsc src/server.ts" tried to build/convert the .ts files to .js files. Finally "forever start src/server.js" has started the server.
 
 ## Available Scripts
 
diff --git a/server/package.json b/server/package.json
index 97fb51c..4204a5c 100644
--- a/server/package.json
+++ b/server/package.json
@@ -27,7 +27,7 @@
     "web-vitals": "^1.1.2"
   },
   "scripts": {
-    "start": "nohup node src/server.js &",
+    "start": "forever start src/server.js",
     "build": "tsc src/server.ts",
     "test": "react-scripts test",
     "eject": "react-scripts eject"
-- 
GitLab