/Todohexagonal

A todo application based on hexagonal architechture

Primary LanguageGo

Hexagonal Architechture base Todo Web application.


Hexagonal Architechture

Requirements


  • Environmental Variables
    • URL_DB - The selected database ie "redis" or "postgres" or "mongodb" or "mysql"
    • DATABASE_URL - Incase you choose any db apart from redis
    • [REDIS]/[POSTGRES]/[MONGODB]/[MYSQL]_URL- dsn for the database eg REDIS_URL for redis
    • PORT - Port to run application defaults to :8000

Example

  • Linux bash variables
export DB_URL=redis
export REDIS_URL=localhost:6329

Accepted databases


  1. postgres
  • POSTGRES_URL - Required env variable
  1. redis
  • REDIS_URL - required env dsn
  1. mysql
  • MYSQL_URL - required env dsn

Running application


go run cmd/web/main.go

Functions


  1. Adding a todo
http :8000 content="Create a website" status="started"
  1. Getting a todo
http :8000/{todo_id}
  1. Delete a todo
http DELETE :8000/{todo_id}
  1. Update a todo
http PATCH :8080/{todo_id} <parts to be updated eg content="stuff">