Git Product home page Git Product logo

tradelog's Introduction

create project directory
mkdir 'projectname'

create .gitignore
create main.go
go mod init 'projectname'

install chi
https://github.com/go-chi/chi
go get github.com/go-chi/chi/v5

create .env file

install godotenv
https://github.com/joho/godotenv
go get github.com/joho/godotenv

run what has been built so far with
go run main.go

create Makefile
comment out css line for now

make sure go path is correct
export PATH=$PATH:/Users/nickforce/go/bin

(install binary if not already installed)
go install github.com/a-h/templ/cmd/templ@latest

confirm install with templ

install templ
go get github.com/a-h/templ

create handler directory
create view directory
create types directory
create view/home directory

create view/home/index.templ

run make

create handler/home.go
create handler/shared.go

install tailwind
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

update tailwind.config.js

install daisyUI
npm i -D daisyui@latest

specify daisyUI theme in tailwind.config.js

create view/layout directory
create view/layout/app.templ

create public directory

create view/css directory
create view/css/app.css

uncomment css line in Makefile

create .air.toml

create view/ui directory
create view/ui/naviagation.templ

find navbar on daisyUI

create handler/middleware.go

create types/user.go

create view/shared.go

create view/auth directory
create view/auth/auth.templ
create handler/auth.go

Add to .env file
DB_HOST
DB_USER
DB_PASSWORD
DB_NAME
SUPABASE_SECRET
SUPABASE_URL

Install Supabase client for auth
https://github.com/nedpals/supabase-go
go get github.com/nedpals/supabase-go

Install Golang BUN to interact with the db

create pkg directory
create pkg/sb directory
create pkg/sb/sb.go

Install gorilla sessions go get github.com/gorilla/sessions

Add SESSION_SECRET to .env (uuid random string)

create pkg/util directory
create pkg/util/util.go

create pkg/kit directory
create pkg/kit/validate directory
create pkg/kit/validate.go
create pkg/kit/validate_test.go

supabase login callback
Authentication > URL Configuration > Site URL
http://localhost:3000/auth/callback

Install Google UUID
go get github.com/google/uuid

create handler/settings.go create view/settings directory
create view/settings/account.templ

enable google provider supabase
Authentication > Providers > Google
https://console.cloud.google.com/apis/credentials
APIs & Services > Credentials > + Create Credentials > OAuth Client ID > Authorized redirect URIs

  • paste in the Callback URL (for OAuth) from supabase
    Create credential
    Copy the Client ID and Client Secret and paste back in Supabase under Google Provider info

add auth callback url to .env

create cmd directory
create cmd/migrate directory
create cmd/migrate/main.go

create db directory
create db/db.go

install bun
go get github.com/uptrace/bun

install bun pgdialect go get github.com/uptrace/bun/dialect/pgdialect

install bun debug go get github.com/uptrace/bun/extra/bundebug

create APP_DEBUG .env variable
set to 1 to enable debug mode
APP_DEBUG="0"

install golang migrate
go get github.com/golang-migrate/migrate/v4

install golang migrate postgres
go get github.com/golang-migrate/migrate/v4/database/postgres

create cmd/migrate/migrations directory

install golang migrate source/file
go get github.com/golang-migrate/migrate/v4/source/file

install migrate cli
brew install golang-migrate

create a table migration files
make migration add_table_accounts

create cmd/reset directory

create types/account.go

create db/query.go

Enable RLS on Supabase Tables

create view/ui/toast.templ

create static_dev.go
create static_prod.go

static files are the public build for the static folder

HOT reload 3 terminals in following order

make css
air
make templ

tradelog's People

Contributors

nickforce avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.