Because you're always on top of the mountain (or at least your to-do list).
Peak Performer is a simple yet robust to-do list application designed to keep you organized and productive. Built with Python and Flask, it leverages best practices in software design, including the Model-View-Controller (MVC) and Repository design patterns, ensuring scalability and maintainability.
- Introduction
- Features
- Installation
- Usage
- Architecture
- Dependencies
- Configuration
- Troubleshooting
- License
- Acknowledgement
- User authentication (register, login, logout).
- Create, view, edit, and delete tasks.
- Role-based task management.
- API endpoint to fetch task details.
- Persistent data storage using PostgreSQL.
-
Clone the repository:
git clone https://github.com/your-repo/peak-performer.git cd peak-performer
-
Use the provided
run.sh
script for setup:- Create/load the virtual environment, install dependencies, and build PostgreSQL database:
./run.sh initial-setup
-
Start the application:
./run.sh run-app
Access the application in your browser at http://127.0.0.1:5001
.
- Navigate to the login page to access your account. Enter your username and password, then click LOGIN. New users can register by clicking "Sign Up".
- Create a new account by providing a username and a secure password. Ensure both password fields match before submitting.
- View all your tasks in a neatly organized table. The dashboard displays the task ID, title, description, and status. The task ID is cumulative for all tasks, across users, that are tracked in Peak Performer.
- Click "Add Task" in the navigation menu. Fill in the task title, description, and status, then click
Create Task
.
- Select the "Edit Task" option. Enter the Task ID and update the desired fields. Leave fields blank to retain current values.
- Choose the "Delete Task" option. Enter the Task ID to delete. Task details are fetched dynamically to ensure accuracy.
- Use the "Log Out" option in the navigation menu to safely end your session.
- Model:
- Defined in
models.py
, representingUsers
andTasks
with SQLAlchemy.
- Defined in
- View:
- HTML templates (e.g.,
login.html
,view_tasks.html
) extendbase.html
for a consistent UI. - Built with Bootstrap for responsive and elegant styling.
- HTML templates (e.g.,
- Controller:
- Route handling and logic in
auth_controller.py
andtasks_controller.py
.
- Route handling and logic in
- Separation of Concerns: Each component (Model, View, Controller) handles a distinct responsibility, avoiding overlap and reducing complexity.
- Improved Maintainability: Changes to one layer (e.g., UI updates in the View) have minimal impact on others (e.g., Model or Controller).
- Scalability: Enables the application to grow by adding new features or modules without disrupting existing functionality.
- Parallel Development: Different teams can work on the UI, business logic, and database layers independently.
Source: Geeks for Geeks
- Repositories:
UsersRepository
: Handles CRUD operations for user accounts.TasksRepository
: Abstracts database logic for task management.
- Centralized Data Logic: All database interactions are handled in repository classes, ensuring a clean separation of concerns.
- Easier Data Source Configuration: Switching or adding new data sources (e.g., from PostgreSQL to MySQL) requires minimal changes in the repository layer only.
- Support for Multiple Data Sources: Easily integrate and manage relational databases alongside external APIs or NoSQL databases.
- Simplified Testing: Mocking repositories during tests avoids the need for live database connections.
- Reusability and Consistency: Shared repository methods reduce duplication and streamline database operations.
- Set environment variables in a
.env
file, including:DB_USER=<your-database-user> DB_PASSWORD=<your-database-password> DB_HOST=<your-database-host> DB_PORT=<your-database-port> DB_NAME=<your-database-name>
- Customize app settings in
main.py
and static assets instatic/img
.
- Database Errors: Ensure PostgreSQL is running and
.env
variables are correct. - Dependency Issues: Use
./run.sh install-deps
to reinstall requirements.
This project is licensed under the MIT License. See LICENSE
for details.
Peak Performer was in response to roadmap.sh's Todo List API project.