{"id":26104438,"url":"https://github.com/youbaimkf/go-auth-api","last_synced_at":"2026-04-20T12:07:28.359Z","repository":{"id":281339551,"uuid":"944499829","full_name":"YoubaImkf/go-auth-api","owner":"YoubaImkf","description":"Golang Authenticate API","archived":false,"fork":false,"pushed_at":"2025-03-08T11:51:18.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T12:25:10.330Z","etag":null,"topics":["authentication","docker","go","golang","smtp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YoubaImkf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-07T13:04:31.000Z","updated_at":"2025-03-08T11:51:21.000Z","dependencies_parsed_at":"2025-03-08T20:45:11.398Z","dependency_job_id":null,"html_url":"https://github.com/YoubaImkf/go-auth-api","commit_stats":null,"previous_names":["youbaimkf/go-auth-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoubaImkf%2Fgo-auth-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoubaImkf%2Fgo-auth-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoubaImkf%2Fgo-auth-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoubaImkf%2Fgo-auth-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YoubaImkf","download_url":"https://codeload.github.com/YoubaImkf/go-auth-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242750786,"owners_count":20179257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","docker","go","golang","smtp"],"created_at":"2025-03-09T21:01:31.940Z","updated_at":"2026-04-20T12:07:28.349Z","avatar_url":"https://github.com/YoubaImkf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authentication API\n\nA JWT Authentication Service API built with Go, Gin, and Gorm.\n\n## 🚀 Features\n\n- User registration and login\n- JWT-based authentication\n- Password reset via email\n- Token blacklisting for logout\n- Swagger documentation\n\n## 🛠️ Setup\n\n### Prerequisites\n\n- Docker\n- Docker Compose\n\n### Environment Variables\n\nCreate a `.env` file with the following content:\n\n```env\nAPP_ENVIRONMENT=development\nAPP_HOST=localhost:8080\n\n# Database configuration for PostgreSQL\nDATABASE_HOST=db # 'db' with docker-compose, 'localhost' if in local\nDATABASE_PORT=5432\nDATABASE_USER=root\nDATABASE_PASSWORD=root\nDATABASE_NAME=go-auth-db\n\n# SMTP configuration\nSMTP_HOST=smtp # 'smtp' with docker-compose, 'localhost' if in local\nSMTP_PORT=1025\nSMTP_USERNAME=\nSMTP_PASSWORD=\nSMTP_FROM=no-reply@example.com\n\n# JWT secret\nJWT_SECRET={secret}\n```\n\n### Configuration\n\nEdit `configs/config.yaml` to configure jwt and group settings.\n\n### Running the Application\n\n1. Build and run the application using Docker Compose:\n\n    ```sh\n    docker-compose up --build -d\n    ```\n\n2. Access the API at `http://localhost:8080`.\n\n3. Access the SMTP at `http://localhost:1080`.\n\n### Running Locally\n\nTo run the application locally without Docker:\n\n1. Ensure you updated the **docker-compose.yml** and **config.yml** files as comments suggest it !\n\n2. Generate the swagger documentation :\n\n    ```sh\n    swag inti -g cmd/api/main.go\n    ```\n    or \n    ```sh\n    swag init -d ./cmd/api/ --pdl 3\n    ```\n\n3. Ensure PostgreSQL and MailDev are running:\n\n    ```sh\n    docker-compose up db smtp -d\n    ```\n\n4. Run the application:\n\n    ```sh\n    go run cmd/api/main.go\n    ```\n\n### Swagger Documentation\n\nAccess the Swagger UI at `http://localhost:8080/swagger/index.html`.\n\n## 📚 API Endpoints\n\n### Auth\n\n- `POST /{UUID}/register` - Register a new user\n- `POST /{UUID}/login` - Authenticate a user\n- `POST /{UUID}/forgot-password` - Request a password reset\n- `POST /{UUID}/reset-password` - Reset the user's password\n- `POST /{UUID}/logout` - Logout a user (protected)\n- `GET /{UUID}/me` - Get user profile (protected)\n\n### Health\n\n- `GET /{UUID}/health` - Check the health of the service\n\n### USer\n\n- `GET /{UUID}/users` - Check the health of the service\n- `DELETE /{UUID}/remove-users` - Check the health of the service\n\n\n## 🧪 Running Tests\n\n1. To run tests, use the following command:\n\n    ```sh\n    go test ./test/service\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoubaimkf%2Fgo-auth-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoubaimkf%2Fgo-auth-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoubaimkf%2Fgo-auth-api/lists"}