Ducky 01ff7e6497 | ||
---|---|---|
cmd | ||
db | ||
handler | ||
models | ||
pkg | ||
public | ||
view | ||
.air.toml | ||
.env.example | ||
.gitignore | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
README.md | ||
bun.lockb | ||
go.mod | ||
go.sum | ||
main.go | ||
package-lock.json | ||
package.json | ||
tailwind.config.js |
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
- 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
- Setup a
.env
file filled out with the required fields from.env.example
cp .env.example .env
- 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 thetempl generate watch
command andgo 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 runmake up
-
Reset tables with
make reset
ormake down
- Ensure you add the newly created table to the
tables
slice located incmd/reset/main.go
otherwise the table will not be dropped when runningmake reset
.
- Ensure you add the newly created table to the
-
Create new routes in
handlers/
, set them up inmain.go
withrouter.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 withrender(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.