Skip to content

Fabs97/PlaDat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js CI


1. Project Proposal

1.1 Project Abstract

This project will create a matching service to connect placement students with potential employers. Using a “dating” service metaphor, the site will allow employers to post details of placements available and students to apply for placements. The aim of the project is to create a database-driven mobile-friendly website to encourage employers and students to engage in year-long paid industrial placements as part of an honours degree programme.

1.2 Project Scope

The project comprises three main elements:

  • placement descriptions;
  • student capabilities;
  • matching algorithm.

Users (employers and students) will need to be able register with the site and store details of placements and capabilities. Some persistent storage will be required to retain placement details, student capabilities, and user credentials.

1.3 Project License

The project will be made available with an MIT license.

1.4 Sponsor

Julian M. Bass

Senior Lecturer (Associate Professor) of Software Engineering at the University of Salford, Manchester, UK


2. Project Structure

The project will follow a SCRUM-like agile method, which includes defining a SCRUM Master, a Product Owner and a Development Team. This definition of roles creates an initial distinction in tasks and duties for a successful delivery of the final software.

2.1 Project Team

Name Role University Email
William Nordberg Product Owner Mälardalen University [email protected]
Bassam Zabad Developer Mälardalen University [email protected]
Alice Casali Developer Politecnico di Milano [email protected]
Fabrizio Siciliano SCRUM Master Politecnico di Milano [email protected]
Aida Denisa Opîrlesc Developer Politecnico di Milano [email protected]
Anna Bergamasco Developer Politecnico di Milano [email protected]
Anđela Zorić Developer Mälardalen University [email protected]

2.2 Useful Links


3. Project Stack

3.1 Technologies

3.1.1 Front-end

Flutter

3.1.2 Back-end

NodeJS

3.1.3 Database

PostgreSQL

3.1.4 Communication technology

RESTful API

3.1.5 Deployment and storage

Heroku


4. Project setup

4.1 Frontend

Please make sure to satisfy the following requirements before the frontend setup:

  • Flutter is installed on your machine. If not, you can follow this guide here;
  • Your Flutter environment has to have web development enabled. You can do this by entering the following commands in your command line prompt of choice or follow this step by step guide:
flutter channel beta
flutter upgrade
flutter config --enable-web

Once the requirements have been completed, please go ahead and follow the next steps:

  • Open a command line prompt on your local machine and type cd <path_to_project>/frontend;
  • Run the following command: flutter build web;
  • Whenever you need to debug your application, you can use the following command: flutter run -d chrome (make sure to have Chrome installed).

4.2 Backend

Please make sure to satisfy the following requirements before the backend setup:

  • Install Node.js and npm from this link here;

Once the requirements have been completed, please go ahead and follow the next steps:

  • Open a command line prompt on your local machine and type the following commands:
cd <path_to_project>/backend
npm i
npm start
  • You should be able to check your backend by opening your browser of choice and navigating to the URL that is prompted after the npm start

4.3 Database

Please make sure to satisfy the following requirements before the backend setup:

  • Install PostgreSQL from this link here;
    • NB: Take careful note of the password that you're going to give to postgres in the wizard while installing!
  • Install PGAdming4 from this link here;
  • Make sure to have installed the knex package globally by running the following command in your prompt of choice:
npm i -g knex

Once the requirements have been completed, please go ahead and follow the next steps:

  1. Create a new database:
    1. Fire up PGAdming 4, login and create a new database by right click on the database in your server, Create > Database; Create a new database
    2. Insert the database name (of your choice) and keep that in mind; Create a new database
    3. Save the new database;
  2. Configure Node.js
    1. Open the backend folder of this project and create a new file called .env;
    2. Fill in the document with the following information by replacing the information with your own, keep the values in the double quotes:
DEV_DB_HOST="localhost"
DEV_DB_NAME="name_of_your_database"
DEV_DB_USR="your_username"
DEV_DB_PORT="port_of_your_database"
DEV_DB_PWD="your_password"
PLADAT_ENV="development" #do not change this
GPLACES_APIKEY="your_gplaces_api_key" #ask to our devs or create on of your own at https://developers.google.com/places/web-service/overview
ACCESS_TOKEN_SECRET="your_secret"
ACCESS_TOKEN_LIFE="your_token_life_in_seconds" #e.g. 2592000 = 30 days

  1. Check that everything is correct by doing the first migration:
cd <project_folder>/backend
knex migrate:latest 

4.4 Testing

Make sure to have previously run the following commands:

cd <project_folder>/backend
npm i

Once the requirements have been completed, please go ahead and run npm test. All tests will be automatically run and you will be able to see the results on your prompt.

The backend comes together with a coverage checking function that can be easily run with npm run coverage. The results of it can be found inside the ./backend/.nyc_output folder.

4.5 Important DEV notes:

  • When testing the application from the dev branch, remember to run the frontend with the following command:
flutter run -d chrome --dart-define=API_ENDPOINT=https://pladat-staging.herokuapp.com/
  • If you're using VSCode and you wish to debug with just the push of a button, you can use the following in your launch.json file:
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Local frontend",
      "cwd": "${workspaceFolder}/frontend",
      "request": "launch",
      "type": "dart",
      "args": ["--web-hostname=127.0.0.1", "--web-port=8200"]
    },
    {      
      "name": "Local backend",
      "request": "launch",
      "cwd": "${workspaceFolder}/backend",
      "runtimeArgs": [
        "run-script",
        "serve",
      ],
      "runtimeExecutable": "npm",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "type": "pwa-node"
    },
    {
      "name": "PlaDat frontend staging",
      "cwd": "${workspaceFolder}/frontend",
      "request": "launch",
      "type": "dart",
      "args": [
        "--web-hostname=127.0.0.1",
        "--web-port=8200",
        "--dart-define=API_ENDPOINT=http:https://pladat-staging.herokuapp.com"
      ]
    },
    {
      "name": "PlaDat frontend production",
      "cwd": "${workspaceFolder}/frontend",
      "request": "launch",
      "type": "dart",
      "args": [
        "--web-hostname=127.0.0.1",
        "--web-port=8200",
        "--dart-define=API_ENDPOINT=https://pladat.herokuapp.com"
      ]
    }
  ],
  "compounds": [
    {
      "name": "Pladat development",
      "configurations": ["Local frontend", "Local backend"]
    }
  ]
}

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages