Skip to content

Commit

Permalink
Merge pull request #89 from student-techlife/dev
Browse files Browse the repository at this point in the history
Final version
  • Loading branch information
klaasnicolaas authored Jul 3, 2020
2 parents 7104aff + e1794ae commit a392e1b
Show file tree
Hide file tree
Showing 88 changed files with 17,752 additions and 275 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:lts

WORKDIR /workspaces

# Set an environment variable to be able to detect we are in dev container
ENV NODE_ENV=devcontainer

EXPOSE 3000
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "frontend.binnentuin",
"dockerFile": "Dockerfile",
"appPort": [
3000
],
"settings": {
"editor.rulers": [80, 100, 120],
"editor.renderWhitespace": "boundary",
"errorLens.gutterIconsEnabled": true,
"errorLens.addAnnotationTextPrefixes": false,
"errorLens.enabledDiagnosticLevels": [
"error",
"warning"
],
"terminal.integrated.shell.linux": "/bin/bash",
"[markdown]":{
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 80,
}
}
}
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.github
node_modules
node_modules
extra
10 changes: 10 additions & 0 deletions .github/reviewer-lottery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
groups:
- name: devs
reviewers: 1
usernames:
- klaasnicolaas
- larsniet
- draZer0
- veracompagner
- annesophie-h
- Joeriubink
35 changes: 35 additions & 0 deletions .github/trafico.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Add WIP labels for PRs that are set to be work-in-progress, no other label will be added.
addWipLabel: true

# Configuration for labels, set ignore to true to skip adding label
labels:
wip:
name: "🚧 WIP"
color: "#FBCA04"
description: "Still work-in-progress, please don't review and don't merge"
ignore: false
unreviewed:
name: "🔍 Ready for Review"
color: "#334796"
description: "Pull Request is not reviewed yet"
ignore: false
approved:
name: "✅ Approved"
color: "#0E8A16"
description: "Pull Request has been approved and can be merged"
ignore: false
needsMoreApprovals:
name: "🌟 Needs more Approvals"
color: "#96C823"
description: "Pull Request needs more approvals"
ignore: true
changesRequested:
name: "⚠️ Changes requested"
color: "#AA2626"
description: "Pull Request needs changes before it can be reviewed again"
ignore: false
merged:
name: "✨ Merged"
color: "#6F42C1"
description: "Pull Request has been merged successfully"
ignore: true
29 changes: 19 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Binnentuin - Frontend
name: Binnentuin - Frontend deploy
on:
push:
# Negeer commits die zijn gemaakt in:
paths-ignore:
- '.github/**'
- 'extra/**'
- '.vscode/**'
- '.devcontainer/**'
- 'README.md'
- LICENSE
# De branch waarop het getriggerd wordt
branches:
- dev

Expand All @@ -16,15 +25,15 @@ jobs:
- name: Docker registry login
# run: docker login ${{ secrets.DOCKER_REGISTRY }}:5000
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Create backend.conf file
run: |
mkdir location
cd location
echo "$BACKEND_LOCATION" > backend.conf
shell: bash
env:
BACKEND_LOCATION: ${{ secrets.BACKEND_LOCATION }}
working-directory: nginx/sites-available
# - name: Create backend.conf file
# run: |
# mkdir location
# cd location
# echo "$BACKEND_LOCATION" > backend.conf
# shell: bash
# env:
# BACKEND_LOCATION: ${{ secrets.BACKEND_LOCATION }}
# working-directory: nginx/sites-available
# Build image {USERID}/REPO:TAG
- name: Create new docker image
run: docker build -t studenttechlife/plant:frontend .
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/merge-conflicts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Check for merge conflicts
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: mschilde/auto-label-merge-conflicts@master
with:
CONFLICT_LABEL_NAME: "merge conflicts"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/review-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Assign to Pull Request
on:
pull_request:
branches-ignore:
- 'dependabot/**'
types: [opened, ready_for_review, reopened]

jobs:
assign:
name: Assign member
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: uesteibar/reviewer-lottery@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: React run test
on:
pull_request:
paths-ignore:
- '.github/**'
- 'extra/**'
branches:
- dev

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node: [ '10', '12', '14']

name: Check Node version ${{ matrix.node }}

steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ yarn-debug.log*
yarn-error.log*

# Files
backend.conf
backend.conf
.idea/
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Generate build",
"type": "shell",
"command": "npm build",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Preview",
"type": "shell",
"command": "npm start",
"group": {
"kind": "test",
"isDefault": true,
}
},
{
"label": "Install Dependencies",
"type": "shell",
"command": "npm install",
"group": {
"kind": "build",
"isDefault": true,
}
},
]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY . /app/
RUN npm run build

# Nginx proxy server
FROM nginx:1.15-alpine
FROM nginx:1.19.0-alpine

# Kopieer react build en conf files naar web server
COPY --from=build-stage /app/build/ /var/www/public
Expand Down
83 changes: 29 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,43 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
![Binnentuin - Frontend deploy](https://github.com/student-techlife/IPMEDT4-binnentuin-frontend/workflows/Binnentuin%20-%20Frontend%20deploy/badge.svg?branch=dev)
[![Netlify Status](https://api.netlify.com/api/v1/badges/6edc5dac-f6ec-4aaf-86f1-8eed4bb01555/deploy-status)](https://app.netlify.com/sites/ipmedt4/deploys)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=student-techlife/IPMEDT4-binnentuin-frontend)](https://dependabot.com)

## Available Scripts
# De Binnentuin app (frontend)

In the project directory, you can run:
Deze repository is de frontend-side van de binnentuin applicatie.

### `npm start`
Het projectgroep bestaat uit:

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
- Klaas
- Lars
- Vera
- Anne-Sophie
- Joeri
- Ard

The page will reload if you make edits.<br />
You will also see any lint errors in the console.
De bestaande readme file van React is [hier te vinden](/extra/README.md).

### `npm test`
## ℹ️ Gebruik van deze repository

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Om zoveel mogelijk git probleempjes te voorkomen, zijn er een aantal richtlijnen:

### `npm run build`
- De `dev` branch is de bakermat van de development.
- 🤷 Wanneer je aan de slag gaat (nieuwe features/bugfix etc.) werk je in een branch die afstamt van de `dev` branch. Middels een **Pull Request** met als target branch `dev`, voeg je uiteindelijk je wijzigingen samen.
- 📅 Wanneer we tot een stable release komen, volgt er een merge van `dev` naar `master` met een release tag.
- ⛔ Er mogen geen directe commits worden uitgevoerd op de `dev` en `master` branch (uitzonderingen daargelaten, branches zijn protected).
- 🔎 Een PR dient door iemand anders dan je zelf te worden **gereviewed** en **gemerged**, iedereen krijgt automatisch een PR ter review toebedeeld.

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
# 🧰 Hoe aan de slag?

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
Hieronder staat beschreven hoe je een werk omgeving kan opzetten. Kom je er niet uit? Geef dit dan aan binnen het team 😄 Heb je problemen met GIT? Bekijk dan de [eerste hulp bij GIT problemen](/extra/help.md) pagina.

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
## Opzetten werk omgeving

### `npm run eject`
1. Clone deze repository naar een gewenste directory: `git clone [email protected]:student-techlife/IPMEDT4-binnentuin-frontend.git`
2. Open het project in VSCode en installeer alle packages: `npm install`
3. Happy programming! Voor het lokaal bekijken van je werk: `npm start`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
Het is ook mogelijk om te werken binnen een devcontainer, meer info daarover [vind je hier](https://code.visualstudio.com/docs/remote/containers).

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
---
Dit project is naar aanleiding van een studie project aan de Hogeschool van Leiden.
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
Loading

0 comments on commit a392e1b

Please sign in to comment.