Skip to content

theritikbarnwal/cloudmaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 CloudMaster – Flask Login System with MongoDB & Sessions

A clean and minimalistic authentication system built using Flask and MongoDB, implementing:

  • 💼 User registration
  • 🔑 Session-based login
  • 🔄 Password reset flow
  • 🔐 Secure password hashing
  • 🔓 Logout functionality

All powered by a simple Flask backend and organized with modular routes and secure practices.


🧰 Technology Stack

  • Flask – Lightweight Python web framework
  • MongoDB – NoSQL database accessed via pymongo
  • bcrypt – Secure password hashing
  • Flask sessions – Manages authentication state
  • dotenv – Secure environment variable configuration
  • Jinja2 + HTML – Server-side templates for UI

🗂️ Project Structure


login\_db/
├── app.py                    # Main Flask application
├── .env                      # Environment variables (e.g., MONGO\_URI, SECRET\_KEY)
├── requirements.txt          # Dependencies
└── templates/                # HTML templates
├── register.html
├── login.html
├── forgot.html
├── reset.html
└── dashboard.html
└── README.md


🚀 Features

1. Registration

  • Securely stores unique users with bcrypt-hashed passwords in MongoDB.

2. Login

  • Session-based login using Flask’s secure session management.

3. Forgot + Reset Password

  • Username-based password reset flow with automatic bcrypt hashing.

4. Secure Environment Variables

  • Uses .env for database credentials and secret keys.

🛠️ Why I Built This

I wanted a clean, modular login backend to use as a foundation for other projects or CI/CD pipelines. This is a learning exercise to:

  • Learn Flask session management
  • Securely handle authentication workflows
  • Structure backend routes cleanly and maintainably :contentReference[oaicite:1]{index=1}

⚙️ How to Run Locally

git clone https://github.com/theritikbarnwal/cloudmaster.git
cd DevOps/cloudmaster

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Create a .env file with MONGO_URI and SECRET_KEY

python app.py

✅ What I Learned

  • 🛡️ Secure password storage with bcrypt
  • 🔗 Flask sessions to maintain login state
  • 🗂️ Route structure for login, registration, and password reset
  • 🔐 Using environment variables responsibly with dotenv
  • 🗃️ Basic MongoDB interactions using pymongo

🚀 Next Steps

  • Integrate an email-based password reset flow
  • Package and Dockerize the app
  • Add CI/CD pipeline (e.g., GitHub Actions)
  • Deploy to a cloud platform (Railway or Render)

📚 References

  • Original Dev.to article: Building a Clean Flask Login System with MongoDB, Sessions, and Password Reset (dev.to)

🤝 Feedback & Collaboration

If you have suggestions—whether for the password reset flow, route structure, or Dockerization—feel free to open an issue or pull request. Always open to learning and improving!


---

### ✅ Why This Works:
- 🎯 **Clarity**: Highlights what the project does, why it matters, and how to run it.
- 🛠 **Tech Stack**: Lists all tools and frameworks used.
- 🧩 **Modular Structure**: Shows readers how the project is organized.
- 🔄 **Future Improvements**: Indicates your roadmap and ambition.

Feel free to adjust any section or add images, screenshots, or badges.
::contentReference[oaicite:13]{index=13}

About

Flask-based authentication system using MongoDB with session-based login, password reset flow, and secure password hashing, designed as a modular backend foundation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors