This is a simple ToDo application built with Flask as the backend framework and MongoDB as the database. The application supports JWT token validation for user authentication and includes basic CRUD operations for managing ToDo items.
- User authentication with JWT
- Create, read, update, and delete ToDo items
- JWT token validation middleware
- Flask
- MongoDB
- PyMongo
- Flask-JWT-Extended
- Docker
- Python 3.9 or later
- Docker
-
Clone the repository:
git clone flask-app cd flask-app
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On MacOS/Linux:
source venv/bin/activate
- On Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables in
config.py
:import os class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'your_secret_key' MONGO_URI = os.environ.get('MONGO_URI') or 'mongodb+srv://flask-app:flask@flask.xv7avzt.mongodb.net/?retryWrites=true&w=majority&appName=flask'
-
Run the application:
flask run
-
Access the application: Open your web browser and go to
http://localhost:5000
.
-
Clone the repository:
git clone flask-app cd flask-app
-
Build the Docker image:
docker build -t flask-app .
-
Run the Docker container, passing environment variables:
docker run -e SECRET_KEY=your_secret_key -e MONGO_URI='mongodb+srv://flask-app:flask@flask.xv7avzt.mongodb.net/?retryWrites=true&w=majority&appName=flask' -p 5000:5000 flask-app
-
Access the application: Open your web browser and go to
http://localhost:5000
.
Access the application in your web browser at Flask app Postman Collection.