formatting improvements.

This commit is contained in:
2025-11-18 23:11:14 -08:00
parent 5524d7308c
commit 0bb071f337
6 changed files with 660 additions and 407 deletions

View File

@@ -27,18 +27,37 @@ rothbard/
├── generate_sample.py # Utility to generate sample Filevine API responses
├── requirements.txt # Python dependencies
├── rothbard-service-account.json # Firebase service account credentials
├── rothbard-staging2-12345-firebase-adminsdk-fbsvc-7f95268383.json # Firebase service account for staging
├── static/
│ └── auth.js # Client-side authentication handling
├── templates/ # Jinja2 HTML templates
│ ├── base.html # Base template with navigation
│ ├── login.html # Firebase login page
│ ├── welcome.html # User welcome/onboarding page
── dashboard.html # Main case dashboard
── dashboard.html # Main case dashboard
│ ├── admin_users.html # Admin user management interface
│ ├── admin_user_edit.html # Admin user edit interface
│ ├── admin_user_create.html # Admin user creation interface
│ └── _pagination.html # Pagination component
├── examples/ # Sample Filevine API responses
│ ├── project_list.json
│ ├── project_contacts.json
── client.json
└── .env # Environment variables (not tracked)
│ ├── forms__complaintInfo.json
│ ├── forms__newFileReview.json
── project_tasks.json
│ ├── project_type_pahe_list.json
│ ├── project_team.json
│ └── ...
├── .env # Environment variables (not tracked)
├── .gcloudignore # Files ignored by Google Cloud Build
├── .gitignore # Files ignored by Git
├── cloudbuild.yaml # Google Cloud Build configuration
├── Dockerfile # Containerization configuration
├── deploy.sh # Deployment script
├── main.tf # Terraform infrastructure as code
├── firestore.rules # Firestore security rules
├── column_mapping.json # Column mapping configuration (unused)
├── DEPLOY.md # Deployment instructions
├── CLAUDE.md # Development guidance
└── utils.py # Utility functions for user profile management
```
## Core Features
@@ -48,6 +67,7 @@ rothbard/
- Server-side session management with 8-hour expiration
- User profile management in Firestore
- Role-based access control (admin-enabled users only)
- Admin interface for user management
### Case Management Dashboard
- Real-time fetching of projects from Filevine API
@@ -57,6 +77,9 @@ rothbard/
- Project numbers and incident dates
- Contact information and project URLs
- Responsive design using Tailwind CSS
- Configurable column visibility with local storage
- Pagination for large datasets
- Admin simulation mode to view other users' cases
### API Integration
- OAuth 2.0 authentication with Filevine API
@@ -66,6 +89,16 @@ rothbard/
- Individual project details
- Client information
- Project contacts
- Project tasks and forms
### Admin Interface
- Comprehensive user management dashboard
- Enable/disable user access
- Grant/revoke admin privileges
- Reset user passwords
- Create new users
- View all user profiles
- Simulate case email access for testing
## Configuration
@@ -78,11 +111,17 @@ Create a `.env` file with the following variables:
FLASK_SECRET_KEY=your-secret-key-here
# Firebase Configuration
# Choose ONE of these approaches:
# 1) Path to JSON creds file
GOOGLE_APPLICATION_CREDENTIALS=./rothbard-staging2-12345-firebase-adminsdk-fbsvc-7f95268383.json
# 2) Or inline JSON (escaped as single line)
# FIREBASE_SERVICE_ACCOUNT_JSON="{\"type\":\"service_account\",...}"
# Front-end Firebase (public — safe to expose)
FIREBASE_API_KEY=your-firebase-api-key
FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
FIREBASE_PROJECT_ID=your-firebase-project-id
FIREBASE_APP_ID=your-firebase-app-id
FIREBASE_SERVICE_ACCOUNT_JSON='{"type":"service_account",...}' # or set GOOGLE_APPLICATION_CREDENTIALS
# Filevine API Configuration
FILEVINE_CLIENT_ID=your-filevine-client-id
@@ -97,8 +136,9 @@ FILEVINE_USER_ID=your-filevine-user-id
1. Create a Firebase project at https://console.firebase.google.com
2. Enable Authentication with Email/Password provider
3. Create a Firestore database
4. Generate a service account key and save as `rothbard-service-account.json`
4. Generate a service account key and save as `rothbard-staging2-12345-firebase-adminsdk-fbsvc-7f95268383.json`
5. Configure Authentication settings for your web app
6. Set up Firestore security rules (provided in `firestore.rules`)
### Filevine API Setup
@@ -133,7 +173,7 @@ FILEVINE_USER_ID=your-filevine-user-id
```
5. **Initialize Firebase**
- Place your service account JSON file at `rothbard-service-account.json`
- Place your service account JSON file at `rothbard-staging2-12345-firebase-adminsdk-fbsvc-7f95268383.json`
- Or set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
6. **Run the application**
@@ -158,6 +198,8 @@ FILEVINE_USER_ID=your-filevine-user-id
1. User profiles are stored in Firestore at `users/{uid}`
2. Enable users by setting `enabled: true` and providing a `caseEmail`
3. The `caseEmail` field determines which projects the user can access
4. Admins can access the admin interface at `/admin/users` to manage all users
5. Admins can simulate other users' case access by entering their email in the simulation field on the dashboard
## Development Tools
@@ -169,9 +211,10 @@ python generate_sample.py
```
This will create JSON files in the `examples/` directory containing:
- Sample project lists
- Project contacts
- Client information
- Sample project forms (complaintInfo, newFileReview)
- Project tasks
- Project type phases
- Project team members
These samples are useful for development and testing without hitting the live API.
@@ -183,6 +226,8 @@ These samples are useful for development and testing without hitting the live AP
- User access is controlled through Firestore profiles
- Sensitive credentials are stored in environment variables
- Filevine API tokens are properly scoped and managed
- Firestore security rules restrict access to user's own profile
- Google Cloud Build and deployment use secure practices
## Future Enhancements
@@ -204,6 +249,8 @@ Planned improvements include:
- **python-dotenv 1.0.1** - Environment variable management
- **requests 2.32.3** - HTTP client for API calls
- **itsdangerous 2.2.0** - Security utilities for Flask
- **gunicorn 23.0.0** - WSGI HTTP Server
- **pytz 2024.1** - Timezone library
## API Endpoints
@@ -214,13 +261,21 @@ Planned improvements include:
- `GET /logout` - Session termination
- `GET /welcome` - User onboarding page
- `GET /dashboard` - Main case dashboard (authenticated users only)
- `GET /admin/users` - Admin user management interface
- `GET /admin/users/<uid>` - Admin user detail view
- `POST /admin/users/update` - Update user information
- `POST /admin/users/create` - Create new user
- `POST /admin/users/<uid>/reset-password` - Reset user password
### Filevine API Integration
- Projects: `/fv-app/v2/Projects`
- Project Details: `/fv-app/v2/Projects/{id}`
- Contacts: `/fv-app/v2/projects/{id}/contacts`
- Project Team: `/fv-app/v2/Projects/{id}/team`
- Project Tasks: `/fv-app/v2/Projects/{id}/tasks`
- Project Forms: `/fv-app/v2/Projects/{id}/Forms/{form}`
- Project Contacts: `/fv-app/v2/projects/{id}/contacts`
- Client Info: `/fv-app/v2/contacts/{id}`
## License
This project is proprietary software for Rothbard Law Group.
This project is proprietary software for Rothbard Law Group.