verbose-couscous

module
v0.0.0-...-2233bd7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2021 License: MIT

README

verbose-couscous: Bookings and reservations

This is a repository for bookings and reservations project.

Prerequisites

  1. Connect to GitHub with SSH
  2. clone the repo using SSH git clone git@github.com:dpthegrey/verbose-couscous.git
  3. install golang
  4. Soda or Pop should be installed for database migration

How to use?

In the project root directory

Linux/Unix environment

Configure database

Copy content from database.yml.example to a new file database.yml at the same file location and fill in database credentials.

The database.yml should look similar to this

development:
  dialect: postgres
  database: bookings
  user: John
  password: passwordForJohnUser
  host: 127.0.0.1
  pool: 5

test:
  url: {{envOr "TEST_DATABASE_URL" "postgres://postgres:postgres@127.0.0.1:5432/myapp_test"}}

production:
  url: {{envOr "DATABASE_URL" "postgres://postgres:postgres@127.0.0.1:5432/myapp_production"}}
Database Migrations
  • Run soda migrate to create db migrations & soda migrate down if you want to delete Database migrations.
Run Golang Server
  • give permissions to the bash file in the project root directory by chmod +x run.sh and then run the binary ./run.sh

Windows environment

  • Execute run.bat

Testing

  • Test usinggo test
  • Test using verbose modego test -v
  • Check coverage go test -cover
  • Get test coverage as an HTML file go test -coverprofile=coverage.out && go tool cover -html=coverage.out (this opens in web browser)

Directories

Path Synopsis
cmd
web
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL