PyNextStack
Next.Js, FastAPI a Full-Stack User Management System designed to facilitate comprehensive user management, including registration, authentication, and profile management. At its core, it leverages FastAPI for the backend operations, ensuring secure and efficient data handling. The frontend is built with Next.js and Material-UI (MUI)
Install / Use
/learn @georgekhananaev/PyNextStackREADME
PyNextStack: A Full-Stack User Management System with FastAPI, Next.js, and MUI
DEMO: https://demo-pynextstack.reactatomics.com
Username: root
Password: bringthemhome
⚡️ Looking for a fully serverless solution built with Next.js (no Python needed)?
Check out my Modern Auth template — simple, secure, and production-ready.
🔗 github.com/georgekhananaev/modern-auth
For the DEMO, only one root user can be logged in at a time. Therefore, it is recommended to register your own user first and then promptly log in as the root user to change your role. Otherwise, you might cause each other to be disconnected while trying the demo.
Please note that in the demo version, ChatGPT will not function as it is not connected to the API. Additionally, you have the option to modify the SMTP settings to suit your needs for testing the forgot-password functionality. It has been successfully tested with GMAIL. Later on, I will disable the edit functionality and add my own SMTP settings for your testing convenience.
Overview
PyNextStack is a full-stack system utilizing FastAPI with asynchronous capabilities on the backend and Next.js for the frontend, showcasing the robustness of Python in server-side development. This architecture provides a scalable, efficient solution that leverages FastAPI's high performance and ease of use for creating APIs, alongside Next.js for a reactive and server-side rendered user interface. The asynchronous nature of the backend ensures non-blocking operation, enhancing the system's ability to handle high volumes of requests simultaneously, which is ideal for real-time applications. This combination offers a modern, full-stack framework that is both powerful and developer-friendly, demonstrating the versatility of Python in web development.
Key Features
Security
- JWT Authentication: Secure authentication mechanism using JWT to ensure that user actions are verified and secure.
- Protected API Documentation: Access to API documentation is restricted, requiring authentication to prevent unauthorized use.
- Rate Limiting: Defense against brute force attacks by limiting the number of login attempts.
- Data Encryption: Encryption techniques are employed to securely store user data.
User Management
- Registration and Login: Efficient and secure processes for user registration and login.
- Profile Management: Enables users to update their profiles and manage account settings.
Interactivity and Notifications
- ChatGPT Integration: Enhances user engagement with AI-driven chat support.
- Email Notifications: Sends automated emails for actions such as registration and password resets using SMTP.
Frontend Experience
- Next.js and MUI: A modern, responsive UI built with Next.js and Material-UI for a seamless user experience.
- Responsive Design: Ensures a consistent experience across various devices and screen sizes.
Performance and Scalability
- Asynchronous Support: Utilizes FastAPI's async features for efficient performance.
- Scalable Architecture: Designed to handle growth in users and data smoothly.
Logging and Monitoring
- Comprehensive Logging: Detailed logging for user actions, system events, and errors.
- Real-Time Monitoring: Tools and practices in place for monitoring application performance in real-time.
Technologies Used
- FastAPI: For building the high-performance API backend.
- Next.js: The React framework for building the frontend.
- Material-UI (MUI): For designing the frontend with React UI components.
- MongoDB: As the NoSQL database for user data.
- Redis: For rate limiting and JWT token management.
- Docker: For containerizing and deploying the application.
- Python-JOSE: A library for JWT operations.
- SMTP Libraries: For sending automated email notifications.
Getting Started
Prerequisites
Before you begin, ensure you have met the following requirements:
-
Docker: This project is containerized with Docker, making it necessary to have Docker Desktop (for Windows or Mac) or Docker Engine (for Linux) installed on your system. To install Docker, follow the instructions on the official Docker website.
-
Python: The project requires the latest version of Python for certain local scripts and integrations. To install Python, visit the official Python website and download the latest version for your operating system. Ensure that Python is properly added to your system's PATH to allow for command-line execution.
Installation
Once you have Docker and Python installed, you're ready to proceed with the project setup. The next sections will guide you through configuring your development environment, running the project with Docker, and executing any necessary Python scripts or commands.
Clone the Repository
git clone https://github.com/georgekhananaev/PyNextStack
Docker Installation for Full Deployment (4 Containers)
- Create "chatgpt_credentials.env" file or revise the code in "generate_env.py".
- Example of chatgpt_credentials.env:
open_ai_organization=org-your_openai_key open_ai_secret_key=sk-your_openai_key
- Run the Installation.
- PowerShell / Linux (Option 1)
python generate_env.py ; docker-compose build --no-cache ; docker-compose up -d - CMD (Option 2)
python generate_env.py && docker-compose build --no-cache && docker-compose up -d - Manual (Option 3)
python generate_env.pydocker-compose build --no-cachedocker-compose up -d
Uninstall
docker-compose down -v
If you want to start just the backend (FastAPI)
Just the FastAPI server. You must start MongoDB server, Redis server first. Change the username and password URI in the .env file above.
<details> <summary><b>Create a .env File or Run `python generate_env.py`</b></summary> <p># mongodb connection
mongodb_server=localhost
mongodb_port=27017
mongodb_username=bringthemhome
mongodb_password=bringthemhome
# fastapi
fastapi_ui_username=bringthemhome
fastapi_ui_password=bringthemhome
jwt_secret_key=bringthemhome
static_bearer_secret_key=bringthemhome
algorithm=HS256
# chatgpt
open_ai_organization=org-your_openai_key
open_ai_secret_key=sk-your_openai_key
# default root user
owner_username=root
owner_password=bringthemhome
owner_email=israel@israeli.com
# Initial email settings located in app/components/initial settings.py
Please note: MongoDB URI should be "localhost" if you're running it locally, or "mongodb" if you're running it inside a Docker container.
</p> </details>-
Update PIP && Install requirements.txt
python.exe -m pip install --upgrade pippip install -r requirements.txt -
Start FastAPI server with Uvicorn
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
If you want to run the frontend (Next.js)
You need to have Node.js installed on your machine. Visit https://nodejs.org/ to download and install the latest version.
<details> <summary><b>Create a .env File If Necessary; Otherwise, Default Settings Are Loaded</b></summary> <p># Set the URL for your backend here
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1
# The default value is 'bringthemhome'. Ensure this matches the 'static_bearer_secret_key' set in your backend.
NEXT_PUBLIC_API_KEY=static_bearer_secret_key
Please note: If you are running MongoDB locally, the URI should be set to "localhost". If you are running MongoDB inside a Docker container, the URI should be set to "mongodb".
</p> </details>-
<b>For Development:</b>
npm installnpm run dev -
<b>For Production:</b>
npm run buildnpm start
Usage
- Frontend: http://localhost:3000
Username: root Password: bringthemhome
- Access the API documentation at http://localhost:8000/docs. You can obtain a token by entering your username and password from the text box above.
- Please note that the Swagger UI is also password-protected, and it will temporarily block access if the password is entered incorrectly more than five times, for a duration of five minutes.
Username: bringthemhome Password: bringthemhome
Security Practices
This application implements advanced security practices including password hashing, token validation, rate limiting, and secure API documentation access.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Credits
- Developed by George Khananaev.
- Thanks to the FastAPI, MongoDB, Redis, and Docker communities for support and resources.
Additional Requests
If you have ideas on how we can grow it into something greater, please share your suggestions. Additionally, if you have any special requests or unique features you'd like to see implemented, feel free to include those as well.
Goals
Upon reaching 100 stars, the project will incorporate the following features:
- Firebase authentication support will be integrated.
- Two-Factor Authentication will be implemented.
- SMS and WhatsApp support will be added to the backend with TWILIO.
- File handling capabilities, utilizing either Google Storage or AWS.
- Enhanced email handling, including functionalities such as Inbox, Outgoing, Draft, etc.
Support Me
If you find my work helpful, consider supporting me by buying me a coffee at [Buy Me A Coffee](https://ww
Related Skills
bluebubbles
349.9kUse when you need to send or manage iMessages via BlueBubbles (recommended iMessage integration). Calls go through the generic message tool with channel="bluebubbles".
slack
349.9kUse when you need to control Slack from OpenClaw via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.
claude-opus-4-5-migration
109.8kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

