Skip to content

lefProg/article-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

MYE030 project | Article Analyzer

Nikolaos Ntermaris 5477 Pavlos Anagnostou 5440 Barmpas Eleftherios 5521

The project has three parts, all under src/:

  1. Heruklotis - a CLI that cleans the raw CSVs into TSVs ready for the database.
  2. Backend - a Go HTTP API. It also serves the frontend.
  3. Frontend - a Vue single-page app, served by the backend on the same port.

Prerequisites

  • Go 1.26+ (backend) and Go 1.25+ (heruklotis)
  • MariaDB or MySQL 8.x running locally
  • A web browser
  • jq (optional, only used by the backend smoke test)

Heruklotis

Heruklotis is a cli tool that parces the given csv, and generate other csvs that will be ready to push into the database for the project.

Heruklotis is a Greek word that derives from the well-known word "Heruklono." Heruklono is a verb that itself comes from the word "Heri," which means hand. So, Heruklotis refers to someone who goes and "touches" the data. For us, it is simply the service that takes raw data and returns the clean, processed data.

Building and running Heruklotis

Having the project cloned, build it by running the following commands in the terminal:

cd src/heruklotis
go build -o bin/heruklotis

This creates a binary in the bin folder. Run it with:

./bin/heruklotis

(or just go run . to skip building)

It opens an interactive terminal UI:

  1. Pick one of the input CSV files with the file picker. All input files must live in the same folder; the picker uses that folder as the input directory.
  2. Type the output folder path. Use data/output so the database loader finds the result automatically.

The input folder must contain these six raw files:

  • input_article.csv
  • input_inproceedings.csv
  • iCore26_KilledColumnsForLoading.csv
  • primary_for_codes.csv
  • best_subject_areas.csv
  • journal_ranking_data_raw.csv

(The last three already ship in src/heruklotis/data/input/.)

Heruklotis writes 9 TSV files to the output folder. Parsing takes a few minutes.

Database

From the backend folder, run the setup script:

cd src/backend
./setup-db.sh

The script expects the Heruklotis output (9 files) at src/heruklotis/data/output/. It drops and recreates the article_analyzer database, loads the schema and data, and creates a read-only user analyzer. It prompts for the MariaDB/MySQL root password and a new password for the app user. Loading the data takes about 30s to 2 minutes.

You can also pass the passwords through the environment to skip the prompts:

DB_PASSWORD=yourpassword DB_ROOT_PASSWORD=rootpassword ./setup-db.sh

Backend and frontend

The backend serves both the API and the frontend on one port:

cd src/backend
export DB_DSN='analyzer:yourpassword@tcp(127.0.0.1:3306)/article_analyzer'
go run .

Then open in a browser:

The frontend is served from ../frontend by default; override it with the FRONTEND_DIR environment variable.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors