diff --git a/README.md b/README.md
index e760b06..2ff20da 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Crabfit
+# Crabfit
Align your schedules to find the perfect time that works for everyone.
@@ -8,3 +8,13 @@ Align your schedules to find the perfect time that works for everyone.
2. Run `yarn` in both folders.
3. Run `node index.js` in the backend folder to start the API.
4. Run `yarn start` in the frontend folder to start the front end.
+
+## Deploy
+
+### Frontend
+1. In the frontend folder `cd crabfit-frontend`
+2. Run `./deploy.sh` to compile and deploy.
+
+### Backend
+1. Deploy the backend `cd crabfit-backend && gcloud app deploy --project=crabfit`
+2. Deploy the endpoints service `cd crabfit-backend && gcloud endpoints services deploy swagger.yaml`
diff --git a/crabfit-backend/index.js b/crabfit-backend/index.js
index e53d03b..9100ca9 100644
--- a/crabfit-backend/index.js
+++ b/crabfit-backend/index.js
@@ -22,7 +22,7 @@ const datastore = new Datastore({
});
app.use(cors({
- origin: 'http://localhost:3000',
+ origin: process.env.NODE_ENV === 'production' ? 'https://crab.fit' : 'http://localhost:3000',
}));
app.use(express.json());
app.use((req, res, next) => {
diff --git a/crabfit-frontend/public/index.html b/crabfit-frontend/public/index.html
index 11686e0..3b7827a 100644
--- a/crabfit-frontend/public/index.html
+++ b/crabfit-frontend/public/index.html
@@ -1,23 +1,31 @@
- {event?.name}
- https://crab.fit/{id}
-
- {!!event?.name &&
- <>Copy the link to this page, or share via email.>
- }
-
+ {(!!event || isLoading) ? (
+ <>
+ {event?.name}
+ https://crab.fit/{id}
+
+ {!!event?.name &&
+ <>Copy the link to this page, or share via email.>
+ }
+
+ >
+ ) : (
+
+ Event not found
+ Check that the url you entered is correct.
+
+
+
+
+
+
+
+
+ {error && setError(null)}>{error}}
+ These details are only for this event. Use a password to prevent others from changing your availability.
+ >
+ )}
+
+ setTimezone(event.currentTarget.value)}
+ options={timezones}
+ />
+
+
+
+
+
+ {
+ e.preventDefault();
+ if (user) {
+ setTab('you');
+ }
+ }}
+ selected={tab === 'you'}
+ disabled={!user}
+ title={user ? '' : 'Login to set your availability'}
+ >Your availability
+ {
+ e.preventDefault();
+ setTab('group');
+ }}
+ selected={tab === 'group'}
+ >Group availability
+
+
+
+ {tab === 'group' ? (
+
+
+
+ p.availability.length > 0)}
+ min={min}
+ max={max}
+ />
+
) : (
- <>
-
Sign in to add your availability
-
-
-
-
-
-
-
- {error && setError(null)}>{error}}
- These details are only for this event. Use a password to prevent others from changing your availability.
- >
+
+
+
Click and drag the calendar below to set your availabilities