{"id":28576142,"url":"https://github.com/haydenhargreaves/authenticationserver","last_synced_at":"2025-09-18T08:51:12.819Z","repository":{"id":197922793,"uuid":"697361212","full_name":"haydenhargreaves/AuthenticationServer","owner":"haydenhargreaves","description":"User authentication server built with the Gin framework, PostgreSQL database, and UUID-keys for user authentication.","archived":false,"fork":false,"pushed_at":"2024-02-24T18:47:15.000Z","size":273643,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"v2.0.0","last_synced_at":"2025-04-01T20:28:13.575Z","etag":null,"topics":["authentication","gin-gonic","golang","postgresql-database","user-authentication","user-management"],"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/haydenhargreaves.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":"2023-09-27T15:13:59.000Z","updated_at":"2024-04-03T06:22:16.000Z","dependencies_parsed_at":"2025-04-01T20:38:22.293Z","dependency_job_id":null,"html_url":"https://github.com/haydenhargreaves/AuthenticationServer","commit_stats":null,"previous_names":["azpect3120/authenticationserver","haydenhargreaves/authenticationserver"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhargreaves%2FAuthenticationServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhargreaves%2FAuthenticationServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhargreaves%2FAuthenticationServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhargreaves%2FAuthenticationServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haydenhargreaves","download_url":"https://codeload.github.com/haydenhargreaves/AuthenticationServer/tar.gz/refs/heads/v2.0.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhargreaves%2FAuthenticationServer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259166972,"owners_count":22815593,"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","gin-gonic","golang","postgresql-database","user-authentication","user-management"],"created_at":"2025-06-10T23:08:03.777Z","updated_at":"2025-09-18T08:51:07.752Z","avatar_url":"https://github.com/haydenhargreaves.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"Locked Server Image\" height=\"300\" src=\"./docs/server.png\" style=\"margin: 40px;\" /\u003e\n\n  [![GoLang](https://img.shields.io/badge/Go_1.21.5-white.svg?style=for-the-badge\u0026logo=Go)](https://go.dev/)\n  [![PostgreSQL](https://img.shields.io/badge/PostgreSQL-lightblue.svg?style=for-the-badge\u0026logo=postgresql)](https://www.postgresql.org/)\n  [![Gin Web Framework](https://img.shields.io/badge/gin-yellow.svg?style=for-the-badge\u0026logo=gin)](https://gin-gonic.com/)\n\n# Authentication Server Version 2.0.0\n\u003cp align=\"left\"\u003e\n  A simple user authentication server built with the Gin framework, PostgreSQL database, \n  and UUID-keys for user authentication. This server app is designed to authenticate \n  users using simple HTTP requests. It provides a secure and efficient way to verify \n  user identities and grant access to protected resources.\n\u003c/p\u003e\n\u003c/div\u003e\n\n## 🗝 Table of Contents\n-   [Features](#🗝-features)\n-   [Getting Started](#🗝-getting-started)\n    -   [Prerequisites](#prerequisites)\n    -   [Installation](#installation)\n    -   [Download Binary](#download-binary)\n    -   [Database](#database)\n-   [Usage](#🗝-usage)\n    -  [Overview](#overview)\n    -  [Applications](#applications)\n    -  [Users](#users)\n-   [Contributing](#🗝-contributing)\n-   [License](#🗝-license)\n\n## 🗝 Features\n-   **User Authentication**: Authenticate users using a unique UUID-key.\n-   **Application Management**: Create, read, update, and delete applications.\n-   **User Management**: Create, read, update, and delete user accounts.\n-   **Password Security**: Secure user passwords using a simple yet effective hashing algorithm.\n-   **Logging**: Log user and application activity to the stdout.\n\n## 🗝 Getting Started\nFollow these steps to get the project up and running on your local machine.\n\n### Prerequisites\n-   **Go** (+1.16)\n-   **PostgreSQL** database\n-   **Git** (optional)\n\n### Installation\n1.  Clone the repository to your local machine using the following command:\n```bash\ngit clone https://github.com/Azpect3120/AuthenticationServer.git \u0026\u0026 cd AuthenticationServer\n```\n\n2. Install the project dependencies using the following command:\n```bash\ngo mod tidy\n```\n\n3. Setup your PostgreSQL database and configure the database connection in the `.env` file:\n```.env\n# This url can found in the dashboard of most PSQL hosts or can be constructed using the required pieces\n# REQUIRED\nDB_URL=postgresql://username:password@localhost:5432/Database\n\n# The port the server will listen on. Default is 3000\n# OPTIONAL\nAUTH_SERVER_PORT=3000\n```\n\n4. Build and run the server:\n```bash\ngo build -o ./bin/server ./cmd/main.go \u0026\u0026 ./bin/server\n# or \ngo run ./cmd/main.go\n```\n\n### Download Binary\nIf you do not have Go installed on your machine, you can download the binary from the releases page.\nSelect the appropriate binary for your operating system and architecture, then run the binary in your terminal.\n\n### Database\nOnce the server is up and running you will need to connect to a PostgreSQL database.\nIf you would like the code to work out of the box, you may copy the database schema provided below.\n\n```sql \n-- UUID extension for use in creating and storing\n-- UUID value types\nCREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";\n\n-- Table for storing applications. The applications\n-- do not have any duplicate restraints beyond their\n-- id (uuid).\nCREATE TABLE IF NOT EXISTS applications (\n    id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),\n    name TEXT,\n    columns TEXT[],\n    createdat TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    lastupdatedat TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n\n-- Table for storing users. The users do not have any\n-- duplicate restraints beyond their id (uuid).\nCREATE TABLE IF NOT EXISTS users (\n    id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),\n    applicationid UUID REFERENCES applications(id),\n    username TEXT,\n    firstname TEXT,\n    lastname TEXT,\n    fullname TEXT,\n    email TEXT,\n    password TEXT,\n    data TEXT, -- Stringified JSON\n    createdat TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    lastupdatedat TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```\n\n## 🗝 Usage\n\n### Overview\nThe server is designed to be used as a simple RESTful API. It provides endpoints for creating, \nreading, updating, and deleting applications and users. The server also provides endpoints for \nauthenticating users and applications. The server logs user and application activity to the stdout.\nApplications are used to group users together and provide a way to manage user access to resources.\nThe owner of this server is responsible for managing applications and the data stored within them.\n\n\nThe data stored in the applications is dynamic and can be used to store the most common data as well \nas a wild card `data` field for custom data. Any data stored in the `data` field is expected to be \na string, which can be handled on the front end as needed, a stringified JSON object for example.\nThe server will not validate the data stored in the `data` field, it is up to the owner of the server\nto validate and parse the data as needed.\n\n**Valid data columns are:**\n-  `username` : The username of the user\n-  `first` : The first name of the user\n-  `last` : The last name of the user\n-  `full` : The full name of the user\n-  `email` : The email of the user\n-  `password` : The password of the user\n-  `data` : Wild card data field for custom data\n\nAll applications have a handful of default columns that cannot be removed and must be left as is.\nThese columns are: `id`, `applicationid`, `createdat`, and `lastupdatedat`. The `id` column is the \nunique identifier for the user. The `applicationid` column is the unique identifier for the application \nthe user is stored in. The `createdat` column is the timestamp of when the user was created. Finally, \nthe `lastupdatedat` column is the timestamp of when the user was last updated.\n\n### Applications\n\n- `GET /v2/applications` : Get all applications. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#get-all-applications)\n\n- `GET /v2/applications/:id` : Get an application by id. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#get-an-application)\n\n- `POST /v2/applications` : Create a new application. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#create-an-application)\n\n- `PATCH /v2/applications/:id` : Update part of an application by id. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#update-an-application-(part))\n\n- `PUT /v2/applications/:id` : Update an entire application by id. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#update-an-application-(full))\n\n- `DELETE /v2/applications/:id` : Delete an application by id. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#delete-an-application)\n\n### Users\n\n- `GET /v2/applications/:id/users` : Get all users in an application. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#get-all-users)\n\n- `GET /v2/applications/:id/users/:id` : Get a user by id in an application. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#get-a-user)\n\n- `POST /v2/applications/:id/users` : Create a new user in an application. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#create-a-user)\n\n- `POST v2/applications/:id/validate` : Validate a users credentials. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#validate-a-user)\n\n- `PATCH /v2/applications/:id/users/:id` : Update part of a user by id in an application. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#update-a-user)\n\n- `DELETE /v2/applications/:id/users/:id` : Delete a user by id in an application. [e.g](https://github.com/Azpect3120/AuthenticationServer/blob/v2.0.0/docs/exmaples.md#delete-a-user)\n\n\n## 🗝 Contributing\nThis project is open source, therefore contributions are encouraged! If you'd like to contribute to this project, please follow these steps:\n\n1. Fork the project.\n1. Create a new branch for your feature or bug fix.\n1. Make your changes.\n1. Test your changes thoroughly.\n1. Create a pull request.\n\n## 🗝 License\nThis project is licensed under azpect3120 the **MIT License**\n\nView [LICENSE](https://github.com/azpect3120/AuthenticationServer/blob/v2.0.0/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydenhargreaves%2Fauthenticationserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaydenhargreaves%2Fauthenticationserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydenhargreaves%2Fauthenticationserver/lists"}