This is a simple authentication example using FastAPI and NiceGUI. It stores session IDs in memory and does not involve password hashing. This example is meant for demonstration purposes and may not be suitable for production use. For a more robust authentication system, consider implementing OAuth2 or using the Authlib package.
- Clone the repository:
git clone https://github.com/RJohnPaul/NiceGUI_Starter.git
cd NiceguiSimpleAdminPanel
- Install the required dependencies:
pip install -r requirements.txt
- Set up your own secret key:
export MY_SECRET_KEY=<your_secret_key>
- FastAPI: A modern, fast (high-performance), web framework for building APIs with Python.
- NiceGUI: A Python library for creating beautiful and interactive user interfaces.
- Uvicorn: ASGI server that powers FastAPI.
Run the following command to start the FastAPI application:
uvicorn main:ui --reload
The application will be accessible at http://127.0.0.1:8000
.
- Main Page: Displays a welcome message and navigation tabs.
- Login Page: A stylish login page with a glassmorphic design.
- Logout Page: Allows users to log out and redirects to the login page.
- Open the application in your web browser.
- Navigate to the login page.
- Enter valid credentials (e.g., username:
system
, password:sys
). - Upon successful login, you will be redirected to the main page.
- To log out, click the "Log out" button.
Feel free to customize the code and design according to your needs.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License.