Go to file
Ducky 01ff7e6497 Updated npm packages and auto generated styles.css 2024-05-10 20:21:09 +10:00
cmd Add task_assignees to reset list 2024-04-27 18:18:37 +10:00
db Update GetUserTasks to check the task_assignees table before querying users tasks 2024-04-27 18:19:00 +10:00
handler Add log.Fatal to MakeHandler 2024-05-10 20:18:53 +10:00
models Add multiple assignees to task 2024-04-27 17:38:49 +10:00
pkg Init commit for issue branch logins 2024-03-30 15:02:27 +10:00
public Updated npm packages and auto generated styles.css 2024-05-10 20:21:09 +10:00
view Add multiple assignees to task 2024-04-27 17:38:49 +10:00
.air.toml Ensure templ and ducky-dash processes are killed 2024-04-22 21:39:37 +10:00
.env.example Create .env.example 2024-02-27 02:02:38 +10:00
.gitignore Update README and .gitignore 2024-04-18 01:49:30 +10:00
Dockerfile Ensure to run make build 2024-04-22 13:56:10 +10:00
LICENSE Setup DB Init, migrations and setup 2024-02-27 03:22:39 +10:00
Makefile Add build-docker command 2024-05-08 20:57:57 +10:00
README.md Update groups modal to load the users select on page load rather than dynamically from the server 2024-04-27 15:56:59 +10:00
bun.lockb Update dependencies 2024-04-18 16:30:07 +10:00
go.mod Rename package module name 2024-04-22 13:34:48 +10:00
go.sum Rename package module name 2024-04-22 13:34:48 +10:00
main.go Add chi middleware.Logger 2024-05-09 19:48:06 +10:00
package-lock.json Updated npm packages and auto generated styles.css 2024-05-10 20:21:09 +10:00
package.json Updated npm packages and auto generated styles.css 2024-05-10 20:21:09 +10:00
tailwind.config.js Navbar restyling 2024-04-15 22:20:28 +10:00

README.md

Ducky Dash

Taking inspiration from the HTMX + Templ course from anthonyGG, repo for the course.

A dashboard using at current my favourite tools Golang, HTMX, Templ, Bun, Tailwind and Supabase. It's purpose will be infinite in that when I have new ideas that may not be necessary or ready for a side project I can implement the functionality in anyway and plug it into this dashboard.

Todo

  • Fix settings page not updating profile details correctly

  • Finish password-reset flow

  • Assign multiple users to groups

  • Fix CreateGroup/TaskModal not displaying correctly, is stuck to the top left corner in a scrollable container

  • Edit and delete tasks from the frontend

  • Differentiate between users with Auth Roles

    • Ability to edit groups and delete members to group admins/creator
  • Setup a 404 error page

    • Dynamically set the error on the page
  • Build out some type of Dashboard components that are modular, take in some type of data and display charts or otherwise on the frontend

    • DB Queries, Server hardware stats, App stats
  • Fix List card components on mobile, items not displaying properly/flex breaking

Setup

Copy the .env.example file to .env and fill out the values with your own data. Change the port number in the dev command of the Makefile to match your HTTP_LISTEN_ADDR which you set in the step above.

  • Ensure to install the migrate cli and have it available on your path to be able to run the following make commands.

  • Ensure to install the migrate cli and have it available on your path to be able to run the following make commands.

Note: Alternative packages are available in the ecosystem, this is the one I use mainly because of the golang commands.

  • Ensure templ is installed and available on your path

Building the application

Make

  • Run make install
  • Run make build

Alternatively you can use make to just build and run the application. Though for any functionality you need to run make up to run the migrations and setup the database.

Docker

  1. Clone the repo to your workstation/server and navigate to root of the project
git clone https://git.duckylabs.xyz/duckbox/ducky-dash
cd ducky-dash
  1. Setup a .env file filled out with the required fields from .env.example
cp .env.example .env
  1. Build the image using docker, name it whatever you like after the -t to make life easier later.
docker build -t ducky-dash .

Development

  • Run make install
  • Ensure to install the migrate cli and have it available on your path to be able to run the following make commands.

Note: Alternative packages are available in the ecosystem, this is the one I use mainly because of the golang commands.

  • Ensure templ is installed and available on your path

  • Run make dev to start the hot-reload dev server which will reload the templ generate watch command and go run . commands after any changes to your .templ or .go files. Change the proxy address

  • Setup migrations with make migration table_name, edit the sql file and run make up

  • Reset tables with make reset or make down

    • Ensure you add the newly created table to the tables slice located in cmd/reset/main.go otherwise the table will not be dropped when running make reset.
  • Create new routes in handlers/, set them up in main.go with router.GET("/path", handler.MakeHandler(handler.NameOfHandler))

  • Create new db queries in db/query.go

  • Create templ components and views in views and render throughout the application, primarily with render(r, w, ComponentName)

Deployment

Setup your .env file (manual deployment) or Environment Variables (automated deployment) with your CI/CD solution.

Automated

I have tested deploying this application automatically using the features that Coolify provides thanks to the Dockerfile it is as simple as pushing the changes to your git server. If the repo is hosted on GitHub you can then simply push them to master (or your branch of choice) and Coolify will automatically build and deploy to your server. Personally I host my own git server and have not yet found a way to automate the deployment process, though having to go and press a single button from my Coolify dashboard is extremely simple.

Other CI/CD solutions should work in a similar way, as long as the Dockerfile build and runs correctly then there should be no issue.

Manual

Manual deployments vary from one to another. For the most part it should be as simple as building the application, running it and exposing the appropiate port on your server. A reverse proxy would be highly recommended. One can use the Dockerfile to enable a docker build or the Makefile for a manual local build.

Clone the project to your server, follow the instructions in the build section and expose the application as per requirements.