From 9fb9913bc5ccc49d738481fa71c5ba75c43ed532 Mon Sep 17 00:00:00 2001 From: Marco de Wild Date: Fri, 15 Jan 2021 15:59:16 +0100 Subject: Modified Readme for the MVc case --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 18f211d..d097e17 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,13 @@ This repository contains the files for three modules: - Model view controller: build a website for your own mancala game (or use the sloppy default implementation). - CI/CD: run your tests automatically when pushing code to Gitlab. -The skeleton project for the MVC is found on the mvc branch. On that branch, the README is updated with additional information. ## Repository structure - Main folder (this folder): contains the files relevant for the whole project. For example the Gradle-wrapper files, the .gitignore, and this readme. +- api/: contains the files for the API or service layer of your application. +- api/src/main/java/mancala/api: contains the web endpoints. +- api/src/main/java/mancala/api/models: contains the web endpoints. - domain/: contains the files that model the business domain (game rules). This is the folder you develop your OO mancala case in. ## Java project structure @@ -50,17 +52,14 @@ Replace the `./gradlew` command with `gradle` if using the globally installed Gr ## Assignment -For the lectures, see [the drive](https://drive.google.com/drive/u/0/folders/1NK95KK9Ev1yZAz1vLoQSO8rEkZq-A9AC). +For the lecture, see [the drive](https://drive.google.com/drive/u/0/folders/1PvC-HS8ty3mdtSaNdR5rt5-GwL-5_LaY). -Design an object-oriented model for mancala that can handle the following scenarios: +The global goal is to make a web front-end to your mancala back-end. A stub has been made. In api/src/test you can find examples of how you can test the api endpoints. -- All small bowls start with 4 beads -- Players take turns making a move -- A player moves by selecting a small bowl on their own side, take all the beads and distribute them anti-clockwise one at a time -- When distributing, players include their own kalaha but not the opponent's -- If a move ends in the own kalaha, the player can make another move. -- If the last bead ends in an empty bowl on the own side, the player can take that bowl's bead and the direct opposite bowl's bead and put them in their kalaha. -- The game ends if all bowls of the turn player are empty -- The winner is the player with the most beads on their territory (all bowls). - -Implement the game rules test-driven. Don't be afraid to delete or modify the Foo(Test) files, as they are just an example. \ No newline at end of file +- Familiarise yourself with the repository. Get the servers running and make sure you can connect to both servers. Enter two names in the boxes. You should see a "TODO" screen. +- Show the mancala game when it is started. +- If you want to use your own implementation, reference your implemenation in the `MancalaImpl` class. +- Build the API endpoint to make a move. +- Show the winner as soon as the game is over. +- Optionally, allow for a "revenge" option in which two players can play again. +- Optionally, allow an ongoing game to continue after a page refresh. \ No newline at end of file -- cgit v1.2.3 From 1a6eeaa4b4f060ad05a6bd297702d246aba69313 Mon Sep 17 00:00:00 2001 From: Marco de Wild Date: Fri, 15 Jan 2021 15:59:16 +0100 Subject: Modified Readme for the MVc case --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ad46ee4..2126ff3 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,13 @@ This repository contains the files for three modules: - Model view controller: build a website for your own mancala game (or use the sloppy default implementation). - CI/CD: run your tests automatically when pushing code to Gitlab. -The skeleton project for the MVC is found on the mvc branch. On that branch, the README is updated with additional information. ## Repository structure - Main folder (this folder): contains the files relevant for the whole project. For example the Gradle-wrapper files, the .gitignore, and this readme. +- api/: contains the files for the API or service layer of your application. +- api/src/main/java/mancala/api: contains the web endpoints. +- api/src/main/java/mancala/api/models: contains the web endpoints. - domain/: contains the files that model the business domain (game rules). This is the folder you develop your OO mancala case in. ## Java project structure @@ -50,17 +52,14 @@ When you run the test, you will see a build failure. In `domain/src/test/java/ma ## Assignment -For the lectures, see [the drive](https://drive.google.com/drive/u/0/folders/1NK95KK9Ev1yZAz1vLoQSO8rEkZq-A9AC). +For the lecture, see [the drive](https://drive.google.com/drive/u/0/folders/1PvC-HS8ty3mdtSaNdR5rt5-GwL-5_LaY). -Design an object-oriented model for mancala that can handle the following scenarios: +The global goal is to make a web front-end to your mancala back-end. A stub has been made. In api/src/test you can find examples of how you can test the api endpoints. -- All small bowls start with 4 beads -- Players take turns making a move -- A player moves by selecting a small bowl on their own side, take all the beads and distribute them anti-clockwise one at a time -- When distributing, players include their own kalaha but not the opponent's -- If a move ends in the own kalaha, the player can make another move. -- If the last bead ends in an empty bowl on the own side, the player can take that bowl's bead and the direct opposite bowl's bead and put them in their kalaha. -- The game ends if all bowls of the turn player are empty -- The winner is the player with the most beads on their territory (all bowls). - -Implement the game rules test-driven. Don't be afraid to delete or modify the Foo(Test) files, as they are just an example. \ No newline at end of file +- Familiarise yourself with the repository. Get the servers running and make sure you can connect to both servers. Enter two names in the boxes. You should see a "TODO" screen. +- Show the mancala game when it is started. +- If you want to use your own implementation, reference your implemenation in the `MancalaImpl` class. +- Build the API endpoint to make a move. +- Show the winner as soon as the game is over. +- Optionally, allow for a "revenge" option in which two players can play again. +- Optionally, allow an ongoing game to continue after a page refresh. \ No newline at end of file -- cgit v1.2.3 From 7b1b8a35db9699240b6c5243cd89ef0be7fd798a Mon Sep 17 00:00:00 2001 From: Marco de Wild Date: Tue, 19 Jan 2021 15:15:14 +0100 Subject: Clarified the 'stuck' build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2126ff3..2e9dd60 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ You can either install Gradle on your machine and use the installation or use th ./gradlew run ``` -When you run the test, you will see a build failure. In `domain/src/test/java/mancala/domain.FooTest.java`, there is a failing test. If you fix the failing test, the build will succeed. +If you run the program, you will notice the build "progress" is stuck on 87% or so. That means your application is running and Gradle is waiting for it to succeed. You can ignore the progress bar when running the application; it should print some lines when it's ready. ## Assignment -- cgit v1.2.3 From f382ec567e1292cedee7c01e721ddc38bdc4dc4e Mon Sep 17 00:00:00 2001 From: "SOGYO\\bvdoord" Date: Tue, 26 Jan 2021 11:22:58 +0100 Subject: Front-end met Snowpack toegevoegd --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index d097e17..5512b82 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,48 @@ This repository contains the files for three modules: - api/src/main/java/mancala/api: contains the web endpoints. - api/src/main/java/mancala/api/models: contains the web endpoints. - domain/: contains the files that model the business domain (game rules). This is the folder you develop your OO mancala case in. +- client/: contains the front end + +## Two servers + +The project consists of two servers. The front-end uses a nodejs server. It is mainly used to compile your React code into Javascript files during development. This will shorten the feedback loop between changing your code and seeing the results in the browser. The second server is the back-end, which uses a Jetty server. The back-end server allows your Java API to be accessible for other programs, including the front-end server. To prevent [cross-origin request shenanigans (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), all requests from the browser will be sent to the front-end server. That server will then forward to the back-end server if needed. + +The front-end assumes that the back-end will run on port 8080. If that is not the case, edit the snowpack.config.js file. + + +## React project structure + +A React project is generally structured as follows: + +``` +package.json +public/ + index.html +src/ + Feature1/ + Feature1.css + Feature1.tsx + Feature1.tests.tsx + Feature2/ + Feature2.css + Feature2.tsx + Feature2.tests.tsx + Feature2B.tsx + Feature2B.tests.tsx +``` + +The public directory contains static files, such as the relatively empty index.html file needed to run React. The src file contains the React code. The convention for TypeScript projects is to use the .tsx file extension for files that contain React components. Files are generally grouped together in directories by feature. These directories contain all files related to that feature, such as coponents, stylesheets, images and tests. + +The package.json specifies which commands can be run using npm (e.g. npm run start). In this sample repository, two commands have been defined: + +```bash +# Start a development server +npm run start +# Check code for common mistakes and style conventions +npm run lint +``` + + ## Java project structure -- cgit v1.2.3 From 51d1d5ac88e0b9def0423906deb5543c4439b125 Mon Sep 17 00:00:00 2001 From: "SOGYO\\bvdoord" Date: Tue, 16 Feb 2021 12:49:56 +0100 Subject: Uitleg voor het installeren/starten toegevoegd --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5512b82..859d23b 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,16 @@ This repository contains the files for three modules: - api/src/main/java/mancala/api: contains the web endpoints. - api/src/main/java/mancala/api/models: contains the web endpoints. - domain/: contains the files that model the business domain (game rules). This is the folder you develop your OO mancala case in. -- client/: contains the front end +- client/: contains the client (front-end) ## Two servers -The project consists of two servers. The front-end uses a nodejs server. It is mainly used to compile your React code into Javascript files during development. This will shorten the feedback loop between changing your code and seeing the results in the browser. The second server is the back-end, which uses a Jetty server. The back-end server allows your Java API to be accessible for other programs, including the front-end server. To prevent [cross-origin request shenanigans (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), all requests from the browser will be sent to the front-end server. That server will then forward to the back-end server if needed. +The project consists of two servers. The front-end uses a Node.js server. It is mainly used to compile your React code into Javascript files during development. This will shorten the feedback loop between changing your code and seeing the results in the browser. The second server is the back-end, which uses a Jetty server. The back-end server allows your Java API to be accessible for other programs, including the front-end server. To prevent [cross-origin request shenanigans (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), all requests from the browser will be sent to the front-end server. That server will then forward to the back-end server if needed. The front-end assumes that the back-end will run on port 8080. If that is not the case, edit the snowpack.config.js file. +To run the application you need to have both servers running at the same time. This probably means you'll need to open two different terminals/command prompts to do so. + ## React project structure @@ -45,7 +47,13 @@ src/ The public directory contains static files, such as the relatively empty index.html file needed to run React. The src file contains the React code. The convention for TypeScript projects is to use the .tsx file extension for files that contain React components. Files are generally grouped together in directories by feature. These directories contain all files related to that feature, such as coponents, stylesheets, images and tests. -The package.json specifies which commands can be run using npm (e.g. npm run start). In this sample repository, two commands have been defined: +## Installating front-end dependencies + +To run the React application you'll first need to install the required dependencies. These dependencies are defined in the package.json file. Run the command `npm install` from the `/client` directory. + +## Running the front-end + +The package.json specifies which commands can be run using npm (e.g. npm run start). In this sample repository, two commands have been defined. You should also run these in the `/client` directory. ```bash # Start a development server -- cgit v1.2.3 From a8a6802755ddcecfb60878dd33503b2b44c05b96 Mon Sep 17 00:00:00 2001 From: "SOGYO\\bvdoord" Date: Mon, 22 Feb 2021 11:31:34 +0100 Subject: Fixed readme error --- README.md | 6 ------ 1 file changed, 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 78573f5..a060a9a 100644 --- a/README.md +++ b/README.md @@ -103,15 +103,9 @@ If you run the program, you will notice the build "progress" is stuck on 87% or ## Assignment For the lecture, see [the drive](https://drive.google.com/drive/u/0/folders/1PvC-HS8ty3mdtSaNdR5rt5-GwL-5_LaY). -<<<<<<< HEAD The global goal is to make a web front-end to your mancala back-end. A stub has been made. In api/src/test you can find examples of how you can test the api endpoints. -======= - -The global goal is to make a web front-end to your mancala back-end. A stub has been made. In api/src/test you can find examples of how you can test the api endpoints. - ->>>>>>> 7b1b8a35db9699240b6c5243cd89ef0be7fd798a - Familiarise yourself with the repository. Get the servers running and make sure you can connect to both servers. Enter two names in the boxes. You should see a "TODO" screen. - Show the mancala game when it is started. - If you want to use your own implementation, reference your implemenation in the `MancalaImpl` class. -- cgit v1.2.3 From b1d70c635794ef33995d65f4d99c7914697bb5ec Mon Sep 17 00:00:00 2001 From: "SOGYO\\bvdoord" Date: Tue, 23 Feb 2021 11:13:18 +0100 Subject: Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index a060a9a..c76d7b7 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ src/ The public directory contains static files, such as the relatively empty index.html file needed to run React. The src file contains the React code. The convention for TypeScript projects is to use the .tsx file extension for files that contain React components. Files are generally grouped together in directories by feature. These directories contain all files related to that feature, such as coponents, stylesheets, images and tests. -## Installating front-end dependencies +## Installing front-end dependencies To run the React application you'll first need to install the required dependencies. These dependencies are defined in the package.json file. Run the command `npm install` from the `/client` directory. -- cgit v1.2.3