A lightweight survey application that helps researchers self‑assess their online visibility. It consists of a React frontend and a Laravel (PHP) backend with a MariaDB database.
- Overview
- Technology Stack
- Requirements
- Getting Started
- Manual Backend Setup
- Frontend Development (Local)
- Configuration
- Backend Production build
- Visibility Survey User Session and Progress
- NPM Scripts
- Learn More
Visibility Check enables researchers to answer a set of questions about their online presence. Answers are stored anonymously via the backend API; Administrators can manage the survey content via the admin interface.
-
Frontend: React, Material UI
- https://create-react-app.dev/
- https://reactjs.org/
- https://mui.com/ (formerly material-ui.com)
- https://nginx.org
-
Backend: PHP (Laravel), MariaDB
- Docker and Docker Compose (recommended), or
- Node.js (for local frontend development)
- PHP 8.2 and Composer (for backend), MariaDB 12
A docker-compose.yaml is provided to build and run the full stack. On the first run, the database will be created and seeded automatically.
The backend app is mounted as a volume, so changes to the code will be reflected immediately in the running container.
The stack is configured to run on port 8088 for the frontend and 8089 for the admin app
- Install Docker and Docker Compose.
- Install composer
- In the backend/ directory run
composer install
- From the project root, start the docker stack. This will build the frontend app and the backend app.
docker compose up --build
- You will now have a running application, you can access the apps:
- Frontend: http://localhost:8089
- Admin: http://localhost:8088/admin
- API base URL: http://localhost:8088/api
- Open the admin UI: http://localhost:8088/admin
- Log in with the default credentials:
- Email:
test@example.com - Password:
password
- Email:
!! Change these credentials immediately in any non-test environment !!
Only needed if you do not use Docker and prefer running locally or on your own server.
- Create the database and set connection details in
backend/.env. - Generate an APP_KEY it will be written to the
.envfilephp artisan key:generate
- Run migrations to create tables (in backend/ directory):
php artisan migrate
- Seed the database with initial content (in backend/ directory):
php artisan db:seed
To further deevelop and customize the app you can run the React dev server for a fast feedback loop; the server rebuilds on file save.
-
Install Node.js
-
Go to the frontend directory:
cd frontend -
Install JS dependencies:
npm install
-
If needed adjust the configuration in
frontemd/.env.development: -
Start the React dev server:
npm start
-
Develop as usual; the dev server auto-reloads on save.
The frontend dev and production build uses the REACT_APP_ prefix for environment variables. Refer to the react-app manual for more information: https://create-react-app.dev/docs/adding-custom-environment-variables/
Two variables are needed:
REACT_APP_API_URL: Base URL of the API that serves questions and stores answers.REACT_APP_FEEDBACK_FORM_URL: URL of the external feedback form that is displayed at the end of the survey.
The backend is configured via the .env file in the backend/ directory.
This configuration follows the normal Laravel configuration format.
This app has a minimal user management. Users can be added via the admin app.
https://localhost:8088/register
A prod.Dockerfile is provided as an example to build a production-ready Docker image. This Dockerfile import the laravel dependencies first with a composer container and then copies the source code to a new PHP/Apache container.
The user session is stored in the database and is managed by the backend. The session is identified by a unique session ID and is only attached to the user's browser. No personal data is stored
In the project directory, you can run:
Runs the app in development mode and opens http://localhost:3000. The page reloads on edits and displays lint errors in the console.
Launches the test runner in watch mode. See Create React App docs for details.
Builds the app for production to the frontend/build folder. React is bundled in production mode and optimized for performance. Filenames include content hashes.
Note: this is a one-way operation. Once you eject, you cannot go back.
If the default configuration is insufficient, eject will copy all config files and dependencies (Webpack, Babel, ESLint, etc.) into your project so you have full control. All commands except eject will continue to work, but they will reference the copied scripts.
- Create React App: https://facebook.github.io/create-react-app/docs/getting-started

