Mini Project 2 - Web App Development
18 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary software requirement mentioned for completing the mini project?

  • Git (correct)
  • Java
  • Python
  • Node.js
  • Which folder is referred to as the root folder of the application?

  • app_root
  • mini_project
  • project_base
  • mp_calc (correct)
  • What command should be run in the terminal to enter the virtual environment?

  • activate_env
  • venv activate
  • pipenv shell (correct)
  • env activate
  • Where can you find instructions for the mini project in the file structure?

    <p>Readme.md</p> Signup and view all the answers

    What command should you run to install the packages listed in the Pipfile?

    <p>pipenv install</p> Signup and view all the answers

    What framework is utilized for creating the web app in this mini project?

    <p>Flask</p> Signup and view all the answers

    What should you do if you encounter a message about adding pipenv to the PATH?

    <p>Run a specific command in the terminal</p> Signup and view all the answers

    How do you exit the virtual environment at the end of a session?

    <p>deactivate</p> Signup and view all the answers

    What should be done after modifying the mergesort() function in serverlibrary.py?

    <p>Compile clientlibrary.py using Transcrypt.</p> Signup and view all the answers

    Which file contains the definition for the db object needed for the application?

    <p><strong>init</strong>.py</p> Signup and view all the answers

    What is the role of the routes.py file in the application?

    <p>It defines how URLs are routed within the application.</p> Signup and view all the answers

    What should be done in the templates folder for Exercise 1?

    <p>Replace #Replace Me# with jinja templating code.</p> Signup and view all the answers

    How can you check if the target folder was created successfully after compiling clientlibrary.py?

    <p>By typing a specific command in the terminal.</p> Signup and view all the answers

    Which command is necessary to run the web application after setting up the database?

    <p>flask run</p> Signup and view all the answers

    What is the expected output when the users are displayed in the web application?

    <p>Users sorted according to their usernames.</p> Signup and view all the answers

    What programming language is used to implement the EvaluateExpression and Stack classes?

    <p>Python</p> Signup and view all the answers

    In what specific form should the users be shown in users.html?

    <p>In rows of a table.</p> Signup and view all the answers

    What command is used to stop the web application that is running?

    <p>CTRL + C</p> Signup and view all the answers

    Study Notes

    Mini Project 2 - Web App Development (Math Quiz)

    • Project Goal: Develop a web application for integer arithmetic quizzes.
    • Prerequisites: Git installation.
    • Project Setup:
      • Clone the repository: git clone <repo URL>
      • Navigate to the mp_calc folder for this mini-project.
      • Install pipenv: (Windows/Linux commands provided)
      • Add pipenv to PATH (if needed for Vocareum Linux shell): (Command provided).
      • Install packages specified in Pipfile using pipenv install.
      • Activate virtual environment: pipenv shell (or prepend commands with pipenv run)
      • Verify virtualenv activation: Check for (mp_calc) in your prompt
      • Terminate virtual environment: exit

    Application Structure and Files

    • Key Files: application.py, app/__init__.py, app/routes.py, templates/users.html, serverlibrary.py, clientlibrary.py
    • application.py: Contains Flask application setup. Note the differences from previous mini-projects.
    • __init__.py: Contains database (db) object creation and imports routes.py.
    • routes.py: Defines URL routing for the app, particularly the / route.
    • users.html: Displays user data in a table format. Jinja templating used for dynamic content.

    Exercise 1: Displaying User Data

    • Objective: Display user data within the users.html table.
    • Tools: Jinja templating.
    • Implementation: Replace placeholders (#Replace Me#) in users.html to iterate over users and display relevant details.
    • Dependencies: Complete Exercise Q1 in mp2_exercises.ipynb and incorporate merged sort into serverlibrary.py.

    Exercise 2: Server Library Implementation

    • Objective: Implement classes in serverlibrary.py.
    • Classes: Stack, EvaluateExpression.
    • Testing:
      • Test functions in serverlibrary.py using example inputs (as provided).
      • Verify correct output is displayed and table functionality is correct.

    Client Javascript Library

    • Compilation: Compile clientlibrary.py (located in app/static/) using Transcrypt.
      • Navigate to app/static/ in your terminal
      • Run transcrypt clientlibrary.py
    • Database Setup: Create the app.db database file and any required migrations.

    Application Deployment and Running

    • Database Preparation: (Commands provided).
    • Flask Run:
      • Navigate to the root directory.
      • Run Flask: (Commands provided)
    • Browser Access: Open http://127.0.0.1:5000/ in your web browser to view the app.
    • Stopping the App: Press Ctrl+C to stop the Flask server.
    • Vocareum Specifics (if applicable): Follow additional instructions specific for Vocareum if needed.

    Mini Project Outcomes

    • Expected output: Output examples, including sorted user data (users.html) and calculations (EvaluateExpression) are given.
    • Error Handling: Handle any errors appropriately in your serverlibrary.py and application.py files.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    This project focuses on developing a web application aimed at conducting integer arithmetic quizzes. It requires the use of Git for setup and involves various Python files to establish the application framework using Flask.

    More Like This

    Test Your Knowledge
    35 questions
    Web vs. Mobile App Development
    10 questions
    Web App Development Examples Quiz
    5 questions
    Event Handling in Web Viewer Apps
    8 questions
    Use Quizgecko on...
    Browser
    Browser