Skip to content

mbarley333/timetracker

Repository files navigation

timetracker

The timetracker application allows you to track time spent on tasks. The timetracker frontend and backend is built with Go and the data store is either SQLite or Postgres.

prerequisites

  • Go 1.16
  • Docker
  • docker-compose

startup options

1) containerized timetracker application and Postgres container
clone repo locally

docker-compose up
browse to: http://127.0.0.1:4000/home

2) timetracker with SQLite
clone repo locally

cd to directory
go run ./cmd/main.go
browse to: http://127.0.0.1:4000/home


3) timetracker with Postgres container

  • edit cmd/main.go:
package main

import (
	"log"
	"timetracker"
)

func main() {

	conn := "host=localhost port=5432 user=postgres dbname=timetracker sslmode=disable"
	s := timetracker.NewServer(
		timetracker.WithPostgresStore(conn),
	)
	log.Fatal(s.ListenAndServe())

}
cd store/pg
docker-compose up
go run ../../cmd/main.go
browse to: http://127.0.0.1:4000/home

Goals

To learn and become more familiar with the following aspects of the Go language:

  • testing
  • HTTP Server
  • templates
  • interfaces
  • embed
  • Postgres
  • SQLite

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages