input: Write a function to create an application with a Python backend using Flask and SQLAlchemy to handle task management, and a React frontend to display and interact with tasks. The backend should include a model for tasks with fields for the task title and completion status, and an API endpoint to create tasks. The frontend should include a component that fetches tasks from the backend and displays them with checkboxes to show their completion status.
  
  def create_task_app():
    app = Flask(__name__)
    db = SQLAlchemy(app)
  
    class Task(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String(80), unique=True, nullable=False)
      is_completed = db.Column(db.Boolean, default=False)
  
      def __repr__(self):
        return f'<Task {self.id}: {self.title}>'
  
    @app.route('/tasks', methods=['POST'])
    def create_task():
      request_data = request.get_json()
      title = request_data.get('title')
      if not title:
        return jsonify({'error': 'Title must be provided.'}), 400
  
      task = Task(title=title)
      db.session.add(task)
      db.session.commit()
  
      return jsonify(task.serialize())
  
  
  import React, { useState, useEffect } from 'react'
  import axios from 'axios'
  
  export const TaskList = () => {
    const [tasks, setTasks] = useState([])
  
    useEffect(() => {
      getTasks()
    }, [])
  
    const getTasks = async () => {
      const response = await axios.get('http://localhost:3000/tasks')
      setTasks(response.data)
    }
  
    return (
      <div>
        {tasks.map(task => (
          <div key={task.id}>
            <input type="checkbox" checked={task.is_complete} />
            <label>{task.title}</label>
          </div>
        ))}
      </div>
    )
  }
  
  assert create_task_app()
  assert isinstance(create_task_app(), Flask)
  assert isinstance(Task, db.Model)
  assert Task.__table__
  assert Route('/tasks', ['POST']) in app.routes
  assert TaskList.fetch('http://localhost:3000/tasks')
output: 
  def create_task_app():
    app = Flask(__name__)
    db = SQLAlchemy(app)
  
    class Task(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String(80), unique=True, nullable=False)
      is_completed = db.Column(db.Boolean, default=False)
  
      def __repr__(self):
        return f'<Task {self.id}: {self.title}>'
  
      def serialize(self):
        return {
          'id': self.id,
          'title': self.title,
          'is_completed': self.is_completed
        }
  
    @app.route('/tasks', methods=['POST'])
    def create_task():
      request_data = request.get_json()
      title = request_data.get('title')
      if not title:
        return jsonify({'error': 'Title must be provided.'}), 400
  
      task = Task(title=title)
      db.session.add(task)
      db.session.commit()
  
      return jsonify(task.serialize())
  
    return app
  