Skip to content

Commit 1de2e8f

Browse files
committed
repository clean up and readme update
1 parent 6bdb7da commit 1de2e8f

File tree

7 files changed

+214
-2895
lines changed

7 files changed

+214
-2895
lines changed

README.md

Lines changed: 214 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,229 @@
11
# Survey Dashboard
22

3-
A dashboard to display survey data in an interactive way.
3+
A dashboard to display survey data in an interactive way using Panel and Bokeh.
44

55
## Overview
66

7-
This repository contains a dashboard using Panel and Bokeh, developed to display data from
8-
HMC surveys in an interactive exploratory way. It is designed such that the code for the interactive
9-
visualizations might be reused for other projects.
10-
Example of a deployed version can be found [here](https://dashboard.survey.helmholtz-metadaten.de/survey_dashboard)
7+
This repository contains an interactive dashboard developed to display data from HMC surveys in an exploratory way. The dashboard is designed to be reusable for other survey visualization projects.
8+
9+
**Live Demo:** [https://dashboard.survey.helmholtz-metadaten.de/2021community](https://dashboard.survey.helmholtz-metadaten.de/2021community)
10+
11+
### Screenshots
1112

12-
Some impressions:
1313
![dashboard_overview](https://user-images.githubusercontent.com/24694833/230306080-9ca68ff8-5b8b-4ac4-b2fa-51e2c5361c7d.png)
1414
![dashboard_methods](https://user-images.githubusercontent.com/24694833/230306091-637188a9-359e-4ea0-8432-4d05a1ccc68f.png)
1515
![Dashboard_survey_data_explorer](https://user-images.githubusercontent.com/24694833/230306099-4cf71bda-0990-4f9d-be14-9a65812e7ac4.png)
1616

17+
## Features
18+
19+
- **Interactive Visualizations**: Explore survey data through dynamic charts and plots
20+
- **Multiple Languages**: Support for English and German (configurable via environment variables)
21+
- **Dockerized Deployment**: Production-ready Docker setup with HTTPS support
22+
- **Responsive Design**: Works across different screen sizes
23+
- **Self-hosted Fonts**: Uses HIFIS DIN fonts for consistent branding
24+
1725
## Installation
1826

1927
### Prerequisites
28+
2029
- Python 3.12 or higher
21-
- Poetry (recommended) or pip
30+
- Poetry (recommended for development)
31+
- Docker & Docker Compose (for production deployment)
2232

23-
### Using Poetry (Recommended)
33+
### Local Development Setup
2434

25-
After downloading the git repository, install the dependencies using Poetry:
35+
1. **Clone the repository:**
36+
```bash
37+
git clone https://github.com/Materials-Data-Science-and-Informatics/survey_dashboard.git
38+
cd survey_dashboard
39+
```
2640

27-
```shell
28-
poetry install
29-
```
41+
2. **Install dependencies using Poetry:**
42+
```bash
43+
poetry install
44+
```
45+
46+
3. **Run the development server:**
47+
```bash
48+
poetry run survey-dashboard
49+
```
3050

31-
### Using pip
51+
The dashboard will be available at `http://localhost:5006/2021community/`
3252

33-
Alternatively, you can install directly from the repository:
53+
### Alternative: Using pip
3454

35-
```shell
55+
```bash
3656
pip install .
57+
python -m survey_dashboard.scripts
3758
```
3859

3960
## Usage
4061

4162
### Development Mode
4263

43-
For development, you can run the app directly using Panel serve:
64+
The easiest way to run the dashboard in development mode:
4465

45-
```shell
46-
# Using Poetry
66+
```bash
4767
poetry run survey-dashboard
48-
49-
# Using Python directly
50-
panel serve app.py --port 5006 --show --autoreload
5168
```
5269

53-
The `--autoreload` flag enables automatic reloading when you make changes to the code, which is useful during development.
70+
This starts the server with:
71+
- Auto-reload on code changes
72+
- Browser opens automatically
73+
- Development-friendly error messages
5474

5575
### Manual Panel Serve
5676

57-
If you need more control over the server configuration:
77+
For more control over server configuration:
78+
79+
```bash
80+
panel serve survey_dashboard/app.py \
81+
--port 5006 \
82+
--static-dirs en_files=./survey_dashboard/hmc_layout/static/en_files \
83+
--prefix /2021community \
84+
--show
85+
```
86+
87+
### Environment Variables
88+
89+
- `VIRTUAL_PATH` - URL path prefix (default: `/2021community`)
90+
- `LANGUAGE` - Dashboard language: `EN` or `DE` (default: `EN`)
91+
92+
## Production Deployment
93+
94+
This project includes Docker support for production deployment with automatic HTTPS using Let's Encrypt.
95+
96+
### Docker Deployment
97+
98+
1. **Configure environment variables:**
99+
```bash
100+
cp .env.example .env
101+
# Edit .env with your domain and settings
102+
```
103+
104+
2. **Build and start containers:**
105+
```bash
106+
docker compose up -d --build
107+
```
108+
109+
3. **Access your dashboard:**
110+
```
111+
https://your-domain.com/2021community/
112+
```
113+
114+
### Deployment Architecture
115+
116+
The deployment uses:
117+
- **nginx-proxy**: Automatic reverse proxy with virtual host routing
118+
- **acme-companion**: Automatic Let's Encrypt SSL certificate management
119+
- **Dashboard container**: Panel/Bokeh application server
120+
121+
See `docker-compose.yml` and `Dockerfile` for detailed configuration.
122+
123+
## Project Structure
124+
125+
```
126+
survey_dashboard/
127+
├── survey_dashboard/ # Main application code
128+
│ ├── app.py # Main Panel application
129+
│ ├── scripts.py # CLI entry point
130+
│ ├── data/ # Data processing modules
131+
│ ├── ui/ # UI components and layout
132+
│ ├── i18n/ # Internationalization
133+
│ └── hmc_layout/ # Templates and static assets
134+
│ ├── en_template.html # English template
135+
│ ├── de_template.html # German template
136+
│ └── static/ # CSS, JS, images
137+
├── docs/ # Documentation
138+
│ └── refactoring/ # Architectural documentation
139+
├── docker-compose.yml # Docker orchestration
140+
├── Dockerfile # Container build instructions
141+
├── .env.example # Environment template
142+
└── pyproject.toml # Python dependencies
143+
```
144+
145+
## Development
146+
147+
### Running Tests
58148

59-
```shell
60-
panel serve app.py --port 5006 --static-dirs en_files=./survey_dashboard/hmc_layout/static/en_files --show
149+
```bash
150+
poetry run pytest
61151
```
62152

63-
### Access the Dashboard
153+
### Code Style
64154

65-
* Navigate to `http://localhost:5006/` in your browser after starting the server.
155+
This project uses:
156+
- Black for code formatting
157+
- Flake8 for linting
158+
- MyPy for type checking
66159

67-
## Deployment
160+
### Making Changes
68161

69-
To embed the dashboard into any website, first you have to host a bokeh server with this application somewhere and then you can embed it with bokehs `sever_document` function [see](https://docs.bokeh.org/en/latest/docs/user_guide/embed.html#app-documents)
162+
1. Create a feature branch
163+
2. Make your changes
164+
3. Test locally with `poetry run survey-dashboard`
165+
4. Test with Docker if deployment-related
166+
5. Submit a pull request
70167

71-
Do steps under `usage` above, but for a public exposed URL, or what ever is used for deployment.
72-
The Language verison of the dashboard can be set with the environment variable: 'L
168+
## Documentation
73169

170+
Detailed documentation can be found in the `docs/refactoring/` directory:
171+
- Architectural overview
172+
- Module structure
173+
- Development guide
174+
- Migration guide
74175

75-
Add the code from 'script' to you website:
176+
## Troubleshooting
76177

77-
```python
78-
from bokeh.embed import server_document
79-
script = server_document("url_to_running_server")
80-
script
178+
### Port Already in Use
179+
180+
If port 5006 is already in use:
181+
```bash
182+
lsof -ti:5006 | xargs kill -9
81183
```
82184

83-
## Copyright and Licence
185+
### Docker Issues
186+
187+
Check container logs:
188+
```bash
189+
docker compose logs -f dashboard
190+
```
191+
192+
Rebuild without cache:
193+
```bash
194+
docker compose build --no-cache
195+
```
196+
197+
### Font Loading Issues
198+
199+
Clear browser cache (Ctrl+Shift+Del) or test in incognito mode.
200+
201+
## Technology Stack
202+
203+
### Core Framework
204+
- **Panel** (1.7.5) - High-level app and dashboarding solution
205+
- **Bokeh** (3.7.3) - Interactive visualization library
206+
- **Python** (3.12+) - Programming language
207+
208+
### Data Processing
209+
- **Pandas** (2.3.2) - Data manipulation
210+
- **NumPy** (2.3.2) - Numerical computing
211+
212+
### Visualization
213+
- **Matplotlib** (3.10.6) - Plotting library
214+
- **WordCloud** (1.9.4) - Word cloud generation
84215

85-
See [LICENSE](./LICENSE).
216+
### Web Server
217+
- **Tornado** (6.5.2) - Async web framework (used by Bokeh)
86218

87-
### Main used libraries and dependencies
219+
### Deployment
220+
- **Docker** - Containerization
221+
- **nginx-proxy** - Automatic reverse proxy
222+
- **acme-companion** - Let's Encrypt automation
88223

89-
The following libraries are used directly (i.e. not only transitively) in this project:
224+
## License
90225

226+
See [LICENSE](./LICENSE) for details.
91227

92228
## Acknowledgements
93229

@@ -98,7 +234,41 @@ The following libraries are used directly (i.e. not only transitively) in this p
98234
</div>
99235
<br />
100236

101-
This project was developed at the Institute for Materials Data Science and Informatics
102-
(IAS-9) of the Jülich Research Center and funded by the Helmholtz Metadata Collaboration
103-
(HMC), an incubator-platform of the Helmholtz Association within the framework of the
104-
Information and Data Science strategic initiative.
237+
This project was developed at the **Institute for Materials Data Science and Informatics (IAS-9)** of the Forschungszentrum Jülich and funded by the **Helmholtz Metadata Collaboration (HMC)**, an incubator-platform of the Helmholtz Association within the framework of the Information and Data Science strategic initiative.
238+
239+
## Citation
240+
241+
If you use this dashboard in your research, please cite:
242+
243+
```bibtex
244+
@software{survey_dashboard,
245+
title = {Survey Dashboard},
246+
author = {Bröder, Jens and Gerlich, Silke Christine and Hofmann, Volker},
247+
year = {2024},
248+
url = {https://github.com/Materials-Data-Science-and-Informatics/survey_dashboard},
249+
organization = {Forschungszentrum Jülich GmbH}
250+
}
251+
```
252+
253+
## Contributing
254+
255+
Contributions are welcome! Please:
256+
257+
1. Fork the repository
258+
2. Create a feature branch
259+
3. Make your changes
260+
4. Add tests if applicable
261+
5. Ensure all tests pass
262+
6. Submit a pull request
263+
264+
For major changes, please open an issue first to discuss what you would like to change.
265+
266+
## Support
267+
268+
For questions or issues:
269+
- **GitHub Issues**: [Report a bug or request a feature](https://github.com/Materials-Data-Science-and-Informatics/survey_dashboard/issues)
270+
- **Email**: Contact the maintainers (see repository contributors)
271+
272+
---
273+
274+
**Last Updated:** November 2024

0 commit comments

Comments
 (0)