Giter VIP home page Giter VIP logo

cms's Introduction

CCA Management System (CMS)

CMS Demo Video

CMS is a Task Management System coupled with Form Maker to automate and ease Data Management and Communication between CCA Users and Society Users. This product is tailor made for the Co-Curricular Activities Department at Lahore University of Management Sciences (LUMS).

Table Of Contents:

Installation

Note: This installation guide is for Ubuntu 18.04

Prerequisites

List

  1. Install Node JS
  2. Install MongoDB
  3. Install PM2
  4. Set Up NGINX - Remote Server Only

Set Up NGINX - Remote Server

Step 1 - Installing NGINX

Run the following commands in terminal:

sudo apt update
sudo apt install nginx
Step 2 - Adjusting Firewall

Run the following command to get a list of application profiles:

sudo ufw app list

You should see the following output:

Available applications:
  Nginx Full
  Nginx HTTP
  Nginx HTTPS
  OpenSSH

Note: For this guide, we will be using the HTTP profile

Now run the following command to apply application profile:

sudo ufw allow 'Nginx HTTP'

You can very the change by typing:

sudo ufw status

This would give the following output:

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                  
Nginx HTTP                 ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)             
Nginx HTTP (v6)            ALLOW       Anywhere (v6)
Step 3 - Set Up Server Block

Get public IP address by running the following command:

curl -4 icanhazip.com

This would give you your global IP address.

Now run the following commands from any directory:

sudo mkdir -p /var/www/<your_ip_address_here>/html
sudo chown -R $USER:$USER /var/www/<your_ip_address_here>/html
sudo chmod -R 755 /var/www/<your_ip_address_here>/html

Then by running the following command the configuration block will be edited:

sudo nano /etc/nginx/sites-available/<your_ip_address_here>

Copy paste the follwoing text in the editor and save the file:

server {
        listen 80;
        listen [::]:80;

        root /var/www/<your_ip_address_here>/html;
        index index.html index.htm index.nginx-debian.html;

        server_name <your_ip_address_here>;

        location /api {
                proxy_pass http://localhost:3030;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }
        
        location /dev {
                proxy_pass http://localhost:3231;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }
        
        location / {
                try_files $uri $uri/ =404;
        }
}

Now create a link between the file and the directory sites-enabled:

sudo ln -s /etc/nginx/sites-available/<your_ip_address_here> /etc/nginx/sites-enabled

Make a minor change in Nginx's configuraiton file:

sudo nano /etc/nginx/nginx.conf

Find the following line:

#server_names_hash_bucket_size 64;

Uncomment the line by removing # in the start. Now save and close the file.

Check that there are no syntax errors in any Nginx file:

sudo nginx -t

If there aren't any problems, then restart Nginx by the following command:

sudo systemctl restart nginx

Set Up CMS Using Deployer - Remote Server (For GitHub Contributors Only)

Step 1 - Create SSH Key & Add To GitHub

Run the following command in any directory:

ssh-keygen

Enter the following when prompted Enter file in which to save the key:

~/.ssh/id_cms_test

Now run the following command and copy the output:

cat ~/.ssh/id_cms_test

Go to GitHub SSH and GPG Keys Setting and press New SSH key. Paste there and press Add SSH key to save.

Step 2 - Set Up Deployer

Clone the repoistory and change deployer's directory by running the following commands in any directory:

mkdir ~/GitHub
git clone https://github.com/drageelr/cms.git
cp -r ~/GitHub/cms/deployer~/deployer

To configure deployer for your server edit 2 files,dp-script-1 and dp-script-2 , using nano text editor:

nano ~/deployer/resources/<file_name_here>

Replace the ip address 167.71.224.73 in both files with your ip address and save the file.

Now start the deployer by executing the following commands:

cd ~/deployer
npm install
pm2 start bin/www.js --name "cms-deployer"

To verify that the deployer is running, run command:

pm2 status

Step 3 - Deploy CMS

  • Go to http://<your_ip_address_here>/dev/site
  • Select Branch to deploy from and Database to run on.
  • Press Start Server to deploy.
  • Press Refresh to check status of server.

Set Up CMS Manually - Remote Server

Step 1 - Place Repository On Server

  • Place this repository on the server in the directory ~/GitHub

Step 2 - Run Commands To Deploy

  • Run the commands (from root directory of the system) in the text file deployer/resources/dp-script-1 from line 2 - 8
  • Run the commands (from root of this repository) in the text file deployer/resources/dp-script-2 from line 1 - 10
  • Run the command (from server folder) pm2 start bin/www.js --name "cms-server"

Note: Make sure to replace the IP address 167.71.224.73 with your IP address


Set Up CMS Using Deployer - Remote Server (For GitHub Contributors Only)

Step 1 - Create SSH Key & Add To GitHub

Run the following command in any directory:

ssh-keygen

Enter the following when prompted Enter file in which to save the key:

~/.ssh/id_cms_test

Now run the following command and copy the output:

cat ~/.ssh/id_cms_test

Go to GitHub SSH and GPG Keys Setting and press New SSH key. Paste there and press Add SSH key to save.

Step 2 - Set Up Deployer

Clone the repoistory and change deployer's directory by running the following commands in any directory:

mkdir ~/GitHub
git clone https://github.com/drageelr/cms.git
cp -r ~/GitHub/cms/deployer~/deployer

To configure deployer for your server edit 2 files,dp-script-1 and dp-script-2 , using nano text editor:

nano ~/deployer/resources/<file_name_here>

Replace the ip address 167.71.224.73 in both files with your ip address and save the file.

Now start the deployer by executing the following commands:

cd ~/deployer
npm install
pm2 start bin/www.js --name "cms-deployer"

To verify that the deployer is running, run command:

pm2 status

Step 3 - Deploy CMS

  • Go to http://<your_ip_address_here>/dev/site
  • Select Branch to deploy from and Database to run on.
  • Press Start Server to deploy.
  • Press Refresh to check status of server.

Local Server and Client App (Demo and Testing)

  • Clone the repository to your local directory.
git clone https://github.com/drageelr/cms.git
cd cms
  • Install client-side dependencies and start React App
cd client
npm install
npm start
  • Install server-side dependencies and start the server from another terminal / command-line
cd server
npm install
npm start

Other Documents


cms's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

farrukhras

cms's Issues

Setup Server Boilerplate From Scratch

Breakdown the server into the following components:

  1. Routes
  2. Controllers
  3. Models
  4. Services
  5. Errors

Re-write code in app.js and www files

Setup coding format

Request List CCA Filters for Fetch List

  • Status filter using chip bar (with all the CCA statuses, creating a list like ["CCA pending", "Approved"] which is sent to the back-end)

  • Dropdown for time filter with options "1 month, 3 months, 1 year, Specific duration" (also conditionally opens the date pickers for to and from when you select 'Specific duration' option).

  • "Show Completed Requests Only" switch false by default.

Warning Fixes Front-End

Fix all warning errors and unused imports to prevent excess renders, performance slowdown and unpredictable bugs.

UI Improvements 1.0

  • CCA Settings Boxes with dropshadows
  • Globally style all buttons (borderRadius, color using app theme)
  • Generalize styles as much as possible
  • Improve Navbar and logo (try inversion of primary/secondary colors)
  • UI elements for spacey white backgrounds where required, e.g. task manager
  • Gradients unify, randomly generate colors
  • Tooltips
  • Progress bar calculation based on current status
  • Blinking re-renders to be prevented
  • Picture test

Login Page and Other Minor Bugs

  • keyboard support (button type=submit so pressing enter logs in)
  • convert cca picture to base64 string instead of URL
  • required fix login errors initially (remove onBlurValidation change props)

API Specification Document

  • Create API specification document in an MD file.
  • API Specification Document Template
  • All Categories have already been made. Refer to the DB diagram, Component Diagram, Activity Diagrams, Sequence Diagrams and Wireframes in SDS document for further clarification.
  • Remove notes which are attached with the categories. Don't remove the "Important Notes" section.
  • Once done, respond to this issue for a review. If approved the file will be committed in the "docs" folder. Don't commit the file before review

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.