Giter VIP home page Giter VIP logo

go-api-auth-example's Introduction

An example of Authentication with Go

This projects shows how to build a minimal full stack web app using Go, HTMX, Templ and Tailwindcss with Authentication (OAuth).

Checkout the Full Stack GO project to learn more about the project structure.

Structure

All the HTML are stored in *.templ files in the /views and /components directories. The /handlers directory contains the Go handlers for the different routes that serve those Templ components.

Installation

There are a few tools that you need to install to run the project. So make sure you have the following tools installed on your machine.

Adittionally, it's recommended to install a syntax highlighting and templ LSP integration: the official Templ documentation.

Running the project

Firstly make sure you have a MySQL database running on your machine or just swap for any storage you like under /store.

Don't forget to check the .env.example file and inject those environment variables into your environment, it's optimized for the cloud enviroment so it's recommended to inject them at runtime, for example using direnv.

If you want to inject them manually into a .env, install go-dotenv and adjust the config/config.go file to read the .env file instead.

Then, for the best development experience, run the project in 3 different processes by running:

air # for the go server live reloading
make tailwind # for the tailwindcss live reloading
make templ # for the templ files live generation and reloading

go-api-auth-example's People

Contributors

sikozonpc 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.