diff --git a/README.md b/README.md index 62cbeed..f59fac6 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,9 @@ Create interactive applications with Golang, HTMX, and Templ - [Create a production release](#create-a-production-release) # Installation +Install SUPERKIT in a single command: ``` -go install github.com/anthdm/gothkit@master -``` - -After installation you can create a new project by running: -``` -gothkit [myprojectname] +go run github.com/anthdm/gothkit@master [yourprojectname] ``` You can now navigate to your project: @@ -44,6 +40,11 @@ You can now navigate to your project: cd [myprojectname] ``` +Run npm install +``` +npm install +``` + # Getting started ## Application structure ### assets @@ -108,7 +109,6 @@ This will create a binary file located at `/bin/app_prod`. Make sure you also set the correct application environment variable in your `.env` file. ``` -APP_ENV = production +SUPERKIT_ENV = production ``` - diff --git a/bootstrap/.env.local b/bootstrap/.env.local index 1701f9a..fdb430b 100644 --- a/bootstrap/.env.local +++ b/bootstrap/.env.local @@ -1,6 +1,6 @@ # Application environment # production or development -APP_ENV = development +SUPERKIT_ENV = development # HTTP listen port of the application HTTP_LISTEN_ADDR = :3000 diff --git a/bootstrap/public/assets/index.js b/bootstrap/public/assets/index.js new file mode 100644 index 0000000..dd0d1bc --- /dev/null +++ b/bootstrap/public/assets/index.js @@ -0,0 +1,4 @@ +(() => { + // app/assets/index.js + console.log("if you like superkit consider given it a star on GitHub."); +})(); diff --git a/kit/kit.go b/kit/kit.go index 8c11e8f..430efcf 100644 --- a/kit/kit.go +++ b/kit/kit.go @@ -144,26 +144,26 @@ func Getenv(name string, def string) string { } func IsDevelopment() bool { - return os.Getenv("APP_ENV") == "development" + return os.Getenv("SUPERKIT_ENV") == "development" } func IsProduction() bool { - return os.Getenv("APP_ENV") == "production" + return os.Getenv("SUPERKIT_ENV") == "production" } func Env() string { - return os.Getenv("APP_ENV") + return os.Getenv("SUPERKIT_ENV") } // initialize the store here so the environment variables are // already initialized. Calling NewCookieStore() from outside of // a function scope won't work. func init() { - appSecret := os.Getenv("APP_SECRET") + appSecret := os.Getenv("SUPERKIT_SECRET") if len(appSecret) < 32 { // For security reasons we are calling os.Exit(1) here so Go's panic recover won't - // recover the application without a valid APP_SECRET set. - fmt.Println("invalid APP_SECRET variable. Are you sure you have set the APP_SECRET in your .env file?") + // recover the application without a valid SUPERKIT_SECRET set. + fmt.Println("invalid SUPERKIT_SECRET variable. Are you sure you have set the SUPERKIT_SECRET in your .env file?") os.Exit(1) } store = sessions.NewCookieStore([]byte(appSecret))