Malfunction report system for Gomibo's maintaiance team in Groningen.
For the backend, you need:
- php 8.1
- php8.1-curl
- php8.1-xml
- php8.1-mysql
- php8.1-mbstring
- php-gd
- composer
- Docker desktop
For the frontend, you need:
Make sure you meet all the prequisites to deploy the application.
first off, you want to run the setup.sh.
bash setup.sh
To setup the database, follow the steps:
- Start with the following command.
cd backend/
./vendor/bin/sail up mysql phpmyadmin -d
# starts docker container with mysql db and phpmyadmin db manager.
- Wait until the database is ready to accept connections. See docker container logs to know when ready.
- Migrating the database:
# execute in backend/
php artisan migrate
In case you want to start with a test user.
# execute in backend/
php artisan db:seed
# execute in backend/
./vendor/bin/sail up mysql phpmyadmin -d
php artisan serve
Runs the app in the development mode.
The default port 8000.
# execute in frontend/
npm start
Runs the app in the development mode.
The default port 3000, Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any errors in the console.
For coverage value analysis install:
Ensure that the database is running.
# execute in backend/
php artisan migrate --database=testing
php artisan test
For coverage analysis execute:
php artisan test --coverage
The default setting is:
- go to http://localhost:8001
- login with credentials in
.envfile (default username=root, empty password)
To test out the API through the openAPI specification
- Either go to
https://editor.swagger.io/and open apispec.yml.
Or
Install the Swagger Viewer vscode extension (testing might not work)\ - change the
cors.phpfile located inbackend/config/and change the'allowed_origins'value to'allowed_origins' => ['*'].
This allows any location to send requests to your backend. For security reasons, set the value back to your frontend url.
You can test the api if you have the backend and database running.
This application has the capability to automatically send emails to reporters who choose to receive so. To enable this a mailing host is required. To enable mailing please set the correct values in the .env file for MAIL_HOST, MAIL_PORT,MAIL_USERNAME and MAIL_PASSWORD corresponding to those of your host.