This is the frontend part of SEP4 Group 4X – a Greenhouse Application 🍅. It is hosted on github pages and is connected to the backend part via a RESTful API. Another part of the project is the IoT group, responsible for the physical device.
The project uses many different technologies, namely:
- React
- Typescript
- Tailwind CSS
- Material UI
- Node.js
First of all, download the packages using the npm i
command. Then, start the app using npm start
.
-
If the app was running, stop it.
-
Change the REACT_APP_API_BASE_URL environmental variable in the .env file to http://localhost:3100 and save the file.
-
Run
npm run mocks
and wait for the mock server to start -
Run
npm start
.
The branches and pull requests followed a special convention, agreed upon before even creating the repository. Every branch name consists of three parts:
- Group identifier
- ID number
- Short description
An example branch name would be feat-68-create-apply-presets
The group identifier can take one of three values:
- feat for adding a new feature
- bug for providing fixes to known bugs
- exp for experimental features not intended for main branch
The ID number is a number of the issue on Jira.
The short description is limited to 4-5 words, to fit the 50 character rule. It should describe the feature added or bug fixed.
To make sure there was minimal friction between the contributors while developing, it was agreed that Node.js v18.15.0 should be used. Besides that, the development was conducted using Visual Studio Code with several extensions:
- ESLint, for making sure the code followed best practices
- Prettier, for keeping the formatting consistent
- Tailwind CSS Intellisense, for speeding up the dev process by providing a quick properties lookup
- Remote development, for creating and using the dev containers
Working with containers is straightforward when the instructions are followed properly:
- Pull the latest version of the main branch
- Create a new branch that adheres to the convenction
- Open the terminal and go into the project directory
- Run
docker build -t frontend .
to create a new image - Run
docker run -dp 3000:3000 --name frontend-container frontend
to create a container from the image - Attach VSCode to the container
- Start developing
- Create a pull request
- When the pull request is merged, delete the branch, container and image
Different testing frameworks and approaches were used throughout the development process of the project.
To generate test coverage, run the following command: npm run test:coverage
. The test coverage will be generated in the console.