Skip to content

Yessir11/yessir_hw2_itmo_wad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

User Profile Management with Flask and MongoDB

Project Description

This Flask-based web application allows users to register, log in, update their profile information (city, profession, and profile picture), change passwords, and log out. The application uses MongoDB as the database and supports secure password hashing with bcrypt.

Features

  • User authentication (registration, login, logout)
  • Profile update (city, profession, and profile picture)
  • Secure password storage using bcrypt
  • Session-based authentication
  • Flash messages for user feedback

Installation and Setup

Prerequisites

Ensure you have the following installed on your system:

  • Python 3
  • MongoDB
  • pip (Python package manager)

Clone the Repository

git clone https://github.com/Yessir11/yessir_hw2_itmo_wad.git
cd yessir_hw2_itmo_wad

Create a Virtual Environment (Recommended)

python -m venv venv
source venv/bin/activate  # On macOS/Linux
venv\Scripts\activate    # On Windows

Required Python Libraries

This project requires the following Python libraries:

Flask
pymongo
bcrypt
Werkzeug

To install manually, run:

pip install Flask pymongo bcrypt Werkzeug

Setting Up MongoDB

  1. Connect to MongoDB shell:
    mongo
  2. Create the database and collection:
    use itmo_wad_hw2
    db.createCollection("users")

Running the Application

python3 app.py

The application will run on http://localhost:5000/

Folder Structure

flask-profile-management/
│── static/
│   ├── styles.css
│   ├── uploads/  # Folder for user profile pictures
│── templates/
│   ├── login.html
│   ├── registration.html
│   ├── profile.html
│   ├── updateInfo.html
│── app.py
│── README.md

Routes and Endpoints

Capture d’écran 2025-02-17 à 02 44 47

Additional Notes

  • User passwords are securely hashed using bcrypt.
  • Default profile pictures are used if users do not upload one.
  • Users can update either one or both profile fields (city and profession) independently.
  • The UPLOAD_FOLDER is set to static/uploads to store profile pictures.

Screenshots

Login page Capture d’écran 2025-02-17 à 02 48 02

Registration Page

Capture d’écran 2025-02-17 à 02 48 46

Authentication of the created user

Capture d’écran 2025-02-17 à 02 49 37

Database

Capture d’écran 2025-02-17 à 02 50 31

Profile Page

Capture d’écran 2025-02-17 à 02 51 21

Edit User Information and upload photo

Capture d’écran 2025-02-17 à 02 53 12

Information Updated

Capture d’écran 2025-02-17 à 02 53 45

Password Changed

Capture d’écran 2025-02-17 à 02 55 49

For any issues or improvements, feel free to contribute!


Contributor

Yessir GOUTON

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published