{"id":18774270,"url":"https://github.com/leny/mwenbwa","last_synced_at":"2026-06-30T18:31:52.801Z","repository":{"id":72964638,"uuid":"281703999","full_name":"leny/mwenbwa","owner":"leny","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-22T14:45:45.000Z","size":767,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T02:05:31.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-22T14:44:48.000Z","updated_at":"2020-07-22T14:45:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c966901-5a78-419c-a456-10d2e00a1337","html_url":"https://github.com/leny/mwenbwa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leny/mwenbwa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fmwenbwa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fmwenbwa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fmwenbwa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fmwenbwa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leny","download_url":"https://codeload.github.com/leny/mwenbwa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fmwenbwa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34979577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T19:37:52.554Z","updated_at":"2026-06-30T18:31:52.774Z","avatar_url":"https://github.com/leny.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mwenbwa\n\n\u003e A web-based game of conquests… and trees\n\n* * *\n\n## Introduction\n\nBased on [external data](https://data.gov.be/en/node/48556), you will create a WebApp consisting of a REST-like API (back-end) and a React SPA (front-end). This WebApp will consist be an online [IDLE Game](https://en.wikipedia.org/wiki/Incremental_game), based in Liège.\n\n## Mwenbwa - game rules\n\nIn a map of Liège, there will be trees. Each tree as a _value_ (which is the product of his _diameter_ by his _height_, *rounded to top*). \n\n\u003e This value will use the \"leaf\" as unit. For instance, a tree of 9m of diameter and 17.3m of size will have a value of (`9 × 17.3 = 155.7 ≈ 156`) **156 leaves**.\n\nWhen a player enter the game, he needs to create an account, will choose a color, and will receive three random, *free* tree (and some bonus leaves, following the formula: `[total leaves of players] / [amount of players]`).  \nEvery fifteen minutes **in real life**, each player will receive an amount of leaves equals to the total of each of his trees.  \nEvery hour **in real life**, each player loose half his leaves.\n\n\u003e 👉 It can be useful to change these values during the development. Be sure they are easy to change and adapt.\n\nWhenever he wants, a player can _buy_ a tree. \n\n- If the tree is *free*, the _value_ of the tree is its price. When a player buy a *free tree*, a [random name](https://www.npmjs.com/package/fantasy-name-generator) is affected to that tree.\n- If the tree belongs to another player, the price is computed with the following formula: `[value of the targetted tree] + ([value of all the targetted player's trees in 100m radius] × ([amount of trees in 100m radius] / [amount of tree of targetted player in 100m radius])) + [value of all the other players trees in 100m radius] - [value of all your tree in 100m radius]`.\n\nWhenever he wants, a player can *lock* a tree by paying the following formula: `[value of the tree] × 10 + ([value of all the trees in 100m radius] × [amount of players in 100m radius]) - ([value of all player's trees in 100m radius] / [amount of players in 100m radius])`. A *locked tree* can't be buy by another player.\n\nAt anytime, a player can check the *leaderboard*, to see each player score, amount of trees, etc.  \nAt anytime, a player can consult the *gamelog*, which record all actions in the game.\n\nWhen clicking on a tree, a player can see its value, name, owner, history of buys, and a link to the relative wikipedia article for this tree's species (if applicable). Any player can also leave a comment on a tree.\n\n## Implementation\n\nThere's a lot of things to do in this project. Besides some constraints listed bellow, you're free to use anything you want for this project.\n\n### Data\n\nYou can find the data of the trees in the JSON file stored in the `data` folder. These data came from the [Belgium OpenData Initiative website](https://data.gov.be).\n\nYou will need to convert and store the data into a MongoDB database. Be sure to design your schema regarding the rules of the game.\n\n### Interactive map\n\nOf course, you'll need to use an interactive map to show all the trees. \n\n\u003e 👉 **OpenStreetMap** is actually the best choice, you will have to use it with **Leaflet**.\n\n### Mockup \u0026 Design\n\nWe didn't made any mockup nor design for this project, the first task of your group will be their conception.\n\n### Technical Stack\n\nYou actually have a **technical stack** to follow.\n\n#### Back-end\n\nA `REST-like API` using:\n\n- **Node.JS**\n- **MongoDB**\n\n#### Front-end\n\nA `Single Page App` using:\n\n- **React**\n- **Leaflet**\n\n#### Toolchain / Dev Env\n\nThe project is divided in two distinct parts: back-end and front-end. We prepared a starter with a premade dev environment that can be used again for other following projects. \n\n##### Environment\n\nThe project is provided with a `docker-compose.yml` and its documentation in markdown: [`docker-readme.md`](./docker-readme.md).\nThe whole project's code will be written in `src`. The compiling tools are configurated to push the compilated files in the `bin` folder.\n\n\u003e ⚠️ **WARNING:** Never **ever** put your modifications to the project in the bin's files ! He will be replaced by a new bin folder at your next compilation!\n\n##### Back-end\n\nBack-end part will be compiled with [BabelJS](https://babeljs.io). The back-end's code is located in  `src/server`.\n\nWe prepared for you a little snippet of functionnal code that configure your server **express**, an API route : `GET /hello` and the middleware *middleware* **static** to display de client's files.\n\nYou are free to use this snippet or rewrite it. \n \n###### Compilation\n\nThere is two compilation's options :\n\n- `npm run build:server` (compile your code)\n- `npm run work:server` (compile then observe your files and recompile if you make any modifications)\n\u003e ☝️ **NOTE:** Do not forget to run your docker-compose before building the back-end part.\n\n##### Front-end\n\nFor the front-end part your code will be compiled/packaged with [Webpack](https://webpack.js.org/). The code is written in `src/client`.\n\n\u003e ☝️ **NOTE:** Webpack is a powerfull tool that can be complex to learn. We suggest you to take some time to learn this tool during your \"pâturages\" and maybe provide your collegues a workshop about it.\n\nLike the back-end part, we prepared a little snippet of code displaying a React component with the text \"*Hello, World*\".\n \n###### Compilation\n\nTo compile the front-end code there is two options:\n\n- `npm run build:client` (compile your code)\n- `npm run work:client` (compile then observe your files to recompile them in case of any modifications)\n\n##### Prettier \u0026 ESLint\n\nThe project is configured to use  [Prettier](https://prettier.io) \u0026 [ESLint](https://eslint.org).\n\n###### Compilation\n\nTo check your files with ESLint and Prettier you can also run this command:  `npm run lint`.\n\n###### Hooks git\n\nThe project is also configured with a *hook* de **precommit** for git: when you will try to commit your files, ESLint and Prettier will be executed and, in case of error, the commit will be canceled to let you correct your mistakes. This way you will have the certitude of commiting files exempt of potential problems. \n\n#### Deployment\n\nWe are expecting a **functionnal** and *deployed* project.\nOne of the solutions is to use [**Heroku**](https://www.heroku.com). To host your Database, Heroku is working with [**mLab**](https://mlab.com) .\n\n* * *\n\n## Deadline\n\nThe project **have** to be online the **26/06/2020 16H59**.  \nWe are expecting an e-mail for each group with a link to the repository and a link to the application in production.\n\nHave fun and good work.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleny%2Fmwenbwa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleny%2Fmwenbwa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleny%2Fmwenbwa/lists"}