Categorygithub.com/JeongJaeSoon/go-auth
repositorypackage
0.0.0-20241201164420-0bf6fb73dc16
Repository: https://github.com/jeongjaesoon/go-auth.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

go-auth

go-auth is a simple authentication system built with Go. It includes a basic user model, authentication, and authorization.

Overview

Features

  • User authentication and authorization
  • gRPC and RESTful APIs
  • Middleware for handling authentication and authorization
  • Session management using Redis
  • Database integration with PostgreSQL

Prerequisites

  • Go 1.23.2
  • Docker
  • Docker Compose (for development)

Getting Started

  1. Clone the repository

    git clone https://github.com/JeongJaeSoon/go-auth.git
    
  2. Build the project

    go build -o go-auth .
    
  3. Run the project

    ./go-auth
    

Development

Setup

## This section is under preparation and will be provided once ready.
docker compose up --build

Directory Structure

go-auth/
├── cmd/
│   └── server/
│       └── main.go          ## Server entry point
│       └── server.go        ## Server setup and routing
├── config/
│   ├── config.yaml          ## Configuration files
│   └── config.go            ## Configuration management
├── internal/
│   ├── auth/
│   │   ├── service.go       ## Authentication service logic
│   │   └── handler.go       ## HTTP and gRPC handlers
│   ├── db/
│   │   └── db.go            ## Database initialization and connection
│   ├── handler/
│   │   └── health.go        ## Health check handler
│   │   └── auth.go          ## Authentication handler
│   ├── logging/
│   │   └── logger.go        ## Logger initialization and configuration
│   ├── middleware/
│   │   └── auth_middleware.go ## Authentication middleware
│   ├── proto/
│   │   └── auth.proto       ## gRPC protocol definitions
│   └── utils/
│       └── utils.go         ## Utility functions
├── pkg/
│   └── models/
│       └── user.go          ## User model definitions
├── test/
│   ├── integration/
│   │   └── auth_integration_test.go ## Integration tests
│   └── e2e/
│       └── auth_e2e_test.go        ## End-to-end tests
├── Dockerfile               ## Docker image build configuration
├── docker-compose.yaml      ## Docker Compose configuration for development
├── go.mod                   ## Go module initialization file
└── go.sum                   ## Go module dependency checksum file

Dependency Injection

This project utilizes Wire for dependency injection. To install Wire, run:

go install github.com/google/wire/cmd/wire@latest