Dear Diary is a simple notes web application built using Flask. Users can sign up, log in, and manage personal notes.
- User authentication (sign up, log in, log out)
- Create, view, and delete notes
- Responsive design using Bootstrap
- Python 3.x
- pip (Python package installer)
- Virtual environment (optional but recommended)
-
Clone the repository
git clone https://github.com/ybaweja04/Dear-Diary.git cd Dear-Diary
-
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: `venv\Scripts\activate`
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.env
file in the project root and add the following:SECRET_KEY=your_secret_key_here DATABASE_URI=sqlite:///database.db
-
Set up the database
flask shell >>> from yourapp import db >>> db.create_all() >>> exit()
-
Set the FLASK_APP environment variable
export FLASK_APP=main # On Windows: `set FLASK_APP=main`
-
Run the Flask development server
flask run
-
Visit
http://127.0.0.1:5000/
main.py
: Entry point for the applicationauth.py
: Handles authentication routesmodels.py
: Contains database modelsviews.py
: Contains main application routes__init__.py
: Initializes the Flask applicationtemplates/
: Contains HTML templatesstatic/
: Contains static files like CSS and JavaScript