netlify deploy button

This commit is contained in:
Shams mosowi
2020-06-21 11:41:03 +08:00
parent d7ea32032c
commit acb0b4c353
5 changed files with 24 additions and 95 deletions

View File

@@ -15,6 +15,8 @@ supported. More coming soon, for comprehensive list see ROADMAP.md.
![Firetable screenshot](https://firetable.io/demo-screenshot.png)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/AntlerVC/firetable)
## Setup instructions
### 1. Create a Firebase project [(Instructions)](https://console.firebase.google.com/u/0/)
@@ -35,85 +37,38 @@ supported. More coming soon, for comprehensive list see ROADMAP.md.
- Upgrade project to the Blaze Plan
- Enable the Google sign-in method in **Authentication / Sign-in method**
### 2. (Optional) Create an [Algolia](https://algolia.com) project
- Algolias free **Community** plan is sufficient
#### Why Algolia?
Algolia is currently used for the **Connect Table** cell type to link a cell to
another row in another table. It may also be used in the future for further
plain text search and filtering capabilities.
You can **opt out** of Algolia by commenting out the following lines in
`cloud_functions/functions/src/index.ts`:
```ts
import algoliaFnsGenerator from "./algolia";
import algoliaConfig from "./algolia/algoliaConfig";
export const algolia = algoliaConfig.reduce((acc: any, collection) => {
return { ...acc, [collection.name]: algoliaFnsGenerator(collection) };
}, {});
```
### 3. Clone this repo
```
git clone https://github.com/AntlerVC/firetable.git
```
### 4. Set up Cloud Functions
- Install dependencies
```
cd cloud_functions/functions
yarn
```
- Ensure that you have Firebase CLI installed.
[(Instructions)](https://firebase.google.com/docs/cli)
- Set cloud environment keys for Algolia: get the generated **Application ID**
and **Admin API Key** from the Algolia **API Keys** page
```
firebase functions:config:set algolia.app=YOUR_APP_ID algolia.key=ADMIN_API_KEY
```
- Deploy the Cloud Functions to your Firebase project
```
yarn deploy
```
### 5. Set React app environment variables
### 3. Set React app environment variables
Create a .env file in the `www` directory
- Get the generated **Application ID** and **Search-Only API Key** from the
Algolia **API Keys** page
- Get the Firebase **Project ID** and **Web API Key** from your Firebase
Projects **Settings** page. Click the cog icon on the left sidebar (under the
Firebase logo) and click **Project settings**
```
REACT_APP_ALGOLIA_APP_ID=
REACT_APP_ALGOLIA_SEARCH_API_KEY=
- (optional) Get the generated **Application ID** and **Search-Only API Key**
from the Algolia **API Keys** page
```
REACT_APP_FIREBASE_PROJECT_ID=
REACT_APP_FIREBASE_PROJECT_WEB_API_KEY=
REACT_APP_ALGOLIA_APP_ID=
REACT_APP_ALGOLIA_SEARCH_API_KEY=
```
### 6. Install front-end dependencies
### 4. Install front-end dependencies
```
cd www
yarn
```
### 7. Run project locally
### 5. Run project locally
```
yarn start

View File

@@ -1,38 +0,0 @@
{
"name": "foo-app",
"env": {
"BACKGROUND_COLOR": {
"description": "specify a css color",
"value": "#fefefe",
"required": false
},
"TITLE": {
"description": "title for your site"
},
"APP_SECRET": {
"generator": "secret"
}
},
"options": {
"allow-unauthenticated": false,
"memory": "512Mi",
"cpu": "1"
},
"build": {
"skip": false
},
"hooks": {
"prebuild": {
"commands": ["./my-custom-prebuild"]
},
"postbuild": {
"commands": ["./my-custom-postbuild"]
},
"precreate": {
"commands": ["echo 'test'"]
},
"postcreate": {
"commands": ["./setup.sh"]
}
}
}

View File

@@ -7,7 +7,6 @@
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions:exportTable",
"deployFT": "firebase deploy",
"logs": "firebase functions:log"
},

14
netlify.toml Normal file
View File

@@ -0,0 +1,14 @@
[build]
base = www
command = "yarn build"
publish = "www/build/"
[context.deploy-preview]
command = "yarn start"
[template.environment]
REACT_APP_FIREBASE_PROJECT_ID = "you firebase project Id"
REACT_APP_FIREBASE_PROJECT_WEB_API_KEY = "your firebase web api key"
REACT_APP_ALGOLIA_APP_ID = "optional algolia app id"
REACT_APP_ALGOLIA_SEARCH_API_KEY = "optional search api key"

View File

@@ -18,7 +18,6 @@ import Chip from "@material-ui/core/Chip";
import { saveAs } from "file-saver";
import { SnackContext } from "contexts/snackContext";
import { FireTableFilter } from "hooks/useFiretable";
import { useFiretableContext } from "contexts/firetableContext";
import { db } from "../../firebase";
import { FieldType } from "constants/fields";