diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b079b0d..d5bbf6d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,15 @@ jobs: test: name: Test runs-on: ubuntu-latest + env: + REACT_APP_STORAGE_BUCKET: ${{ secrets.REACT_APP_STORAGE_BUCKET }} + REACT_APP_PROJECT_ID: ${{ secrets.REACT_APP_PROJECT_ID }} + REACT_APP_MSG_SENDER_ID: ${{ secrets.REACT_APP_MSG_SENDER_ID }} + REACT_APP_MEASUREMENT_ID: ${{ secrets.REACT_APP_MEASUREMENT_ID }} + REACT_APP_DB_URL: ${{ secrets.REACT_APP_DB_URL }} + REACT_APP_AUTH_DOMAIN: ${{ secrets.REACT_APP_AUTH_DOMAIN }} + REACT_APP_APP_ID: ${{ secrets.REACT_APP_APP_ID }} + REACT_APP_API_KEY: ${{ secrets.REACT_APP_API_KEY }} steps: - uses: actions/checkout@v2 - name: Install dependencies @@ -16,3 +25,16 @@ jobs: with: start: yarn start wait-on: 'http://localhost:3000' + release: + if: ${{ github.ref == 'master' }} + needs: test + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: yarn build + - name: Install Firebase CLI tools + run: yarn global add firebase-tools + - name: Deploy + run: firebase deploy --token ${{ secrets.FIREBASE_TOKEN }} diff --git a/.gitignore b/.gitignore index 16901e6..f73c45d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ # testing /coverage /cypress/integration/examples +/cypress/fixtures/ +/cypress/screenshots/ # production /build @@ -24,3 +26,10 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.env +.firebase +firebase.json +firestore.indexes.json +*rules +.firebaserc \ No newline at end of file diff --git a/README.md b/README.md index 879fabb..3f8efd1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ # DevBook + + Social App for connecting with developers & tech enthusiasts. +🕸 [Check it out!](https://devbook.onrender.com/) + ## Tests ### End-to-end @@ -16,11 +20,26 @@ yarn cypress and edit your E2E test cases in `cypress/integration/` folder. +### Unit + +Open test runner with: + +```sh +yarn test +``` + +## Deployment + +We use Github Actions to check push and pull requests. + +The application is deployed on [Render](https://render.com) cloud platform. +It watches git `master` branch and automatic deploy if the diff passes the tests. + ## Built With - [ReactJs](https://reactjs.org/) - A JavaScript library for building user interfaces - [Redux](https://redux.js.org/) - A predictable statea container for JavaScript apps -- [Firebase](https://fiirebase.google.com/) - Firebase helps mobile and web app teams succeed +- [Firebase](https://firebase.google.com/) - Firebase helps mobile and web app teams succeed ## Versioning diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json deleted file mode 100644 index da18d93..0000000 --- a/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file diff --git a/cypress/integration/landing.spec.js b/cypress/integration/landing.spec.js new file mode 100644 index 0000000..884a2b4 --- /dev/null +++ b/cypress/integration/landing.spec.js @@ -0,0 +1,6 @@ +describe('Landing page', () => { + it('contains app name', () => { + cy.visit('/'); + cy.get('h1').contains('DevBook'); + }); +}); diff --git a/cypress/integration/layout.spec.js b/cypress/integration/layout.spec.js new file mode 100644 index 0000000..28e6d62 --- /dev/null +++ b/cypress/integration/layout.spec.js @@ -0,0 +1,6 @@ +describe('App Layout', () => { + it('contains a navbar', () => { + cy.visit('/'); + cy.get('nav'); + }); +}); diff --git a/cypress/integration/smoke.spec.js b/cypress/integration/smoke.spec.js deleted file mode 100644 index ebf3e7d..0000000 --- a/cypress/integration/smoke.spec.js +++ /dev/null @@ -1,6 +0,0 @@ -describe('smoke', () => { - it('sees learn', () => { - cy.visit('/'); - cy.get('a').contains('Learn'); - }); -}); diff --git a/firestore.indexes.json b/firestore.indexes.json new file mode 100644 index 0000000..0b113bd --- /dev/null +++ b/firestore.indexes.json @@ -0,0 +1,117 @@ +{ + "indexes": [ + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "category", + "order": "ASCENDING" + }, + { + "fieldPath": "avgRating", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "category", + "order": "ASCENDING" + }, + { + "fieldPath": "numRatings", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "category", + "order": "ASCENDING" + }, + { + "fieldPath": "price", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "city", + "order": "ASCENDING" + }, + { + "fieldPath": "avgRating", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "city", + "order": "ASCENDING" + }, + { + "fieldPath": "numRatings", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "city", + "order": "ASCENDING" + }, + { + "fieldPath": "price", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "price", + "order": "ASCENDING" + }, + { + "fieldPath": "avgRating", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "restaurants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "price", + "order": "ASCENDING" + }, + { + "fieldPath": "numRatings", + "order": "DESCENDING" + } + ] + } + ], + "fieldOverrides": [] +} diff --git a/package.json b/package.json index 52c8b59..8b26dce 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,13 @@ "version": "0.1.0", "private": true, "dependencies": { + "@fortawesome/fontawesome-free": "^5.13.0", + "@fortawesome/fontawesome-svg-core": "^1.2.28", + "@fortawesome/free-brands-svg-icons": "^5.13.0", + "@fortawesome/free-regular-svg-icons": "^5.13.0", + "@fortawesome/free-solid-svg-icons": "^5.13.0", + "@fortawesome/react-fontawesome": "^0.1.9", + "@reduxjs/toolkit": "^1.3.6", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", @@ -10,11 +17,20 @@ "@types/node": "^12.0.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.9.0", + "@types/react-redux": "^7.1.8", + "@types/react-router-dom": "^5.1.5", "cypress": "^4.5.0", + "firebase": "^7.14.3", + "moment": "^2.25.3", "react": "^16.13.1", "react-dom": "^16.13.1", + "react-google-button": "^0.7.1", + "react-redux": "^7.2.0", + "react-redux-firebase": "^3.4.0", + "react-router-dom": "^5.2.0", "react-scripts": "3.4.1", - "typescript": "~3.7.2" + "redux-firestore": "^0.13.0", + "typescript": "^3.9.2" }, "scripts": { "start": "react-scripts start", @@ -38,4 +54,4 @@ "last 1 safari version" ] } -} \ No newline at end of file +} diff --git a/public/index.html b/public/index.html index aa069f2..112696b 100644 --- a/public/index.html +++ b/public/index.html @@ -4,40 +4,18 @@ - + - - -