/library-nav

2021 Gachon univeristy algorithm class term project

Primary LanguageJavaScript

library-nav

2021 Gachon university algorithm class term project
This is a service for the experimental implementation of the Edit Distance Algorithm and the Dijkstra Algorithm.

Page for testing : https://libnav.chromato99.com

Description

This is a web service to shorten the search time to locate a book when using the Gachon University library.

Provides a function with 'Dijkstra' algorithm to inform you of the shortest path from the current location to the location of the book when searching for a book name. Also, if you make a typo when searching for a book name, similar book names are automatically suggested by using 'Edit Distance' algorithm.

*Currently, there is no Gachon University library DB, so the Gangnam-gu smart library DB is being used temporarily.
 (But the Gangnam-gu smart library DB is not complete, so some data may work unstable.)
*The library map is a virtual map, not a real library.

  • Example Screenshots

Project Structure

server.js : Main execution of this service

/public : A folder for static files, including image files, CSS, etc.
    /css : CSS files
    /img : Image files
        library_map.jpg : Image of library map.

/src : Source code of library-nav modules.
    db.template.js : Configuration file of DB connection (Should be rename to db-config.js)
    library-map-node-generator.js : library-map-node.json generating code.
    (Generate json file by node library-map-node-generator.js command)
    library-map-node.json : Json file that store library map nodes.
    library-nav-info.js : A collection of functions that give information about a book and its location.
    library-nav-search.js : A collection of functions used for searching library books.

/views : Frontend ejs template directory.
    index.ejs : First main screen and search result output.
    info.ejs : Book information and map output.

Run on localhost

  1. Download DB data from https://www.data.go.kr/data/15071671/fileData.do or your own DB.
  2. Set MySQL server and table structure as below. (If you want to use different table structure, you need to edit source code)

  1. Import Database as below.
LOAD DATA LOCAL INFILE '<data file directory>/library.csv' INTO TABLE book FIELDS TERMINATED BY ',';
  1. Rename db.template.js to db-config.js and set with your db configuration.
var db = mysql.createConnection({
    host:'example.com',
    user:'example',
    password:'password',
    database:'library'
});
  1. Run Server with Node.js
cd <project directory>
npm install
node server.js

Tech Stack

[FE] HTML / CSS / Javascript
[BE] Node.js, Express, PM2
[Database] MySQL
Testing DB from https://www.data.go.kr/data/15071671/fileData.do