Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSCC43 Project

Setup

The backend needs to connect the data, create a backend/.env file and add the following information (use the gcp credentials for prod):

PGUSER=postgres
PGPASSWORD=password
PGHOST=localhost
PGPORT=9999
PGDATABASE=postgres
cd backend
docker compose up -d
cd ..
psql -h localhost -p 9999 -U postgres

Then in the psql prompt

\i ./backend/sql/schema.sql;

\copy Stock(symbol) FROM './backend/stock.csv' DELIMITER ','
CSV HEADER;

\copy Stockdata(time_stamp, open, high,
low, close, volume, symbol) FROM './backend/SP500History.csv' DELIMITER ','
CSV HEADER;

\i ./backend/sql/cache.sql;

Structure

backend/
  db/             # code for accessing db
    index.js
  routes/         # route endpoints

  sql/            # sql files
    schema.js
  index.js

Endpoints

  • register(username, password, fname, lname)

  • login(username, password)

  • createportfolio(username, foldername)

  • viewallportfolios(username)

  • viewoneportfolio(username, pid)

  • withdraw(username, pid, amount)

  • buystock(username, id, symbol, shares)

  • portfoliomarketvalue(username, pid)

  • pastperformance(symbol, interval)

  • createstocklist(username, foldername)

  • viewallstocklist(username)

  • viewonestocklist(username, slid)

  • statusstocklist(slid, status)

  • sendrequeset(uid1, uid2)

  • acceptrequest(uid2, uid1)

  • rejectrequest(uid2, uid1)

  • sharestocklist(uid1,uid2, slid)

  • createreviewstocklist(uid1, slid, content)

  • updatereviewstocklist(uid1, slid, content)

Documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages