A flexible tool for managing and visualizing user needs across different user groups, entities, and workflow phases. Built with FastAPI (Python) backend and React (TypeScript) frontend with D3 visualizations.
- CRUD Operations: Create, read, update, and delete user needs
- First-Time Setup: Guided setup to create your first user group
- Demo Mode: Explore the application with sample data (Homezy property letting example)
- Filtering: Filter user needs by user group, entity, workflow phase, and super group
- Multiple Views:
- Table view for detailed listings
- Cards view (normal/large) for overview
- Interactive D3 network graph for exploring relationships
- Statistics Dashboard: Visual breakdown of user needs by various dimensions
- JSON Database: Uses
data.jsonfor persistent storage (git-ignored for privacy)
# Clone the repository
git clone <your-repo-url>
cd UserNeedsGathering
# Initialize data files (first time only)
./init-data-files.sh
# Start the application
docker-compose up -d
# Access at http://localhost:3011When you first open the application, it will:
- Show a welcome modal if
data.jsonis empty - Guide you through creating your first user group
- You can alternatively enable Demo Mode to explore with sample data
Demo Mode lets you explore the application with sample data from a fictional property letting app called "Homezy". The demo data includes:
- 6 user groups (Prospective Renter, Landlord, Property Manager, Homezy Admin, etc.)
- 10 entities (Property Listing, Rental Application, Lease Agreement, etc.)
- 10 workflow phases (Property Search, Application, Viewing, etc.)
- 24 user needs across different user groups
Demo Mode creates a sandbox: Your demo data is stored in data.demomode.json (git-ignored), so you can experiment without affecting your actual data in data.json.
To enable Demo Mode, click the menu (⋮) in the top-right header and toggle "Demo Mode".
UserNeedVisualiser/
├── backend/
│ ├── main.py # FastAPI application with all endpoints
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom React hooks (useDemoMode)
│ │ ├── types.ts # TypeScript type definitions
│ │ ├── App.tsx # Main application component
│ │ └── main.tsx # Application entry point
│ ├── package.json # Node dependencies
│ ├── tsconfig.json # TypeScript configuration
│ └── vite.config.ts # Vite configuration
├── data.json # Your actual data (git-ignored, auto-created)
├── data.demomode.json # Demo sandbox data (git-ignored, auto-created)
├── data.example.json # Homezy demo template (version controlled)
├── data.template.json # Empty structure template (version controlled)
└── README.md
- Docker 20.10+
- Docker Compose 2.0+
- Python 3.8+
- uv - Fast Python package installer and resolver
- Node.js 18+
- npm or yarn
The easiest way to run the application is using Docker Compose:
-
Clone the repository (if you haven't already):
git clone <your-repo-url> cd UserNeedsGathering
-
Initialize data files (first time only):
./init-data-files.sh
This script ensures
data.jsonanddata.demomode.jsonexist before Docker tries to mount them. It's safe to run multiple times - it only creates files if they don't exist.Why is this needed? Docker requires files to exist before mounting them as volumes. If you skip this step, Docker will create directories instead of files, causing mount errors.
-
Start the application:
docker-compose up -d
This will:
- Build the backend and frontend Docker images
- Start both services
- Mount your data files as volumes
- Make the app available at http://localhost:3011
-
View logs (optional):
docker-compose logs -f
-
Stop the application:
docker-compose down
-
Rebuild after code changes:
docker-compose up -d --build
Note: Data files (data.json, data.demomode.json) are mounted as volumes, so your data persists even when containers are stopped or rebuilt.
Troubleshooting: If you get mount errors about data.json being a directory:
# Stop containers and remove volumes
docker-compose down -v
# Remove the incorrectly created directory
sudo rm -rf data.json
# Re-initialize data files
./init-data-files.sh
# Start again
docker-compose up -d-
Install uv (if not already installed):
# On macOS and Linux: curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Or with pip: pip install uv
-
Navigate to the backend directory:
cd backend -
Install dependencies with uv:
uv pip install -r requirements.txt
-
Start the backend server:
uv run python main.py
The API will be available at http://localhost:8000
API documentation is available at http://localhost:8000/docs
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The application will be available at http://localhost:5173
-
Start the backend server (from the
backenddirectory):uv run python main.py
-
Start the frontend (from the
frontenddirectory):npm run dev
-
Open your browser to http://localhost:5173
On your first visit (when data.json is empty or doesn't exist):
- You'll see a welcome modal
- Create your first super group with a 3-letter prefix (e.g., "HMZ" for Homezy Staff)
- Enter your first user group name (e.g., "Admin", "Customer")
- Select the super group you just created
- Click "Create User Group"
Tip: You can also try Demo Mode first to see how the app works.
- Add: Click "+ Add User Need" button
- Edit: Click "Edit" button on any user need card
- Delete: Click "Delete" button on any user need card
- Filter: Use the filter dropdowns in the sidebar
- View: Switch between Table, Cards, and Graph views
- Card Size: In Cards view, toggle between Normal and Large card sizes
The interactive network graph visualizes relationships between:
- User needs (purple circles)
- User groups (green circles)
- Entities (orange circles)
- Workflow phases (red circles)
Graph interactions:
- Drag nodes to rearrange the layout
- Scroll to zoom in/out
- Click nodes to see details
- Click background to deselect
- Enable: Click menu (⋮) in header → Toggle "Demo Mode"
- Sandbox: Demo data is stored separately in
data.demomode.json - Reset: Delete
data.demomode.jsonto reset demo data to original Homezy example
All endpoints support a demo_mode query parameter to switch between data.json and data.demomode.json.
GET /api/check-setup- Check if initial setup is required
GET /api/user-groups- Get all user groupsPOST /api/user-groups- Create a new user group
GET /api/user-needs- Get all user needs (supports filtering)GET /api/user-needs/{id}- Get a specific user needPOST /api/user-needs- Create a new user needPUT /api/user-needs/{id}- Update a user needDELETE /api/user-needs/{id}- Delete a user need
GET /api/entities- Get all entitiesGET /api/workflow-phases- Get all workflow phasesGET /api/statistics- Get statistics about user needsGET /api/next-id/{user_group_id}- Get next available ID for a user group
Filter user needs using query parameters:
userGroupId- Filter by user groupentity- Filter by entityworkflowPhase- Filter by workflow phasesuperGroup- Filter by super grouprefined- Filter by refinement status ('refined', 'needsRefinement', 'all')demo_mode- Use demo data (true/false)
Example:
GET /api/user-needs?userGroupId=landlord&workflowPhase=viewing&demo_mode=true
The application uses JSON files for data storage:
data.json: Your actual data (git-ignored)data.demomode.json: Demo mode sandbox data (git-ignored, auto-created from example)data.example.json: Homezy demo template (version controlled)data.template.json: Empty structure template (version controlled)
{
"userSuperGroups": [
{
"id": "homezy_staff",
"name": "Homezy Staff",
"prefix": "HMZ"
}
],
"userGroups": [
{
"id": "admin",
"name": "Admin",
"superGroup": "homezy_staff"
}
],
"entities": [
{
"id": "property_listing",
"name": "Property Listing"
}
],
"workflowPhases": [
{
"id": "registration",
"name": "Registration",
"order": 1
}
],
"userNeeds": [
{
"id": "HMZ-001",
"userGroupId": "admin",
"title": "Monitor platform activity",
"description": "...",
"entities": ["property_listing"],
"workflowPhase": "registration",
"refined": false
}
]
}When developing with Docker, you can use volume mounts for live reloading:
# Development mode with live reload (modify docker-compose.yml to add volume mounts)
docker-compose up
# View logs from a specific service
docker-compose logs -f backend
docker-compose logs -f frontend
# Restart a specific service
docker-compose restart backend
# Execute commands inside containers
docker-compose exec backend python -c "print('Hello from backend')"
docker-compose exec frontend sh
# Clean up everything (containers, networks, volumes)
docker-compose down -vThe backend is built with FastAPI and provides:
- RESTful API endpoints with automatic OpenAPI documentation
- Pydantic models for request/response validation
- File-based JSON storage with automatic initialization
- Demo mode support for sandboxed testing
- CORS support for local development
Docker specifics:
- Health checks ensure the backend is ready before frontend starts
- Data files are mounted as volumes for persistence
- Port 8000 is exposed for API access
The frontend uses:
- React 18 with TypeScript for type safety
- Vite for fast development and building
- D3.js for network graph visualization
- Axios for API communication
- Custom hooks for demo mode state management
- Local storage for persisting UI preferences
Docker specifics:
- Multi-stage build (build stage + nginx production stage)
- Nginx serves the static files and proxies API requests to backend
- Port 80 (container) mapped to port 3000 (host)
# Build production images
docker-compose build
# Run in production mode
docker-compose up -d
# The app will be available at http://localhost:3000Frontend:
cd frontend
npm run buildThe built files will be in the frontend/dist directory.
Backend:
cd backend
uvicorn main:app --host 0.0.0.0 --port 8000The application is designed to be domain-agnostic. You can adapt it by:
- Creating your own user groups (e.g., Admin, Customer, Developer)
- Defining entities relevant to your domain (e.g., Order, Invoice, User)
- Setting up workflow phases that match your processes (e.g., Draft, Review, Approved)
- Organizing user groups into super groups for better ID management
The super group system allows you to categorize user groups and automatically prefix user need IDs:
- Homezy Staff (Internal) → HMZ-001, HMZ-002, etc.
- Property Owner (External Partners) → OWN-001, OWN-002, etc.
- Tenant (End Users) → TEN-001, TEN-002, etc.
- This is a local development tool with no authentication
- Data is stored in local JSON files
data.jsonanddata.demomode.jsonare git-ignored for privacy- Not intended for multi-user production deployments
- For production use, consider migrating to a proper database (PostgreSQL, etc.)
MIT License - Feel free to use and adapt for your needs.