Web server made for storing data on shopping lists and recipes based on GO.
Made as easy to handle as possible.
(in development)
Frontend source for this backend is available here
Several ffmpeg libraries reqired:
sudo apt-get install libavcodec-dev
sudo apt-get install libavformat-dev
sudo apt-get install libavutil-dev
sudo apt-get install libswscale-dev
PostgreSQL server installed and configured reqired:
-
Add repository
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/
lsb_release -cs-pgdg main" |sudo tee /etc/apt/sources.list.d/pgdg.list
-
Install PostgreSQL
sudo apt-get update
sudo apt -y install postgresql-13 postgresql-client-13
sudo service postgresql start
orpg_ctlcluster 13 main start
-
Change default password for postgres
sudo su - postgres
psql -c "alter user postgres with password 'new password'"
Run this command to get source code:
go get github.com/chainsaws-dev/shopping-lists-and-recipes-backend
Run this command to start documentation server on localhost:6060:
godoc -http=:6060
Documentation on this server will be available here
To run project without compilation run the following:
go run *.go
To install in GO bin directory run the following:
go install *.go
To build in project root directory run the following:
go build *.go
go test ./...
go test -bench .
go test -cover
go test -coverprofile c.out
go tool cover -html=c.out
-
Create .env file with folowing contents:
DATABASE_USERNAME=ExampleDBUsername DATABASE_PASSWORD=ExamplePassword [email protected]@@examplepassword WEB_URL=http://localhost:8080
-
In project root folder run:
sudo docker-compose up -d
- to start database and webservice containerssudo docker-compose up --build -d
- to rebuild docker images and run database and webservice containers
sudo docker-compose down --volumes
- to stop database and webservice containers