13. Practice projects

It's time to put everything you've learned into practice. Here are two complete projects that integrate all the concepts from the course: from database design to data manipulation and analysis.

In all of them you must:

  • Design the database structure (collections and documents).
  • Create the database using MongoDB.
  • Insert sample data into the collections.
  • Perform queries and aggregations to extract relevant information.

And above all, don't be afraid to experiment.

Exercise 1: Task management

Design and implement a database to manage the tasks of a work team. The system must handle projects, tasks assigned to users, priorities and statuses.

  • Which project has the most completed tasks?
  • Which user has the most pending tasks?
  • What is the oldest uncompleted task?

Exercise 2: Restaurant management system

Create a complete system to manage a restaurant with tables, menu, orders and waiters.

Suggested structure:

  • Tables: table number, capacity, location (indoor/terrace), status (free/occupied)
  • Menu: dish name, category (starter/main/dessert/drink), price, ingredients, available
  • Waiters: name, shift (morning/afternoon/night), total orders served
  • Orders: table, waiter, dishes (with quantity), date and time, status (pending/preparing/served/paid), total

Operations to implement:

  • Take an order (create order, assign waiter, mark table as occupied)
  • Mark an order as served
  • Close an order and free the table (calculate total, update the waiter's statistics)
  • Find available tables with capacity for N people
  • Show the menu by categories
  • Add or remove dishes from the day's availability

Queries and statistics:

  • What is the most ordered dish?
  • Which waiter has served the most orders?
  • What is the average ticket of the restaurant?
  • Which tables generate the most revenue?
  • Which shift has the most sales?
  • Total revenue by dish category
  • Dishes that have never been ordered

Create appropriate indexes to optimize the most frequent queries (finding available tables, querying active orders, etc.)

Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python

Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python

The HTML over WebSockets approach simplifies single-page application (SPA) development and lets you bypass learning a JavaScript rendering framework such as React, Vue, or Angular, moving the logic to Python. This web application development book provides you with all the Django tools you need to simplify your developments with real-time results.

Buy the book

Help me keep writing

Every coffee gives me a push toward the next article.

Comments

There are no comments yet.