This is a simple web application with a Go server/backend and a Vue.js SPA (Single Page Application) frontend.
/
├── frontend Root of the Vue.js project
│ └── src Vue.js source code
│ └── tests Unit tests
├── server Go backend server
│ └── main.go Server main / exec
│ └── main_test.go Test for testing the API
├── seeder.py Python script for downloading data files and creating tables and inserting data
- Be using Linux, WSL or MacOS, with bash, make etc
- Node.js Go 1.16+ - for running locally, linting, running tests etc
- Postgress
- [Python] for running the seeder.py file
Clone the project to any directory where you do development work
git clone https://github.com/zubairriaz/packform-excersice
Environmental variables
-
PORT
- PORT of the postgress sql databse (default:5432
) -
PASSWORD
- Password of the postgress sql -
USER
- User of the postgress sql -
DBNAME
- Name of the DB by which you want the Db to be created or the already existent DB name
5 - Now go the the frontend folder and download all dependencies by executing the command npm install
6- Now start the server by executing the command go run main.go app.go
from the server folder this will start the server at http://localhost:8001
8- This will start the project at http://localhost:8080/ but due to google chrome security issues we cannot access the API from our front end due to CORS issue so to test the app close all chrome windows and follow these steps
1-Right click on desktop, add new shortcut 2-Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp 3-Click OK.