This project includes a Go-based authentication system using Google OAuth.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Go 1.16 or higher
- Docker
- Make
-
Clone the repository:
git clone https://github.com/Deadends/goAuth cd goAuth -
Create a
.envfile in theinternal/authdirectory with the following content:GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret
-
Install dependencies:
go mod tidy
We can use the Go make module to run the application, or you can run it manually. For example:
cd goAuth/cmd/api
go run main.goCheck your path before running.
For the frontend, we use React.js with Vite. To spin up the frontend:
cd goAuth/client
npm install # Helps to install all required packages
npm run dev- Open your browser and navigate to
http://localhost:5173. - Click on the "Log in with Google" link.
- After successful authentication, you will be redirected to the frontend with user details.
To deploy the project on a live system, follow these steps:
- Set up your environment variables for
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. - Build and run the application using Docker or your preferred method.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Goth for OAuth authentication
- Chi for the router
- Gorilla Sessions for session management
- Go Blueprint for project structure and best practices
- React.js and Vite for the frontend setup
We are excited to announce that future releases of goAuth will include integration with Keycloak, a powerful open-source identity and access management solution. Stay tuned for future updates and enhancements!