SanjeevB1 commited on
Commit
339be2b
Β·
verified Β·
1 Parent(s): ac251d0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -68
README.md CHANGED
@@ -7,92 +7,111 @@ sdk: docker
7
  app_file: app.py
8
  pinned: false
9
  ---
 
10
 
11
- # Sanjeev's Favorite Drink API πŸ₯€
12
- This is a REST API with full CRUD (Create, Read, Update, Delete) operations that lets you manage a list of drinks. It is hosted on Hugging Face Spaces and serves as a fun way to access and explore my favorite drinks.
13
 
14
- The API includes features such as retrieving the list of all drinks, getting details of a specific drink, adding new drinks, and deleting them. Note that due to the hosting limitations of Hugging Face Spaces, POST and DELETE operations are currently disabled.
15
 
16
- ## API Summary
17
 
18
- | HTTP Method | Endpoint | Description |
19
- |-------------|----------------|--------------------------------------------------|
20
- | GET | `/` | Returns a list of all drinks. |
21
- | GET | `/drinks` | Same as `/`, returns all drinks. |
22
- | GET | `/drinks/<id>` | Returns details of a specific drink by its ID. |πŸ₯€
23
- | POST | `/drinks` | Add a new drink (not supported on Hugging Face).|
24
- | DELETE | `/drinks/<id>` | Delete a drink (not supported on Hugging Face). |
 
 
 
 
25
 
26
  ---
27
 
28
- ## Database Design
29
 
30
- | Column | Type | Description |
31
- |-------------|-------------|-------------------------------------|
32
- | `id` | INTEGER | Unique identifier (Primary Key). |
33
- | `name` | STRING(80) | Name of the drink (must be unique). |
34
- | `description`| STRING(120)| Short description of the drink. |
35
 
36
  ---
37
 
38
  ## πŸš€ How It Works
39
 
40
- The API uses Flask and SQLAlchemy. The data is stored in a SQLite database. Flask handles the incoming HTTP requests, queries the database, and returns the corresponding responses. CRUD operations can be performed locally, while only GET operations are supported on Hugging Face Spaces due to the read-only database restrictions.
41
-
42
- ## Usage Instructions
43
-
44
- ### View All Drinks
45
- - **Method**: `GET`
46
- - **URL**: [https://sanjeevb1-drinks.hf.space/drinks](https://sanjeevb1-drinks.hf.space/drinks)
47
- - **Example Response**:
48
- ```json
49
- {
50
- "drinks": [
51
- {
52
- "name": "Diet Coke",
53
- "description": "Tastes like Coke with no calories, great!!!"
54
- },
55
- {
56
- "name": "Fanta",
57
- "description": "Like the taste and color of it"
58
- }
59
- ]
60
- }
61
- ```
62
-
63
- ### View a Specific Drink
64
- - **Method**: `GET`
65
- - **URL**: [https://sanjeevb1-drinks.hf.space/drinks/1](https://sanjeevb1-drinks.hf.space/drinks/1)
66
- - **Example Response**:
67
- ```json
68
- {
69
- "name": "Diet Coke",
70
- "description": "Tastes like Coke with no calories, great!!!"
71
- }
72
- ```
73
-
74
- ### Add a New Drink (Not Supported on Hugging Face Spaces)
75
- - **Method**: `POST`
76
- - **URL**: `/drinks`
77
- - **Body (JSON)**:
78
- ```json
79
- {
80
- "name": "Mango Juice",
81
- "description": "Sweet and refreshing"
82
- }
83
- ```
84
-
85
- ### Delete a Drink (Not Supported on Hugging Face Spaces)
86
- - **Method**: `DELETE`
87
- - **URL**: `/drinks/1`
 
 
 
 
 
 
 
 
 
 
88
 
89
  ---
90
 
91
  ## πŸ›‘ Note
92
- POST and DELETE requests won't work on Hugging Face Spaces because the database is read-only. You can clone this repository and run it locally to enable all CRUD operations.
 
93
 
94
  ---
95
 
96
- ## Author
97
- Sanjeev's Favorite Drinks API is designed to provide an interactive experience with REST API operations while sharing a taste of my favorite drinks.
 
 
98
 
 
 
7
  app_file: app.py
8
  pinned: false
9
  ---
10
+ Here’s your enhanced README file with added emojis for a fun touch:
11
 
12
+ ```markdown
13
+ # Sanjeev's Favorite Drink API πŸ₯€
14
 
15
+ This is a REST API with full CRUD (Create, Read, Update, Delete) operations that lets you manage a list of drinks. It is hosted on Hugging Face Spaces and serves as a fun way to access and explore my favorite drinks. 🍹
16
 
17
+ The API includes features such as retrieving the list of all drinks, getting details of a specific drink, adding new drinks, and deleting them. Note that due to the hosting limitations of Hugging Face Spaces, **POST** and **DELETE** operations are currently disabled. 🚫
18
 
19
+ ---
20
+
21
+ ## πŸ“‹ API Summary
22
+
23
+ | HTTP Method | Endpoint | Description |
24
+ |-------------|-------------------|----------------------------------------------------|
25
+ | **GET** | `/` | Returns a list of all drinks. |
26
+ | **GET** | `/drinks` | Same as `/`, returns all drinks. |
27
+ | **GET** | `/drinks/<id>` | Returns details of a specific drink by its ID. |
28
+ | **POST** | `/drinks` | Add a new drink (not supported on Hugging Face). |
29
+ | **DELETE** | `/drinks/<id>` | Delete a drink (not supported on Hugging Face). |
30
 
31
  ---
32
 
33
+ ## πŸ“˜ Database Design
34
 
35
+ | Column | Type | Description |
36
+ |--------------|-----------|-------------------------------------------|
37
+ | **id** | INTEGER | Unique identifier (Primary Key). |
38
+ | **name** | STRING(80)| Name of the drink (must be unique). |
39
+ | **description** | STRING(120) | Short description of the drink. |
40
 
41
  ---
42
 
43
  ## πŸš€ How It Works
44
 
45
+ The API uses Flask and SQLAlchemy. The data is stored in a SQLite database. πŸ›  Flask handles the incoming HTTP requests, queries the database, and returns the corresponding responses. CRUD operations can be performed locally, while only **GET** operations are supported on Hugging Face Spaces due to the read-only database restrictions. πŸ“‚
46
+
47
+ ---
48
+
49
+ ## πŸ–±οΈ Usage Instructions
50
+
51
+ ### 1️⃣ View All Drinks
52
+ **Method**: `GET`
53
+ **URL**: [https://sanjeevb1-drinks.hf.space/drinks](https://sanjeevb1-drinks.hf.space/drinks)
54
+
55
+ **Example Response**:
56
+ ```json
57
+ {
58
+ "drinks": [
59
+ {
60
+ "name": "Diet Coke",
61
+ "description": "Tastes like Coke with no calories, great!!!"
62
+ },
63
+ {
64
+ "name": "Fanta",
65
+ "description": "Like the taste and color of it"
66
+ }
67
+ ]
68
+ }
69
+ ```
70
+
71
+ ---
72
+
73
+ ### 2️⃣ View a Specific Drink
74
+ **Method**: `GET`
75
+ **URL**: [https://sanjeevb1-drinks.hf.space/drinks/1](https://sanjeevb1-drinks.hf.space/drinks/1)
76
+
77
+ **Example Response**:
78
+ ```json
79
+ {
80
+ "name": "Diet Coke",
81
+ "description": "Tastes like Coke with no calories, great!!!"
82
+ }
83
+ ```
84
+
85
+ ---
86
+
87
+ ### 3️⃣ Add a New Drink (🚫 Not Supported on Hugging Face Spaces)
88
+ **Method**: `POST`
89
+ **URL**: `/drinks`
90
+ **Body (JSON)**:
91
+ ```json
92
+ {
93
+ "name": "Mango Juice",
94
+ "description": "Sweet and refreshing"
95
+ }
96
+ ```
97
+
98
+ ---
99
+
100
+ ### 4️⃣ Delete a Drink (🚫 Not Supported on Hugging Face Spaces)
101
+ **Method**: `DELETE`
102
+ **URL**: `/drinks/1`
103
 
104
  ---
105
 
106
  ## πŸ›‘ Note
107
+
108
+ ⚠️ **POST** and **DELETE** requests won't work on Hugging Face Spaces because the database is read-only. You can clone this repository and run it locally to enable all CRUD operations. πŸ’»
109
 
110
  ---
111
 
112
+ ## πŸ‘€ Author
113
+
114
+ Sanjeev's Favorite Drinks API is designed to provide an interactive experience with REST API operations while sharing a taste of my favorite drinks. 🍹 Cheers! πŸ₯‚
115
+ ```
116
 
117
+ Let me know if you need further adjustments! 😊