8000 GitHub - fr0wiNN/Link-Drop: Files sharing service for Computer Security project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fr0wiNN/Link-Drop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link-Drop

Project

Authors

Joachim Lewandowski (i6351332)
Maksymilian Gach (i6361755)

Project Structure

The project structure goes as follows:

.
├── backend
│   ├── config # contains configuration for DB connection.
│   ├── models # adapter for JS -> DB communication.
│   ├── routes # define routes for API calls together with correct error indication.
│   ├── server.js # connects everything together and starts a backend services.
│   ├── services # contains abstract functions with its logic. It uses less abstract modules for lower-level operations - it manages them. 
│   │
│   └── storage # contains all the files sent by users. 
│       └── user_data
│           ├── admin
│           │   └── file_1.txt
│           ├── Alice
│           │   └── hello.txt
│           └── Bob
├── database
│   ├── init.sql # init script for correct DB configuration
│   └── reset.sql # reset script for reseting the database
└── frontend
    ├── assets
    │   ├── img # contains images that are displayed by HTML. 
    │   ├── scripts # contains scripts, that define frontend logic and backend direct API calls. 
    │   └── styles # CSS styling sheets
    └── pages # contains all HTML pages. login.html is an entry point.

Service Configuration

Dependencies

Project uses nodejs for backend API

Make sure, you have node and npm installed. To see if you have those installed, by running node -v and npm -v.

To download neccesery dependencies, run following commands inside backend directory:

npm install cors 
npm install express
npm install multer
npm install mysql2

Database

Link Drop uses MySQL for storing user and file data.

To configure one follow these steps:

  1. Create a MySQL database using initialization script.
  2. Create a db.js file inside config folder and paste following code, replacing indicated spots:
    const mysql = require("mysql2")

    const pool = mysql.createPool({
        host: "localhost",
        user: "...",
        password: "...",
        database: "link_drop",
        connectionLimit: 10,

        stringifyObjects: true,
        multipleStatements: true,
    });

    const promisePool = pool.promise();
    module.exports = promisePool;

Starting Server

Start node.js backend server:

node /backend/server.js

If you host the website on local machine, then replace each instance of pi0040 in html pages scripts to localhost

About

Files sharing service for Computer Security project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0