Logo

Todo App

Generic todo app written in Go!

About Todo App

I built this project to supplement my learnings from the first 8 chapters of Let’s Go by Alex Edwards. Nothing crazy, just a simple todo app using Go, templates, and materialize css for styles.

Installation

Prerequisite

  1. Install PostgreSQL
  2. Install Go 1.18 or later

Manually from source

  1. Clone the repo and cd into the directory
git clone https://github.com/navazjm/todoapp && cd todoapp
  1. Run sql script to setup db
psql postgres -U <USERNAME> -f scripts/db.sql
  1. Update dsn on cmd/server/main.go line 25 or see dsn command-line flag
dsn := flag.String("dsn", "user=<USERNAME> dbname=todoapp sslmode=disable", "Psql data source name")

Running the server

  1. Change directory to the root of the project
cd path/to/todoapp
  1. Run server with default config
go run ./cmd/server
  1. Go to localhost:4000 in your browser

command-line flags when running the server

  1. Run the server with optional command-line flags
go run ./cmd/server -addr=":<PORT>" -dsn="user=<USERNAME> dbname=todoapp sslmode=disable"
  1. Go to localhost:PORT in your browser

Contact

Michael Navarro – @navazjm [email protected]

Project Link: https://github.com/navazjm/todoapp

GitHub

View Github