|
1 | | - |
2 | | -# Chapter III |
| 1 | +# Chapter III - Practical Exercise: Ebook Store (Part 1) |
3 | 2 | `(avr. time for this chapter: 3 to 4 days)` |
4 | 3 |
|
5 | | -Moving on from the theoretical part, we move on to the practical part. |
| 4 | +Moving from theory to practice, this chapter presents a hands-on exercise where you will build a Rails application from scratch. |
| 5 | + |
| 6 | +The requirements listed below are intentionally generic. This approach mirrors real-world scenarios where client requirements are often open to interpretation. As an engineer, you are expected to analyze, design, and implement solutions based on the given specifications. If you have questions or need clarification, discuss ideas with your tutor—just as you would in a professional environment. |
| 7 | + |
| 8 | +These topics align with what you learned in the previous chapter, so the implementation should feel familiar. |
| 9 | + |
| 10 | +## Project Setup |
| 11 | + |
| 12 | +### Steps to implement: |
| 13 | + |
| 14 | +1. Create a new Rails application using MVC architecture |
| 15 | +2. Initialize a Git repository and grant access to your tutor |
| 16 | +3. (Optional) Deploy the application to a platform of your choice (e.g., [Render](https://render.com), [Heroku](https://heroku.com)) |
| 17 | + |
| 18 | +## Application Requirements |
| 19 | + |
| 20 | +Build an online ebook store application. The platform will have sellers and buyers. You will not implement shopping cart logic, but you will implement functionalities related to purchasing actions. |
| 21 | + |
| 22 | +### Core Features |
| 23 | + |
| 24 | +#### User Management |
| 25 | + |
| 26 | +- Create CRUD operations for Users (can be either seller or buyer) |
| 27 | +- Implement user status management (enable/disable) |
| 28 | + |
| 29 | +#### Ebook Management |
6 | 30 |
|
7 | | -You'll find several topics listed below, with very little detail. The details do not exist on purpose, it is in everyone's interest to understand how you can infer, through a practical case, the same thing that would happen in real life with a client. As an engineer you know how to think, and if you have doubts you can always do what you would do in a real project, discuss ideas. You can also design your solution before trying it out. |
| 31 | +- Create CRUD operations for Ebooks |
| 32 | +- Implement status workflow for Ebooks (Draft → Pending → Live) |
| 33 | +- Store PDF preview drafts available for download |
8 | 34 |
|
9 | | -These topics are still the most basic so you don't need to build or model a very elaborate system, if you notice they are linked to the course you just saw in the previous chapter. |
| 35 | +#### Navigation |
10 | 36 |
|
11 | | -***So, let's code*** |
| 37 | +- Add a navigation menu with links to Ebooks and Users sections |
12 | 38 |
|
13 | | -# Let's do some basic code |
| 39 | +### Purchase Functionality |
14 | 40 |
|
15 | | -> create a simple rails application MVC |
16 | | -> open a git repository and give access to your tutor |
17 | | -> IF you have time deploy it, you can choose the platform (render.com, heroku.com) |
| 41 | +> Note: For email functionality, you do not need to send actual emails. Create the notification logic only, or use [Mailcatcher](https://mailcatcher.me) for local testing. |
18 | 42 |
|
19 | | -Let's build an application from scratch. The application will have as its theme the sale of ebooks online. A virtual store where you will have sellers and buyers. You won't have to implement the cart's logic, but some functionalities related to some actions that are performed when buying an item. |
| 43 | +#### Steps to implement: |
20 | 44 |
|
21 | | -As previously mentioned, all the points below are generic, it is up to the developer who develops to build an architecture consistent with the proposed objective |
| 45 | +1. Implement an ebook purchase action (without cart logic) |
| 46 | +2. The purchase button should trigger the following actions: |
| 47 | + - Send an email to the seller with their commission (10% of the book price) |
| 48 | + - Send an email with ebook statistics (examples below) |
| 49 | + - Register the purchase in the database |
22 | 50 |
|
23 | | - - List item (ebooks) |
24 | | - - Add navigation menu with ebook and users |
25 | | - - Create CRUD for the user (seller or a buyer) |
26 | | - - Update Status of the user (enable or disable) |
27 | | - - Create CRUD for Ebooks |
28 | | - - Update Status for the Ebook (Draft, Pending, Live) |
29 | | - - Store PDF with the preview draft for download |
| 51 | +#### Suggested Statistics to Track: |
30 | 52 |
|
31 | | -> the emails referenced below do not need to be sent, it is only necessary to create the notification logic, or you can use **mailcatcher.me** |
| 53 | +- Number of times the ebook was purchased |
| 54 | +- Number of times the preview PDF was viewed |
| 55 | +- Number of times the ebook page was visited |
| 56 | +- Visitor information (IP, browser, location, etc.) |
32 | 57 |
|
33 | | -- buy ebook (**don't apply cart logic**), |
34 | | - - the buy button should trigger 2 actions (send mail to the user with the fee he get from the bought ebook 10% from the book price, send an email with all statistics from that ebook (how many times the ebook was bought, how many times the draft pdf has been viewed, how many times ebook has been seen, IP, browser, location, etc ... )) **note: you can find different metrics and not use these** |
35 | | - - Register the book purchase |
| 58 | +> Note: You may define different metrics based on your implementation approach. |
0 commit comments