Generate all source files fully, without placeholders, and make sure the logic works end-to-end.
1. Project Overview
Create a Streamlit application with two pages:
User annotation page (app.py)
Admin dashboard (admin.py)
Use a separate module gsheet_helper.py for all Google Sheets functions.
The app uses Google Sheets as the backend database.
All API access must use a service account JSON provided in .streamlit/secrets.toml.
2. Google Sheets Structure
The target spreadsheet contains exactly these worksheets:
Sheet1: input comments
Column A: Original text
Contains all comments.
Sheet2: user annotations
Columns:
Original text
Hate speech classification
Language/structure classification
IP
Username
Timestamp
Batch
Sheet3: state
Tracks batch assignment:
batch_number
start_row
end_row
lock_count
locked ("yes" or "no")
Batch locks after 3 unique IPs submit it.
3. User Page Logic (app.py)
Implement:
Username gate
When a new user visits:
Show a username input f…