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
[](https://github.com/WillSams/eexample-js-react-with-python/actions/workflows/pr-validate.yml)
5
+
[](https://github.com/WillSams/example-js-react-with-python/actions/workflows/pr-validate.yml)
6
6
7
7
This example contains a frontend and backend:
8
8
9
9
- The frontend is a [React](https://react.dev) application using [Bootstrap4](https://getbootstrap.com/docs/4.6/getting-started/introduction/) for view designs.
10
-
- The backend is a [GraphQL API](https://graphql.org) providing the ability to create, delete, and list reservatios plus available rooms for a given date range.
10
+
- The backend is a [GraphQL API](https://graphql.org) providing the ability to create, delete, and list reservations plus available rooms for a given date range.
11
11
12
12
React [Typescript](https://github.com/WillSams/example-ts-react-with-python) and [Express MVC](https://github.com/WillSams/example-mvc-expressjs-with-python) versions of this same idea are available.
13
13
@@ -17,7 +17,7 @@ An [abandoned](https://github.com/WillSams/example-mvc-expressjs-with-python/tre
17
17
18
18
- When a room is reserved, it cannot be reserved by another guest on overlapping dates.
19
19
- Whenever there are multiple available rooms for a request, the room with the lower final price is assigned.
20
-
- Whenever a request is made for a single room, a double bed room may be assigned (if no single is available?).
20
+
- Whenever a request is made for a single room, a double bed room may be assigned if no single is available.
21
21
- Smokers are not placed in non-smoking rooms.
22
22
- Non-smokers are not placed in allowed smoking rooms.
23
23
- Final price for reservations are determined by daily price * num of days requested, plus the cleaning fee.
@@ -77,11 +77,12 @@ The below are optional but highly recommended:
77
77
78
78
-[nvm](https://github.com/nvm-sh/nvm) - Used to manage NodeJS versions.
79
79
-[Direnv](https://direnv.net/) - Used to manage environment variables.
80
-
- Install [direnv](https://direnv.net) for persisting environment variables needed for development.
81
80
82
81
## Getting Started
83
82
84
-
First, we'll need to set up our environment variables. You can do this by either any of the methods mentioned in [/tools/ENV.md](./tools/ENV.md) but I recommend using [Direnv](https://direnv.net/).
83
+
First, we'll need to set up our environment variables. You can do this by any of the methods mentioned in [/tools/ENV.md](./tools/ENV.md) but I recommend using [Direnv](https://direnv.net/).
84
+
85
+
Key backend variables include `SECRET_KEY`, `REFRESH_SECRET_KEY`, `PG_URL`, and `ALLOWED_ORIGINS` (a comma-separated list of allowed frontend origins, e.g. `http://localhost:3000`).
You can also acces the Ariadne GraphiQL (interactive test playground) instance at [http://localhost:$RESERVATION_PORT/$ENV/graphql](http://localhost:$PLAYGROUND_PORT/$ENV/graphql).
137
+
You can also access the Ariadne GraphiQL (interactive test playground) instance at [http://localhost:$RESERVATION_PORT/$ENV/graphql](http://localhost:$RESERVATION_PORT/$ENV/graphql).
136
138
137
139
## Testing
138
140
139
-
The backend uses [Pytest](https://docs.pytest.org) and the frontend uses [Jest](https://jestjs.io/). To run these tests, simply execute `npm run test:backend` or `npm run test:frontend', respectively.
141
+
The backend uses [Pytest](https://docs.pytest.org) and the frontend uses [Jest](https://jestjs.io/). To run these tests, simply execute `npm run test:backend` or `npm run test:frontend`, respectively.
0 commit comments