Skip to content

pulkitupadhay/Better_Software

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager with Comments

A simple task management application built with Flask (backend) and React (frontend) that allows users to create, edit, and delete tasks, as well as add, edit, and delete comments on tasks.

Features

Backend (Flask)

  • ✅ RESTful API for Tasks and Comments
  • ✅ Full CRUD operations for both Tasks and Comments
  • ✅ SQLite database with SQLAlchemy ORM
  • ✅ Automated tests with pytest
  • ✅ CORS enabled for frontend integration

Frontend (React)

  • ✅ Create, edit, and delete tasks
  • ✅ Mark tasks as complete/incomplete
  • ✅ Add, edit, and delete comments on tasks
  • ✅ Modern, beautiful UI with gradient background
  • ✅ Smooth animations and transitions
  • ✅ Responsive design (mobile-friendly)
  • ✅ Real-time updates with hot reload
  • ✅ Emoji icons for better UX
  • ✅ Glass morphism effects

Project Structure

Better_Software/
├── backend/
│   ├── app.py              # Flask application with API endpoints
│   ├── test_app.py         # Automated tests for API
│   ├── requirements.txt    # Python dependencies
│   └── README.md          # Backend documentation
├── frontend/
│   ├── src/
│   │   ├── components/    # React components
│   │   │   ├── TaskForm.jsx
│   │   │   ├── TaskList.jsx
│   │   │   ├── TaskItem.jsx
│   │   │   ├── CommentList.jsx
│   │   │   └── CommentItem.jsx
│   │   ├── App.jsx        # Main App component
│   │   └── App.css        # Styles
│   └── package.json       # Node dependencies
└── README.md              # This file

Setup Instructions

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Create a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the Flask server:
python app.py

The backend will run on http://localhost:5001

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev

The frontend will run on http://localhost:5173

Running Tests

Backend Tests

cd backend
source venv/bin/activate
pytest test_app.py -v

All 12 tests should pass:

  • ✅ Create comment
  • ✅ Create comment without content (validation)
  • ✅ Create comment for non-existent task
  • ✅ Get all comments for a task
  • ✅ Get single comment
  • ✅ Get non-existent comment
  • ✅ Update comment
  • ✅ Update comment without content (validation)
  • ✅ Update non-existent comment
  • ✅ Delete comment
  • ✅ Delete non-existent comment
  • ✅ Cascade delete comments when task is deleted

API Endpoints

Tasks

  • GET /api/tasks - Get all tasks
  • GET /api/tasks/<id> - Get a specific task
  • POST /api/tasks - Create a new task
  • PUT /api/tasks/<id> - Update a task
  • DELETE /api/tasks/<id> - Delete a task

Comments

  • GET /api/tasks/<task_id>/comments - Get all comments for a task
  • POST /api/tasks/<task_id>/comments - Create a comment for a task
  • GET /api/comments/<id> - Get a specific comment
  • PUT /api/comments/<id> - Update a comment
  • DELETE /api/comments/<id> - Delete a comment

Assumptions Made

  1. Simple Authentication: No user authentication is implemented. In a production app, you'd want to add user accounts and associate tasks/comments with users.

  2. Single User: The app assumes a single user environment. All tasks and comments are visible to everyone.

  3. In-Memory Database: SQLite is used for simplicity. For production, consider PostgreSQL or MySQL.

  4. Basic Validation: Only basic validation is implemented (e.g., required fields). More robust validation could be added.

  5. No Pagination: All tasks and comments are loaded at once. For large datasets, pagination should be implemented.

  6. Timestamps: Comments track creation and update times. Tasks only track creation time.

Technologies Used

Backend

  • Flask 3.0.0
  • Flask-SQLAlchemy 3.1.1
  • Flask-CORS 4.0.0
  • pytest 7.4.3

Frontend

  • React 18
  • Vite 7.3.0
  • Modern JavaScript (ES6+)

Future Enhancements

  • Add user authentication and authorization
  • Implement pagination for tasks and comments
  • Add search and filter functionality
  • Add due dates and priorities for tasks
  • Add file attachments to comments
  • Implement real-time updates with WebSockets
  • Add dark mode
  • Deploy to production (e.g., Heroku, Vercel)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors