-
Notifications
You must be signed in to change notification settings - Fork 7
hot-coffee-sql #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| In this project, you will rewrite the existing [hot-coffee](https://github.com/alem-platform/foundation/tree/main/hot-coffee) project to work with a PostgreSQL database. The main task is to modify the current handlers in hot-coffee so that they execute SQL queries instead of working with JSON. | ||
|
|
||
| In addition to refactoring the existing handlers, you will add several new ones related to aggregation and reporting. Throughout this project, you will learn to perform basic SQL operations and explore aggregation tools provided by PostgreSQL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"basic operations" they have learned it in sprint-sql, they should be learning more advanced stuff, maybe refactor this section as "basic and advanced SQL operations"
|
|
||
| ## Context | ||
|
|
||
| Systems become more complex and modernized over time, and the hot-coffee project is no exception. While using a JSON-based database is convenient, it is not scalable and makes maintenance difficult for other developers. Moving to a PostgreSQL database is the better solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is a* better solution
|
|
||
| Your task is to rewrite the existing endpoints in the **hot-coffee** project to work with a PostgreSQL database. To do this, you may use a third-party PostgreSQL driver as part of your solution. | ||
|
|
||
| You need to create the following tables: `user`, `order`, `menu`, `menu_item`, `inventory`, and `ingredient`, and define the relationships between them. You are not limited to only these tables; you may create additional ones if necessary for implementing the required functionality. The design and relationships of the tables are at your discretion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
names of tables in plural?
|
|
||
| You need to create the following tables: `user`, `order`, `menu`, `menu_item`, `inventory`, and `ingredient`, and define the relationships between them. You are not limited to only these tables; you may create additional ones if necessary for implementing the required functionality. The design and relationships of the tables are at your discretion. | ||
|
|
||
| Pay special attention to designing the relationships between tables (e.g., one-to-many, one-to-one). For instance, the `menu` and `menu_item` tables will have a "one-to-many" relationship, meaning the `menu_item` table should include a column with the following constraint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it shouldn't be necessary to add following line as it is, but rather "...table MAY include a column..."
|
|
||
| Systems become more complex and modernized over time, and the hot-coffee project is no exception. While using a JSON-based database is convenient, it is not scalable and makes maintenance difficult for other developers. Moving to a PostgreSQL database is the better solution. | ||
|
|
||
| Fortunately, since the project was initially built using a layered architecture, the transition will be easier. You will need to add a new Data Access Layer (Repositories) and integrate it into the project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not add, but change Data Access Layer, because they've already implemented it
| - SQL | ||
| - PostgreSQL | ||
| - CRUD | ||
| - ERD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing about ERD in the project, I guess it should be necessary for them to make ERD diagram and submit it with the work, because it really helps in organizing tables and relationships before impelmenting them
| ## Learning Objectives | ||
|
|
||
| - SQL | ||
| - PostgreSQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this project also needs to show the difference between SQLite and PostgeSQL as databases and to do so, it should require such things, that is featured only in PostgreSQL, like it's scalability, concurrent queries, unique data types, range of tools and etc.
|
|
||
| - SQL | ||
| - PostgreSQL | ||
| - CRUD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, they've already learned the crud in foundation and even in sprint sql with basic crud and advanced ones at the end of the sprint and I think it would be better to make it Advanced CRUD and change requirements to have much more complicated endpoints, handling business logic and using complex queries that would require thorough planning of the tables as for example idea for one of the endpoints could the full text search:
Full-Text Search
- Implement menu search using PostgreSQL's full-text search capabilities
- Add endpoint
GET /menu/searchthat allows searching by:- Item name
- Ingredients
- Description
- Handling partial matches and typos
|
|
||
| Your task is to rewrite the existing endpoints in the **hot-coffee** project to work with a PostgreSQL database. To do this, you may use a third-party PostgreSQL driver as part of your solution. | ||
|
|
||
| You need to create the following tables: `user`, `order`, `menu`, `menu_item`, `inventory`, and `ingredient`, and define the relationships between them. You are not limited to only these tables; you may create additional ones if necessary for implementing the required functionality. The design and relationships of the tables are at your discretion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think the number of tables are too low, even though it is correlated to the project itself. In the sprint sql they've already faced more complex schemas and this looks as a little downgrade in comparison, I think addition of several new tables as required is necessary
| ``` | ||
| Plan your data structure carefully to ensure the project's scalability and maintainability. | ||
|
|
||
| Since adding a database dependency to your project makes it more challenging for auditor to run and test it, you need to containerize your service and database into separate containers and write a `docker-compose.yml` file. This will allow the project to be started with a single command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is too hard for them to containerization for their own, considering it is their first project and that they will learn this topic much later in the course. I think they would spend much more time than intended in this section (I personally would, if it was the first time for me facing this topic)
Either one of this solution could be applied:
- Provide detailed guide on how to setup the project in docker-compose
- Do not include docker and leave the testing part as it is, considering that authors would provide mock data in init.sql that would used to quickly setup the database for testing
| @@ -1 +1,283 @@ | |||
| # backend | |||
|
|
|||
| # hot-coffee-sql | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe give it more entertaining name like frappuccino or cold-coffee or hottest-coffe
No description provided.