Skip to content

Go REST API for querying information about domains. Frontent implemented in vue. MongoDB as Data layer.

License

Notifications You must be signed in to change notification settings

valentinafeve/sofos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sofos

Watch the video

Running database

Once cockroach is installed.

Running cockroack

cockroach start --insecure  

Now cockroach is running on port 8080.

Running sql shell

cockroach sql --insecure

Setting Database

Execute in the shell

CREATE DATABASE sofos;
SET DATABASE = sofos;
CREATE TABLE DomainInformation (
    SSLGrade VARCHAR(5),
    Title VARCHAR(100),
    IsDown BOOLEAN,
    Domain VARCHAR(50)
  );
CREATE TABLE HistoryQueries (
    Domain VARCHAR(50),
    LatestQuery TIMESTAMP
  );
CREATE TABLE RelatedServers (
    Domain VARCHAR(50),
    Server VARCHAR(50)
  );
CREATE USER IF NOT EXISTS sofos_u;
ALTER USER sofos_u WITH PASSWORD 'g7D239Asn1';
GRANT ALL ON historyQueries TO sofos_u;
GRANT ALL ON DomainInformation TO sofos_u;
GRANT ALL ON RelatedServers TO sofos_u;

Running Go Server

Once go is installed

cd go_chi

./main

Now go is running on port 3000.

In order to rebuild the executable.

go get -u github.com/go-chi/chi

go get -u github.com/lib/pq

Running Web Server

Once Node and npm are installed

npm install -g @vue/cli

cd vue_app

npm install

npm run serve

Now go is running on port 8081.

The web application will be available at localhost:8081 if the port is not being used.