You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4ad035
Browse filesBrowse the repository at this point in the historyBrowse files
To use the sample data, rename `backend/sample-data` to `backend/data`.
53
55
54
-
### Linux / macOS
56
+
####Linux / macOS
55
57
56
58
```bash
57
59
mv backend/sample-data backend/data
58
60
```
59
61
60
-
### Windows
62
+
####Windows
61
63
62
64
```powershell
63
65
Rename-Item backend/sample-data backend/data
64
66
```
65
67
66
-
## Running the API
68
+
###Running the API
67
69
68
70
Start the application with:
69
71
70
72
```bash
71
-
uv run fastapi dev --entrypoint backend.app.main:main
73
+
fastapi dev --entrypoint backend.app.main:main
72
74
```
73
75
74
76
The application will be available at:
@@ -77,13 +79,13 @@ The application will be available at:
77
79
http://127.0.0.1:8000
78
80
```
79
81
80
-
## Running the Web UI
82
+
###Running the Web UI
81
83
82
-
### Prerequisites
84
+
####Prerequisites
83
85
84
86
Install Node.js and npm.
85
87
86
-
### Start the development server
88
+
####Start the development server
87
89
88
90
From the repository root, go into the frontend directory:
89
91
@@ -105,41 +107,81 @@ npm run dev
105
107
106
108
Open the URL printed by Vite (normally `http://localhost:5173/`).
107
109
108
-
### Using the UI
110
+
##Production
109
111
110
-
On the startup screen, choose **Customer** to browse restaurants or **Restaurant** to select an existing restaurant or create a new one. The restaurant view has tabs for general details and menu items.
112
+
### Prerequisites
113
+
114
+
Install Docker with Docker Compose.
115
+
116
+
### Sample Data (Optional, First Run Only)
117
+
118
+
To start with the sample restaurants, move `backend/sample-data` to `data` in the repository root before starting the application.
119
+
120
+
#### Linux / macOS
121
+
122
+
```bash
123
+
mv backend/sample-data ./data
124
+
```
125
+
126
+
#### Windows
127
+
128
+
```powershell
129
+
Move-Item backend/sample-data data
130
+
```
111
131
112
-
### Build
132
+
### Start the Application
113
133
114
-
From the `frontend` directory, create a production build with:
134
+
From the repository root, run:
115
135
116
136
```bash
117
-
npm run build
137
+
docker compose up --build -d
118
138
```
119
139
140
+
If there have been no changes since you last built the image, you may run:
141
+
142
+
```bash
143
+
docker compose up -d
144
+
```
145
+
146
+
### Open the Application
147
+
148
+
```text
149
+
http://127.0.0.1:8000/
150
+
```
151
+
152
+
### Stop the Application
153
+
154
+
```bash
155
+
docker compose down
156
+
```
157
+
158
+
## Using the UI
159
+
160
+
On the startup screen, choose **Customer** to browse restaurants or **Restaurant** to select an existing restaurant or create a new one. The restaurant view has tabs for general details and menu items.
161
+
120
162
## API Endpoints
121
163
122
164
The API provides the following endpoints:
123
165
124
166
| Method | Path | Description |
125
167
|---|---|---|
126
-
| GET |`/health`|`Checks if the API is running.`|
127
-
| GET |`/restaurants`|`Lists all the restaurants.`|
128
-
| GET |`/restaurants?{query}`|`Lists all the restaurants that match searching query: name=...&hasMenu=...&sort_by=...&sort_desc=...`|
129
-
| GET |`/restaurants/{restaurant_id}`|`Retrieves a specific restaurant by its ID.`|
130
-
| POST |`/restaurants`|`Creates a restaurant. Returns 201, 409 if the same name and address already exist, 422 for invalid input.`|
131
-
| PATCH |`/restaurants/{restaurant_id}`|`Updates only the fields sent. Returns 200, 404 for an unknown ID, 409 for a duplicate, 422 for invalid input.`|
132
-
| POST |`/restaurants/{restaurant_id}/menu-items`|`Creates a new menu item. Returns 201, 404 if the restaurant is not found, 422 for invalid input.`|
133
-
| PATCH |`/restaurants/{restaurant_id}/menu-items/{menu_item_id}`|`Updates a menu item's fields. Returns 200, 404 if the item or restaurant is not found, 422 for invalid input.`|
134
-
| DELETE |`/restaurants/{restaurant_id}/menu-items/{menu_item_id}`|`Deletes a specific menu item. Returns 204 on success, 404 if not found.`|
168
+
| GET |`/api/v1/health`|`Checks if the API is running.`|
169
+
| GET |`/api/v1/restaurants`|`Lists all the restaurants.`|
170
+
| GET |`/api/v1/restaurants?{query}`|`Lists all the restaurants that match searching query: name=...&hasMenu=...&sort_by=...&sort_desc=...`|
171
+
| GET |`/api/v1/restaurants/{restaurant_id}`|`Retrieves a specific restaurant by its ID.`|
172
+
| POST |`/api/v1/restaurants`|`Creates a restaurant. Returns 201, 409 if the same name and address already exist, 422 for invalid input.`|
173
+
| PATCH |`/api/v1/restaurants/{restaurant_id}`|`Updates only the fields sent. Returns 200, 404 for an unknown ID, 409 for a duplicate, 422 for invalid input.`|
174
+
| POST |`/api/v1/restaurants/{restaurant_id}/menu-items`|`Creates a new menu item. Returns 201, 404 if the restaurant is not found, 422 for invalid input.`|
175
+
| PATCH |`/api/v1/restaurants/{restaurant_id}/menu-items/{menu_item_id}`|`Updates a menu item's fields. Returns 200, 404 if the item or restaurant is not found, 422 for invalid input.`|
176
+
| DELETE |`/api/v1/restaurants/{restaurant_id}/menu-items/{menu_item_id}`|`Deletes a specific menu item. Returns 204 on success, 404 if not found.`|
0 commit comments