For project managers and non-coders. This guide walks you through every step to get the quiz running, from zero to deployed.
- Quiz: Asks neutral questions about beliefs (scale or yes/no) with branching follow-ups
- Evidence Network: Upload articles/documents, auto-tag with AI, link to topics
- Politician Tracking: Track public statements vs. actual actions
- Fact-Checking: Compare new articles against past promises/claims
- Corruption Focus: Highlight perception vs. reality of institutions
- Session Persistence: Users can save and track how views evolve
Before starting, ensure you have:
- A Mac, Windows, or Linux computer
- Internet connection
- About 30 minutes
- (Optional) OpenAI API key for AI features
Node.js is the engine that runs this application.
- Open your web browser
- Go to: https://nodejs.org
- Click the LTS (Long Term Support) button - it's the green one
- Download will start automatically
- Open the downloaded file
- Follow the installer prompts (click "Next" / "Continue" through everything)
- Restart your computer after installation
To verify it worked:
- Open Terminal (Mac) or Command Prompt (Windows)
- Mac: Press
Cmd + Space, type "Terminal", press Enter - Windows: Press
Windows key, type "cmd", press Enter
- Mac: Press
- Type:
node --version - Press Enter
- You should see something like
v20.10.0(numbers may vary)
If you see an error, reinstall Node.js.
If you don't already have one:
- Go to: https://code.visualstudio.com
- Download and install VS Code
- This makes viewing and editing files much easier
Mac:
- Open Finder
- Navigate to:
/Users/dan.maguire/Documents/Projects/Politics - Right-click on the
Politicsfolder - Select "New Terminal at Folder"
Alternative (any OS):
- Open Terminal/Command Prompt
- Type:
cd /Users/dan.maguire/Documents/Projects/Politics - Press Enter
You'll know you're in the right place if you type ls (Mac/Linux) or dir (Windows) and see files like package.json and README.md
This downloads all the code libraries the project needs.
In your terminal, type:
npm install
What to expect:
- This takes 1-3 minutes
- You'll see a progress bar and lots of text scrolling
- It's done when you see your cursor blinking on a new line
- You may see some yellow "warnings" - these are normal, ignore them
- If you see red "errors", something went wrong (see Troubleshooting below)
The database stores all your questions, evidence, and user responses.
Run these three commands, one at a time:
npx prisma generate
Wait for it to finish, then:
npx prisma db push
Wait for it to finish, then:
npm run db:seed
What each command does:
prisma generate- Creates the database connection codeprisma db push- Creates the database file and tablesdb:seed- Fills the database with sample questions and data
You'll know it worked when you see:
- "✅ Created X categories"
- "✅ Created X questions"
- "🎉 Seeding complete!"
In your terminal, type:
npm run dev
What to expect:
- You'll see "Ready" and a URL like
http://localhost:1776 - The terminal will stay "running" - this is normal
- Don't close this terminal window while using the app
- Open your web browser (Chrome, Safari, Firefox, etc.)
- Go to: http://localhost:1776
- You should see the Worldview Quiz home page!
Available pages:
| URL | What it does |
|---|---|
| http://localhost:1776 | Home page |
| http://localhost:1776/quiz | Take the quiz |
| http://localhost:1776/admin | Admin panel |
| http://localhost:1776/admin/documents | Document editor with AI |
When you want to stop the application:
- Go to the terminal window where it's running
- Press
Ctrl + C(hold Control, press C) - The server will stop
To start it again later, just run npm run dev again.
- Make sure the server is running (
npm run dev) - Go to: http://localhost:1776/admin
Scale Questions (1-5 spectrum):
- In Admin, click the Questions tab
- Fill in the form:
- Question Text: Write a neutral question (e.g., "How should education be funded?")
- Category: Select from dropdown
- Left Label: What the left-leaning answer means (e.g., "Fully public funding")
- Right Label: What the right-leaning answer means (e.g., "Private/market-based")
- Click Add Question
Yes/No Questions:
- Set Question Type to "yesno"
- Set Yes Value: 1 if "yes" is right-leaning, -1 if "yes" is left-leaning
Branching Questions (Follow-ups):
- Set Parent Question: The question this follows
- Set Branch Condition: "yes" or "no" (when to show this follow-up)
Tips for good questions:
- Keep them neutral - no loaded language
- Both labels should be reasonable positions someone might hold
- Focus on "how" not "should we"
- Use yes/no for absolute positions, then branch into nuance
- Go to: http://localhost:1776/admin/documents
- Choose source type:
- Impartial: Factual reporting to use as evidence
- Partisan: Opinion/spin to fact-check against reality
- Upload a file OR paste a URL
- The document loads with automatic tag highlighting
- Use AI buttons to:
- Suggest Tags: Auto-detect relevant topics
- Generate Questions: Create quiz questions from content
- Extract Claims: Find fact-checkable statements
- Detect Politicians: Find mentioned public figures
- Check Against Backlog: Compare to existing promises/claims
- In Admin, click the Evidence tab
- Fill in the form:
- Title: Headline of the article/video
- Summary: 1-2 sentence description of what it shows
- Source URL: Link to the original (optional)
- Source Name: Publication name (e.g., "Reuters", "NPR")
- Source Type: Impartial or Partisan
- Category: Which topic area it relates to
- Tags: Check relevant tags
- Click Add Evidence
Synonyms help the system recognize related terms:
- In Prisma Studio (
npm run db:studio) - Go to TagSynonym table
- Add entries like:
- Tag: "Immigration" → Synonyms: "border", "migrants", "asylum", "deportation"
- Tag: "Healthcare" → Synonyms: "medical", "insurance", "hospital", "Medicare"
These will be highlighted in documents automatically.
-
In Prisma Studio, go to Politician table
-
Add public figures with:
- Name: Full name
- Type: politician, party, pundit, organization
- Title: Current role (Senator, President, etc.)
- Affiliation: Party or organization
-
Track their stances in PoliticianStance table:
- Public Stance: What they say (-2 to 2)
- Action Stance: What they do (-2 to 2)
- Discrepancy Note: Explain any gap between words and actions
-
In Prisma Studio, go to Statement table
-
Add promises/claims with:
- Politician: Who said it
- Text: The exact statement
- Type: promise, claim, prediction, denial
- Source: Where/when it was made
- Status: pending, kept, broken, debunked, confirmed
-
Link evidence in FactCheck table to update status over time
For full control, use Prisma Studio:
- Open a new terminal window (keep the server running in the other one)
- Navigate to the project folder
- Run:
npm run db:studio - A browser window opens with a database GUI
- You can view, edit, and delete any records
Vercel is free and designed for Next.js apps.
Step 5A.1: Create a GitHub Account (if you don't have one)
- Go to: https://github.com
- Click "Sign up"
- Follow the prompts
Step 5A.2: Install Git
- Go to: https://git-scm.com/downloads
- Download and install for your OS
Step 5A.3: Push Code to GitHub
In terminal (in the project folder):
git init
git add .
git commit -m "Initial commit"
Then go to GitHub.com:
- Click the "+" icon → "New repository"
- Name it "worldview-quiz"
- Keep it Public or Private (your choice)
- Click "Create repository"
- Follow the instructions shown under "push an existing repository"
Step 5A.4: Deploy on Vercel
- Go to: https://vercel.com
- Click "Sign up" → "Continue with GitHub"
- Click "New Project"
- Find and select your "worldview-quiz" repository
- Click "Deploy"
- Wait 2-3 minutes
- You'll get a URL like
worldview-quiz.vercel.app
Your quiz is now live on the internet!
Similar process:
- Go to: https://netlify.com
- Sign up with GitHub
- Click "Add new site" → "Import an existing project"
- Select your GitHub repo
- Deploy
- Start the local server:
npm run dev - Go to: http://localhost:3000/admin
- Add questions/evidence
- Changes are saved to your local database
To push changes to your live site:
git add .
git commit -m "Added new questions"
git push
Vercel will automatically redeploy.
Your database is stored in: prisma/dev.db
To back it up:
- Find the file in Finder/Explorer
- Copy it somewhere safe (Dropbox, Google Drive, etc.)
To restore:
- Replace
prisma/dev.dbwith your backup - Restart the server
If you want to wipe all data and start over:
npm run db:reset
This deletes everything and re-seeds with sample data.
Node.js isn't installed properly. Reinstall from https://nodejs.org
On Mac/Linux, try:
sudo npm install
Enter your computer password when prompted.
Another app is using that port. Either:
- Close the other app, or
- Run:
npm run dev -- -p 1777(uses port 1777 instead)
Dependencies aren't installed. Run:
npm install
Reset the database:
npm run db:reset
- Hard refresh the browser:
Cmd+Shift+R(Mac) orCtrl+Shift+R(Windows) - Restart the server:
Ctrl+C, thennpm run dev
| Term | Meaning |
|---|---|
| Terminal | Text-based interface for running commands |
| npm | Node Package Manager - installs code libraries |
| Server | The program running your application |
| Database | Where all your data is stored |
| Deploy | Put your app on the internet |
| Repository (repo) | A project stored on GitHub |
| Commit | Save a snapshot of your code |
| Push | Upload your commits to GitHub |
If you get stuck:
- Copy the exact error message
- Google it - Most errors have been solved before
- Ask an LLM - Paste the error and ask for help
- Check the terminal - Error details are usually there
# Start the app
npm run dev
# Stop the app
Ctrl + C
# Open database GUI
npm run db:studio
# Reset database
npm run db:reset
# Save changes to GitHub
git add .
git commit -m "description of changes"
git push
URLs when running locally:
- Quiz: http://localhost:1776
- Admin: http://localhost:1776/admin
- Documents: http://localhost:1776/admin/documents
The AI features (auto-tagging, question generation, claim extraction) require an LLM API. You have two options:
Step 7A.1: Get a GitHub Personal Access Token
- Go to: https://github.com/settings/tokens
- Click "Generate new token" → "Generate new token (classic)"
- Give it a name like "Worldview Quiz"
- Select scope:
read:user(minimal permissions needed) - Click "Generate token"
- Copy the token (starts with
ghp_orgithub_pat_)
Step 7A.2: Add Token to Project
- Open the file
.envin the project folder - Add this line:
GITHUB_TOKEN="your-github-token-here" - Save the file
- Restart the server (
Ctrl+C, thennpm run dev)
Step 7B.1: Get an OpenAI API Key
- Go to: https://platform.openai.com
- Sign up or log in
- Go to API Keys section
- Click "Create new secret key"
- Copy the key (starts with
sk-)
Step 7B.2: Add Key to Project
- Open the file
.envin the project folder - Add this line:
OPENAI_API_KEY="sk-your-actual-key-here" - Save the file
- Restart the server (
Ctrl+C, thennpm run dev)
- Go to: http://localhost:1776/admin/documents
- Paste a URL and click "🔍 Analyze URL"
- Should return auto-populated fields, detected bias, key figures, etc.
- If you see an error, check that your token/key is correctly set in
.env
Last updated: December 2024