Skip to content

teknolista/castas

Repository files navigation

Castas Logo

Castas

Affective Polarization Test
Check your level of polarization through an interactive questionnaire.

Website License React 18 TypeScript


About

Castas is a web application designed to assess the level of affective polarization in individuals through a simple online questionnaire. The purpose of this app is to offer a diagnostic tool for one of the most challenging phenomena in modern democracies.

When polarization divides society into groups that begin to see each other as morally incompatible, coexistence and mobility between these groups diminish. Over time, rigid social barriers emerge, forming informal "castes" that deepen inequality and segregation.

Main Features

  • 40-Question Test: Organized in 5 dimensions with 8 questions each
  • Detailed Results: Progress bars showing percentage for each dimension
  • Emoji Grid Visualization: 5x5 grid using πŸ’™ and 🀬 to represent scores
  • Custom Emoji Selection: Full emoji picker to personalize your result
  • Shareable Results: Copy results to clipboard in a formatted text
  • Multilingual Support: Complete translations for Portuguese (BR), English, and Spanish
  • Privacy First: No tracking, no cookies, results stored locally only
  • Responsive Design: Works on desktop and mobile devices

Technologies Used

Technology Purpose
React 18 UI Framework
TypeScript Type Safety
Vite Build Tool
Tailwind CSS Styling
React Router SPA Navigation
i18next Internationalization
Framer Motion Animations
Emoji Picker React Emoji Selection
Lucide React Icons

Quick Start

Prerequisites

  • Node.js 18+
  • npm

Installation

# Clone the repository
git clone https://github.com/teknolista/castas.git

# Navigate to the project folder
cd castas

# Install dependencies
npm install

# Start development server
npm run dev

Build for Production

# Build the application
npm run build

# Preview the production build
npm run preview

Project Structure

castas/
β”œβ”€β”€ .github/workflows/       # GitHub Actions for deployment
β”‚   └── deploy.yml
β”œβ”€β”€ .etc/                    # Project specifications and assets
β”‚   β”œβ”€β”€ artifacts/           # Wireframes, documents, mockups
β”‚   └── assets/              # Icons and images
β”œβ”€β”€ public/                  # Static assets served directly
β”‚   β”œβ”€β”€ images/
β”‚   └── favicon.ico
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ EmojiPicker.tsx      # Emoji picker with Emoji Picker React
β”‚   β”‚   β”œβ”€β”€ EmojiGrid.tsx        # 5x5 emoji grid display
β”‚   β”‚   β”œβ”€β”€ LanguageSelector.tsx # Language dropdown
β”‚   β”‚   └── ProgressBar.tsx      # Score progress bars
β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”‚   β”œβ”€β”€ Home.tsx             # Landing page
β”‚   β”‚   β”œβ”€β”€ Test.tsx             # Question flow
β”‚   β”‚   β”œβ”€β”€ Result.tsx           # Results display
β”‚   β”‚   β”œβ”€β”€ About.tsx            # About page
β”‚   β”‚   β”œβ”€β”€ PoliticalFanatic.tsx # Political fanatic text
β”‚   β”‚   β”œβ”€β”€ TermsOfUse.tsx       # Terms of use
β”‚   β”‚   └── PrivacyPolicy.tsx    # Privacy policy
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useLocalStorage.ts   # localStorage management
β”‚   β”‚   └── useTestState.ts      # Test state management
β”‚   β”œβ”€β”€ data/                # Test questions and dimensions
β”‚   β”‚   β”œβ”€β”€ questions.ts         # 40 test questions
β”‚   β”‚   └── dimensions.ts        # 5 dimension definitions
β”‚   β”œβ”€β”€ i18n/                # Translation files
β”‚   β”‚   β”œβ”€β”€ index.ts             # i18next configuration
β”‚   β”‚   β”œβ”€β”€ pt-BR.json           # Portuguese (Brazil)
β”‚   β”‚   β”œβ”€β”€ en.json              # English
β”‚   β”‚   └── es.json              # Spanish
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   └── scoring.ts           # Score calculation logic
β”‚   β”œβ”€β”€ lib/                 # Library utilities
β”‚   β”‚   └── utils.ts             # cn() helper function
β”‚   β”œβ”€β”€ App.tsx              # Main app with routes
β”‚   β”œβ”€β”€ main.tsx             # Entry point
β”‚   └── index.css            # Global styles + theme
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ tsconfig.json
└── README.md

Test Dimensions

The test measures affective polarization across 5 dimensions:

Dimension Portuguese Description
A Emotional Hostility Irritation and negative reactions to opposing groups
B Moral Devaluation Seeing opponents as ignorant or malicious
C Social Distance Discomfort with close relationships across groups
D Democratic Delegitimization Viewing opponents as threats to democracy
E Identity Segregation Living in a political bubble

58% 67% 58% 54% 67%

Scoring System

Each question uses a 4-point Likert scale:

  • 3 points: Strongly agree
  • 2 points: Somewhat agree
  • 1 point: Somewhat disagree
  • 0 points: Strongly disagree

Score calculation: round((sum of 8 questions / 24) Γ— 100)

Emoji representation based on percentage:

Score Emoji Pattern
0% πŸ’™πŸ’™πŸ’™πŸ’™πŸ’™
1-24% πŸ’™πŸ’™πŸ’™πŸ’™πŸ€¬
25-50% πŸ’™πŸ’™πŸ’™πŸ€¬πŸ€¬
51-74% πŸ’™πŸ’™πŸ€¬πŸ€¬πŸ€¬
75-99% πŸ’™πŸ€¬πŸ€¬πŸ€¬πŸ€¬
100% 🀬🀬🀬🀬🀬

Deployment

The project is configured for automatic deployment to GitHub Pages using GitHub Actions.

Automatic Deployment

Every push to the main branch triggers:

  1. Build the application
  2. Deploy to GitHub Pages

Manual Setup

  1. Create a repository on GitHub
  2. Enable GitHub Pages in Settings β†’ Pages β†’ Source: GitHub Actions
  3. Push your code:
git add -A
git commit -m "Initial commit"
git remote add origin https://github.com/your-username/castas.git
git push -u origin main

The site will be available at: https://your-username.github.io/castas/

Data Privacy

  • No personal data is collected
  • No cookies are used for tracking
  • Test results are stored only in your browser's localStorage
  • No server-side storage of individual responses
  • Users can clear all data by clearing browser storage

License

This project is licensed under the GPL v3.0 License.

See LICENSE for more details.


Copyleft Β© 2026 Raul Bras πŸ‡§πŸ‡· Published under the GPL v3.0 license.
Made in Brazil, in the Land of Oz (SP) , with 🌭 πŸ• and AI πŸ€–.

About

🀬 Web-based application with a simple online test to assess the level of affective polarization in people.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors