https://github.com/itk-dev/b7
System til visning og administration af tilfredshedsundersøgelser
https://github.com/itk-dev/b7
Last synced: 5 months ago
JSON representation
System til visning og administration af tilfredshedsundersøgelser
- Host: GitHub
- URL: https://github.com/itk-dev/b7
- Owner: itk-dev
- Created: 2019-03-05T08:25:48.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-02-02T11:55:34.000Z (about 3 years ago)
- Last Synced: 2025-02-13T08:17:29.982Z (about 1 year ago)
- Language: PHP
- Size: 611 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# B7
System for showing and managing simple surveys.
**Built with:**
- [Symfony](https://symfony.com)
- [EasyAdmin](https://symfony.com/doc/master/bundles/EasyAdminBundle/index.html)
- [EasyAdmin Extension](https://github.com/alterphp/EasyAdminExtensionBundle)
- [FOSUserBundle](https://symfony.com/doc/master/bundles/FOSUserBundle/index.html)
- [Doctrine Extensions](https://github.com/beberlei/DoctrineExtensions)
- [Encore](https://symfony.com/doc/current/frontend/encore/installation.html) enabled
**Extendings of existing functionality**
This project adds some extra functionality based on roles when creating entities in the ui and listing entities in the ui.
This means that when you set the role property on a field in config/packages/easy_admin.yaml it will affect the fields in
the create and edit form and in the table when listing entities.
Example for list action:
```yaml
# config/packages/easy_admin.config
# Here only users with the ROLE_ADMIN role will see the user field in the listing view.
Survey:
class: App\Entity\Survey
role: ROLE_USER
list:
fields:
- id
- title
- question
- { property: 'user', role: ROLE_ADMIN }
```
Example for form:
```yaml
# config/packages/easy_admin.config
# Here only users with the ROLE_ADMIN role will see the user field when creating and editing Surveys.
# NB! This overrides the EasyAdmin extension functionality that hides fields when setting the role property.
Survey:
class: App\Entity\Survey
role: ROLE_USER
form:
fields:
- title
- question
- positive_follow_up
- negative_follow_up
- follow_up_text_1
- follow_up_text_2
- follow_up_text_3
- follow_up_text_4
- follow_up_text_5
- { property: 'user', role: ROLE_ADMIN }
```
## Getting started
### Prerequisites
You need Docker for running this project.
The [itkdev-docker-compose](https://github.com/aakb/itkdev-docker#helper-scripts) helper scripts is nice to have, but not required. Although almost all following examples of interactions with the docker containers will use the helper scripts.
### Installing
Create local copy of .env file in your project directory:
```sh
cp .env .env.local
```
And fill out the database settings and mail settings in your .env.local:
```
# .env.local
DATABASE_URL=mysql://db:db@mariadb:3306/db
MAILER_URL=smtp://mailhog
```
Start docker containers:
```sh
docker-compose up -d
```
Make composer install dependencies and create needed directories:
```sh
itkdev-docker-compose composer install
```
Run the migrations:
```sh
itkdev-docker-compose bin/console doctrine:migrations:migrate --no-interaction
```
Create a super admin user:
```sh
itkdev-docker-compose bin/console fos:user:create --super-admin
```
Install front-end tools and run encore (webpack)
```sh
itkdev-docker-compose run yarn install
itkdev-docker-compose run yarn encore dev
```
Open up the url for the nginx container:
```sh
# Outputs the url to the site
itkdev-docker-compose url
# Opens the site in the default browser
itkdev-docker-compose open
```