---
# System prepended metadata

title: AUTH SERVICE

---

# AUTH SERVICE

### TECH STACK
1. DB - Postgres(gorm.io)
2. Gin
3. Logrus (logging)
4. Viper (config management)

### REPO STRUCTURE
```
.
├── Dockerfile
├── Makefile
├── README.md
├── api
│   └── api.go
├── config
│   └── config.go
├── controller
│   ├── controller.go
│   ├── getuser.go
│   └── healthcheck.go
├── go.mod
├── go.sum
├── main.go
├── model
│   └── user.go
├── pkg
│   ├── db
│   │   └── db.go
│   ├── log
│   │   └── log.go
│   └── middleware
├── repository
│   └── repository.go
└── service
    └── service.go
```

### API DOCUMENTATION

#### Common Structs
```
Status {
     Success     bool
     Message     string
}

Address {
    Address1  string
    Address2  string
    City      string
    State     string
    Country   string
    Zipcode   int
}
```

1. Register (/register)
    ```
    RegisterRequest {
        FirstName        string
        MiddleName       string
        LastName         string
        Password         string
        ConfirmPassword  string
        Email            string
        Phone            string
    }
    ```
    ```
    RegisterResponse {
        Status     Status
    }
    ```
2. Login (/login)
    ```
    LoginRequest {
        Email       string
        Password    string
    }
    ```
    ```
    LoginResponse {
        Status    Status
        Token     string
    }
    ```
3. Verify Account (/verify)
    ```
    VerifyResponse {
        Status   Status
    }
    ```
4. Forgot Password (/forgot)
    ```
    ForgotRequest {
        Email     string
    }
    ```
    ```
    ForgotResponse {
        Status     Status
    }
    ```
    
5. Reset Password (/reset)
    ```
    ResetRequest {
        NewPassword         string
        ConfirmPassword     string
    }
    ```
    ```
    ResetResponse {
        Status    Status
    }
    ```

6. Update Password (/update-password)
    ```
    UpdatePasswordRequest {
        OldPassword     string
        NewPassword     string
        ConfirmPassword string
    }
    ```
    ```
    UpdatePasswordResponse {
        Status     Status
    }
    ```
7. GetProfile (/profile)
    ```
    GetProfileResponse {
        FirstName     string
        MiddleName    string
        LastName      string
        Email         string
        Phone         string
        DOB           string
        Address       Address
    }
    ```
8. UpdateProfile (/profile)
    ```
    UpdateProfileRequest {
        FirstName     string
        MiddleName    string
        LastName      string
        DOB           string
        Address       Address
    }
    ```
    ```
    UpdateProfileResponse {
        Status     Status
    }
    ```
    
9. Logout (/logout)
    ```
    LogoutResponse {
        Status     Status
    }
    ```

10. Delete Account (/delete)
    ```
    DeleteRequest {
        Password     string
    }
    ```
    ```
    DeleteResponse {
        Status     Status
    }
    ```
