StudyMate is a platform designed to assist students in efficiently organizing their study routines, setting study goals, and monitoring their academic progress. This Flask application incorporates user authentication, allowing users to register, log in, and manage their study items. Users can view their completed study items, add new ones, edit existing ones, mark them as done, and delete them.
The application utilizes Flask for web development, Flask-SQLAlchemy for database management, Flask-Login for user authentication, and Werkzeug for password hashing.
The application has three tables in the database study_items.db
:
Table Name: User
- id Integer, Primary Key
- username: Unique, Not Null
- email: Unique, Not Null
- password: Not Null (hashed password)
- tasks: Relationship with Task Table (One-to-Many)
Table Name: Task
- id Integer, Primary Key
- task Not Null
- user_id: Integer, Foreign Key referencing User Table
- tag_id: Relationship with Tag Table (Many-to-one)
Table Name: Tag
- id Integer, Primary Key
- name Not Null
The tables uses a system where each user (from the User table) can have multiple tasks associated with them (in the Task table) and multiple tasks to one category(in the Tag table).
- User Registration and Authentication: Users can register for an account and securely log in to access their study items.
- Study Item Management: Users can view, add, edit, mark as completed, and delete study items.
- Categorization: Study items can be categorized by subject for easy organization.
- Filtering: Users can filter their views based on study item categories.
- Progress Tracking: Users have an overview of completed study goals, providing insight into their academic achievements.
- Paging View: The initial 5 study items are displayed on the study item page, with the remaining items shown in next pages format for improved user experience.
The Studymate app uses Flask, SQLAlchemy and werkzeug.security
- The application logic is in app.py
- The code for managing the database is in the /instance folder.
- The html files are in /templates folder
- The stylesheets are in /static folder
- The requirements are in requirements.txt
- Python
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/tobiloba7/StudyMate cd studymate
-
Install the dependencies using pip:
pip install -r requirements.txt
- Run the Flask app: Start the application in debug mode by running:
flask --debug run
- Open your browser and go to [http://localhost:5000]
These are the routes that app.py serves:
- '/' is the index route, and it shows the study items
- '/login' is the route to login to the app. When a user logins they are directed to the add item page
- '/register' is the registration route for new users. Users are redirected to the login page after registering.
- '/logout' is the route to log out
Task routes:
- '/add' is the route to add study items
- '/layout' is the route for the add study item
- '/edit/int:id' is the route to edit tasks
- '/check/int:id' is to check completed task
- '/delete/int:id' is to remove tasks
- '/tag/' to filter study items by tag
- '/completed' to view all completed study items
Click through all of the pages to see how they currently behave. Rendered app- https://studymate.onrender.com