demo.mp4
GateGPT is an open source solution designed to enhance the capabilities of CustomGPT applications by providing secure and simplified user authentication. With GateGPT, developers can easily integrate Google OAuth, allowing for a streamlined user login experience and access to insightful analytics.
- Google OAuth Integration: Secure your application by enabling users to sign in through Google.
- Simple Integration: Integrate GateGPT into your application quickly with minimal setup.
- Analytics Dashboard: Monitor and analyze user activity with a comprehensive dashboard.
- Extensible: Designed with extensibility in mind, allowing for future feature integration and customization.
- Rye
- uvicorn
- FastAPI
- PostgreSQL
- Docker
- Render
- Jinja2
This project utilizes the Rye package manager for dependency management. Ensure that you have Rye installed before proceeding.
-
Clone the repository:
git clone https://github.com/yourusername/custom-gpts-paywall.git cd custom-gpts-paywall
-
Install project dependencies using Rye:
rye sync
-
Create a copy of the environment variable template file:
cp .env.template .env
-
Edit the
.env
file and set the required environment variables according to your configuration.
#Required Variables
- DATABASE_URL
- DOMAIN_NAME
- GOOGLE_OAUTH_CLIENT_ID
- GOOGLE_OAUTH_CLIENT_SECRET
- SECRET_KEY
- OAUTH_REDIRECT_URI_HOST - to validate redirect uri. Should be set to `https://chat.openai.com` in production
# Optional Variables
- DEBUG - set to 1 to enable debug logging and reload
- LOG_LEVEL - control the log level
- SENTRY_DSN - to enable SENTRY for error tracking
You can run the project both with and without Docker.
-
Set the database URL in the
.env
file to point to your PostgreSQL instance. -
Start the development server:
rye run dev
-
Build and start the Docker containers:
rye run docker-run
** Note: You might need to run migrations before able to use this project
-
To upgrade the database to the latest version:
rye run docker-upgrade head
-
To downgrade database the:
rye run docker-downgrade base
-
To create a new migration revision:
rye run docker-revision
-
To upgrade the database to the latest version:
rye run upgrade head
-
To downgrade the database:
rye run downgrade base
-
To create a new migration revision:
rye run revision
Set up pre-commit hooks to automatically check your code for linting and formatting issues. Run the following command to install pre-commit hooks:
rye run pre-commit install
This project uses Ruff for code formatting and linting. Use the following commands to format and lint your code:
-
Format code:
rye run format
-
Check for linting issues:
rye run lint
For more information, refer to the Ruff documentation.
You can access the OpenAPI specifications for this project using the following endpoints:
- Swagger UI: [/docs]
- ReDoc: [/redoc]
- OpenAPI JSON: [/openapi.json]
We welcome contributions from the community! If you're looking to contribute, please ensure you have pre-commit hooks set up to maintain code quality with proper linting and formatting rules. To get started:
- Fork the repository.
- Set up pre-commit hooks.
- Create a new branch for your feature or fix.
- Commit your changes with clear, descriptive messages.
- Push your branch and open a pull request.
We look forward to your pull requests and are excited to see how you can help improve GateGPT!