README
How to set up project:
- Edit file databaseConnection.js to your local database details
- Create tables in Postgres using the following code:
POSTS TABLE
CREATE TABLE IF NOT EXISTS dss.blogposts
(
postid bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 0 MAXVALUE 9999999 CACHE 1 ),
bloguserid bigint NOT NULL,
blogusername character varying COLLATE pg_catalog."default" NOT NULL,
title character varying COLLATE pg_catalog."default" NOT NULL,
body character varying COLLATE pg_catalog."default" NOT NULL,
date date NOT NULL DEFAULT CURRENT_TIMESTAMP,
"time" time without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
filepath character varying COLLATE pg_catalog."default",
CONSTRAINT blogposts_pkey PRIMARY KEY (postid)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS dss.blogposts
OWNER to postgres;
USERS TABLE
CREATE TABLE IF NOT EXISTS dss.bloguser
(
bloggerid bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 0 MAXVALUE 9999999 CACHE 1 ),
bloggerusername character varying COLLATE pg_catalog."default" NOT NULL,
bloggerpassword character varying COLLATE pg_catalog."default" NOT NULL,
bloggeremail character varying COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT bloguser_pkey PRIMARY KEY (bloggerid)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS dss.bloguser
OWNER to postgres;
SESSION TABLE
CREATE TABLE IF NOT EXISTS dss.session
(
bloggerusername character varying COLLATE pg_catalog."default" NOT NULL,
bloggersessionhash character varying COLLATE pg_catalog."default" NOT NULL
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS dss.session
OWNER to postgres;
- run npm install
- open .env file and populate USER = " " and PASSWORD = " " with the credentials associated with the email account you wish to send 2-FA emails from