A Streamlit-based web application for managing access to DreamFactory APIs. This portal allows administrators to manage API access requests and users to request and view their API access.
- User registration and authentication
- API access request system
- Admin approval workflow
- Automatic role and API key provisioning
- Interactive API documentation with Swagger UI
- Portal customization options
- Python 3.7+
- DreamFactory instance with admin access
- SQLite (included with Python)
- Clone the repository:
git clone https://github.com/dreamfactorysoftware/df-streamlit.git
cd df-streamlit
- Install required packages:
pip install -r requirements.txt
- Create a
.streamlit/secrets.toml
file and add your DreamFactory URL and admin API key:
dreamfactory_url = "your_dreamfactory_instance_url"
admin_api_key = "your_dreamfactory_admin_api_key"
- Run the application:
streamlit run streamlit_app.py
- On first run, you'll be prompted to create a super admin account
- Log in with the created super admin credentials
- Use the admin panel to:
- Configure portal appearance
- Manage users and admins
- Handle API access requests
- Approve or deny API access requests
- Manage users and their permissions
- Configure portal appearance
- Monitor API usage
- View users with access to each API
- Revoke access when needed
- Request access to available APIs
- View granted API access details
- Access interactive API documentation
- Test API endpoints directly from the portal
- View their API keys and endpoints
- Preview data before requesting access
-
Obtain your DreamFactory instance URL (without http:// or https://)
-
Get your admin API key:
- Log into DreamFactory admin console
- Go to System > Roles > Admin
- Copy the API Key
-
Configure services in DreamFactory:
- Set up your database services
- Configure file storage services
- Set appropriate security settings
- Store your
secrets.toml
securely and never commit it to version control - Use strong passwords for admin accounts
- Regularly review API access permissions
- Monitor the access logs in DreamFactory
- Revoke access for inactive users
- Keep your DreamFactory instance updated
Common issues and solutions:
-
Connection Issues:
- Verify DreamFactory URL is correct (no http:// or https://)
- Check admin API key is valid
- Ensure DreamFactory instance is accessible
-
Access Problems:
- Verify user permissions
- Check role configurations
- Review API key status
-
Database Issues:
- Delete
dreamfactory_access.db
to reset the application - Restart the application to recreate tables
- Delete
-
API Access Issues:
- Ensure services are properly configured in DreamFactory
- Check service permissions in DreamFactory
- Verify API keys are active
To contribute to the development:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Guidelines:
- Follow Python PEP 8 style guide
- Add tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- For portal issues: Create an issue in the GitHub repository
- For DreamFactory questions: Visit DreamFactory Forums
- For security concerns: Contact [email protected]
- DreamFactory team and community
- Streamlit framework developers
- All contributors to this project
You can run the DreamFactory Access Portal using Docker:
- Create a
.streamlit/secrets.toml
file with your DreamFactory credentials:
dreamfactory_url = "your_dreamfactory_instance_url"
admin_api_key = "your_dreamfactory_admin_api_key"
- Run with Docker Compose:
docker-compose up --build
- Access the portal at
http://localhost:8501
- Build the Docker image:
docker build -t dreamfactory-portal .
- Run the container:
docker run -p 8501:8501 -v ~/.streamlit:/app/.streamlit dreamfactory-portal
- The application runs on port 8501 by default
- The container uses a non-root user for security
- The SQLite database persists in the container
- Secrets are mounted from your local
.streamlit
directory - The container automatically pulls the latest code from GitHub during build
-
Permission Issues:
- Ensure your
.streamlit
directory has proper permissions - Check that secrets.toml is readable by the container
- Ensure your
-
Port Conflicts:
- If port 8501 is in use, modify the port mapping in docker-compose.yml
- Example:
"8502:8501"
to use port 8502 on the host
-
Container Access:
- Use
docker logs dreamfactory-portal
to view application logs - Use
docker exec -it dreamfactory-portal bash
to access the container shell
- Use
-
Volume Mounts:
- Ensure your ~/.streamlit directory exists
- Check that secrets.toml is properly mounted