{"id":24560701,"url":"https://github.com/georgekhananaev/pynextstack","last_synced_at":"2025-10-15T13:28:28.276Z","repository":{"id":230634297,"uuid":"779836444","full_name":"georgekhananaev/PyNextStack","owner":"georgekhananaev","description":"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)","archived":false,"fork":false,"pushed_at":"2025-05-03T20:08:22.000Z","size":731,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T21:19:20.423Z","etag":null,"topics":["ai","asynchronous","full-stack","gpt-3","gpt-4","jwt-authentication","mongodb","nextjs","python","python3","react","reactjs","redis","redis-cache","redis-server","smtp-client"],"latest_commit_sha":null,"homepage":"https://demo-pynextstack.reactatomics.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgekhananaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-30T23:08:25.000Z","updated_at":"2025-05-03T20:08:25.000Z","dependencies_parsed_at":"2024-03-31T02:21:27.167Z","dependency_job_id":"65a30b0b-b144-43cb-ac6c-3564783cb68d","html_url":"https://github.com/georgekhananaev/PyNextStack","commit_stats":null,"previous_names":["georgekhananaev/pynextstack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/georgekhananaev/PyNextStack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgekhananaev%2FPyNextStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgekhananaev%2FPyNextStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgekhananaev%2FPyNextStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgekhananaev%2FPyNextStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgekhananaev","download_url":"https://codeload.github.com/georgekhananaev/PyNextStack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgekhananaev%2FPyNextStack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279082953,"owners_count":26099529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","asynchronous","full-stack","gpt-3","gpt-4","jwt-authentication","mongodb","nextjs","python","python3","react","reactjs","redis","redis-cache","redis-server","smtp-client"],"created_at":"2025-01-23T07:17:40.023Z","updated_at":"2025-10-15T13:28:28.270Z","avatar_url":"https://github.com/georgekhananaev.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/georgekhananaev"],"categories":[],"sub_categories":[],"readme":"# PyNextStack: A Full-Stack User Management System with FastAPI, Next.js, and MUI\n\n### DEMO: [https://demo-pynextstack.reactatomics.com](https://demo-pynextstack.reactatomics.com)\n\n```\nUsername: root\nPassword: bringthemhome\n```\n\n⚡️ **Looking for a fully serverless solution built with Next.js (no Python needed)?**  \nCheck out my **Modern Auth** template — simple, secure, and production-ready.  \n🔗 [github.com/georgekhananaev/modern-auth](https://github.com/georgekhananaev/modern-auth)\n\nFor 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.\n\nPlease 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.\n\n## Overview\n\nPyNextStack 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.\n\n## Key Features\n\n### Security\n- **JWT Authentication**: Secure authentication mechanism using JWT to ensure that user actions are verified and secure.\n- **Protected API Documentation**: Access to API documentation is restricted, requiring authentication to prevent unauthorized use.\n- **Rate Limiting**: Defense against brute force attacks by limiting the number of login attempts.\n- **Data Encryption**: Encryption techniques are employed to securely store user data.\n\n### User Management\n- **Registration and Login**: Efficient and secure processes for user registration and login.\n- **Profile Management**: Enables users to update their profiles and manage account settings.\n\n### Interactivity and Notifications\n- **ChatGPT Integration**: Enhances user engagement with AI-driven chat support.\n- **Email Notifications**: Sends automated emails for actions such as registration and password resets using SMTP.\n\n### Frontend Experience\n- **Next.js and MUI**: A modern, responsive UI built with Next.js and Material-UI for a seamless user experience.\n- **Responsive Design**: Ensures a consistent experience across various devices and screen sizes.\n\n### Performance and Scalability\n- **Asynchronous Support**: Utilizes FastAPI's async features for efficient performance.\n- **Scalable Architecture**: Designed to handle growth in users and data smoothly.\n\n### Logging and Monitoring\n- **Comprehensive Logging**: Detailed logging for user actions, system events, and errors.\n- **Real-Time Monitoring**: Tools and practices in place for monitoring application performance in real-time.\n\n## Technologies Used\n\n- **FastAPI**: For building the high-performance API backend.\n- **Next.js**: The React framework for building the frontend.\n- **Material-UI (MUI)**: For designing the frontend with React UI components.\n- **MongoDB**: As the NoSQL database for user data.\n- **Redis**: For rate limiting and JWT token management.\n- **Docker**: For containerizing and deploying the application.\n- **Python-JOSE**: A library for JWT operations.\n- **SMTP Libraries**: For sending automated email notifications.\n\n## Getting Started\n\n### Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- **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](https://docs.docker.com/get-docker/).\n\n- **Python**: The project requires the latest version of Python for certain local scripts and integrations. To install Python, visit the [official Python website](https://www.python.org/downloads/) 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.\n\n## Installation\nOnce 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.\n\n**You can watch this:**\n[![IMAGE ALT TEXT HERE](/screenshots/youtube.png)](https://youtu.be/H2oYT-Ame9w)\n\n### Clone the Repository\n```shell\ngit clone https://github.com/georgekhananaev/PyNextStack\n```\n\n### Docker Installation for Full Deployment (4 Containers)\n1. Create \"chatgpt_credentials.env\" file or revise the code in \"generate_env.py\".\n\n* Example of chatgpt_credentials.env:\n    ```\n    open_ai_organization=org-your_openai_key\n    open_ai_secret_key=sk-your_openai_key\n    ```\n\n2. Run the Installation.\n\n* PowerShell / Linux (Option 1)\n    ```shell\n    python generate_env.py ; docker-compose build --no-cache ; docker-compose up -d\n    ``` \n* CMD (Option 2)\n    ```shell\n    python generate_env.py \u0026\u0026 docker-compose build --no-cache \u0026\u0026 docker-compose up -d\n    ```\n* Manual (Option 3)\n    ```shell\n    python generate_env.py\n    ```\n    ```shell\n    docker-compose build --no-cache\n    ```\n    ```shell\n    docker-compose up -d\n    ```\n\n## Uninstall\n\n```shell\ndocker-compose down -v\n```\n\n### If you want to start just the backend (FastAPI)\nJust the FastAPI server. You must start MongoDB server, Redis server first. Change the username and password URI in the .env file above.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCreate a .env File or Run `python generate_env.py`\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```text\n# mongodb connection\nmongodb_server=localhost\nmongodb_port=27017\nmongodb_username=bringthemhome\nmongodb_password=bringthemhome\n\n# fastapi\nfastapi_ui_username=bringthemhome\nfastapi_ui_password=bringthemhome\njwt_secret_key=bringthemhome\nstatic_bearer_secret_key=bringthemhome\nalgorithm=HS256\n\n# chatgpt\nopen_ai_organization=org-your_openai_key\nopen_ai_secret_key=sk-your_openai_key\n\n# default root user\nowner_username=root\nowner_password=bringthemhome\nowner_email=israel@israeli.com\n\n# Initial email settings located in app/components/initial settings.py\n```\n\nPlease note: MongoDB URI should be \"localhost\" if you're running it locally, or \"mongodb\" if you're running it inside a Docker container.\n\u003c/p\u003e\n\u003c/details\u003e\n\n* Update PIP \u0026\u0026 Install requirements.txt\n    ```shell\n    python.exe -m pip install --upgrade pip\n    ```\n    ```shell\n    pip install -r requirements.txt\n    ```\n\n* Start FastAPI server with Uvicorn\n    ```shell\n    uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload\n    ```\n\n### If you want to run the frontend (Next.js)\nYou need to have Node.js installed on your machine.\nVisit https://nodejs.org/ to download and install the latest version.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCreate a .env File If Necessary; Otherwise, Default Settings Are Loaded\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n```text\n# Set the URL for your backend here\nNEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1\n\n# The default value is 'bringthemhome'. Ensure this matches the 'static_bearer_secret_key' set in your backend.\nNEXT_PUBLIC_API_KEY=static_bearer_secret_key\n```\n\nPlease 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\".\n\u003c/p\u003e\n\u003c/details\u003e\n\n* \u003cb\u003eFor Development:\u003c/b\u003e\n    ```shell\n    npm install\n    ```\n    ```shell\n    npm run dev\n    ```\n\n* \u003cb\u003eFor Production:\u003c/b\u003e\n    ```shell\n    npm run build\n    ```\n    ```shell\n    npm start\n    ```\n\n## Usage\n\n- Frontend: [http://localhost:3000](http://localhost:3000)\n  ```\n  Username: root\n  Password: bringthemhome\n  ```\n* 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.\n* 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.\n  ```\n  Username: bringthemhome\n  Password: bringthemhome\n  ```\n\n## Security Practices\nThis application implements advanced security practices including password hashing, token validation, rate limiting, and secure API documentation access.\n\n## License\nThis project is licensed under the MIT License - see the LICENSE.md file for details.\n\n## Credits\n- Developed by George Khananaev.\n- Thanks to the FastAPI, MongoDB, Redis, and Docker communities for support and resources.\n\n## Additional Requests\n\nIf 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.\n\n## Goals\n\n**Upon reaching 100 stars, the project will incorporate the following features:**\n\n1. Firebase authentication support will be integrated.\n2. Two-Factor Authentication will be implemented.\n3. SMS and WhatsApp support will be added to the backend with TWILIO.\n4. File handling capabilities, utilizing either Google Storage or AWS.\n5. Enhanced email handling, including functionalities such as Inbox, Outgoing, Draft, etc.\n\n## Support Me\n\nIf you find my work helpful, consider supporting me by buying me a coffee at [Buy Me A Coffee](https://www.buymeacoffee.com/georgekhananaev).\n\nYour support helps me continue to create and maintain useful projects.\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/georgekhananaev)\n\nThank you!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgekhananaev%2Fpynextstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgekhananaev%2Fpynextstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgekhananaev%2Fpynextstack/lists"}