Skip to content

yixuanwu4/data-collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

data-collection

Getting started

  1. Install node.js with version 17.3.1
  2. Install postgresql
  3. Set up a postgresql user
  4. Run yarn install
  5. Run yarn dev
  6. Go to http://localhost:3000
  7. Data can be exported to csv by visiting http://localhost:3000/export

Creation process

  1. Set up a free ARM server on Oracle Cloud
    1. Open ingress port 80
  2. Connected to the subdomain homework.yxwu.me to the server by adding DNS A and AAAA records
  3. Open ingress port 80 on the server with iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
  4. Set up nodejs on the server with apt install node
  5. Initialized a new JavaScript project with yarn init . inside my project folder
  6. Created a git repository on Github
  7. Associated my local project with the git repository
    1. git init
    2. git add .
    3. git config --global user.email "[email protected]"
    4. git config --global user.name "Yixuan"
    5. git commit -m "first commit"
    6. git branch -M main
    7. git remote add origin https://github.com/yixuanwu4/data-collection.git
    8. git push -u origin main
  8. Added express to the project with yarn add express
  9. Added a .gitignore file generated by gitignore.io
  10. Implemented index.html, style.css, and form.html, and updated to the git repository.
  11. Setup postgresql database
    1. Install postgresql database on the server with sudo apt install postgresql
    2. Log into database with sudo -u postgres psql
    3. Create new database for this project CREATE DATABASE datacollection;
    4. Create a new user CREATE USER yixuan WITH ENCRYPTED PASSWORD 'kittysMakeMeHappy';
    5. Grant permissions to user for new database GRANT ALL PRIVILEGES ON DATABASE datacollection TO yixuan;
    6. Create a new table with the header names (see the command in file tables.sql)
    7. Insert a row into the created table (see the command in file tables.sql)
  12. Implemented backend in server.js.
  13. Start server in production mode yarn prod & (prod is defined in package.json)
  14. From pg-copy-streams import copyTo to copy the data out of PostgreSQL and save it into export.csv.

Resources

About

This is a project of the course "Data Collection on the Web" at the University of Tuebingen.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published