The Bechdel Test, sometimes called the Mo Movie Measure or Bechdel Rule is a simple test which names the following three criteria
- It includes at least two women
- who have at least one conversation
- about something other than a man or men.
The test was popularized by Alison Bechdel's comic Dykes to Watch Out For, in a 1985 strip called The Rule. For a nice video introduction to the subject please check out The Bechdel Test for Women in Movies on feministfrequency.com.
This program accepts a movie script and analyzes whether or not it passes the Bechdel Test, as well as analyzing several other feminist components to a film. It can answer questions like "How many females are in this film," "By what factor does this pass the Bechdel Test?"
This application has been modernized and now uses:
- Frontend: React 18 with modern hooks and functional components
- Backend: Node.js with Express
- Database: MongoDB 7.0 with Mongoose ODM
- Build Tools: Webpack 5 with modern configuration
- Styling: SCSS with CSS modules support
- Testing: Jest with React Testing Library
- Development: Hot reload with nodemon and webpack-dev-middleware
- Containerization: Docker with multi-stage builds
- Code Quality: ESLint, Prettier, and Stylelint
git clone https://github.com/JoeKarlsson/bechdel-test
cd bechdel-testYou will need to get API Keys for The MovieDB, My API Films, and Claude AI for advanced analytics.
- You can sign up for an API key for The MovieDB, here: https://www.themoviedb.org/settings/api.
- Additional Documentation about this API can be found here: https://developers.themoviedb.org/3/getting-started/introduction.
- You can sign up for an API key for My API Films, here: https://www.myapifilms.com/token.do.
- Additional Documentation about this API can be found here: https://www.myapimovies.com/api/v1/swagger-ui.html.
- You can sign up for a Claude API key here: https://console.anthropic.com/.
- Claude AI is used for advanced gender analytics including female agency analysis, stereotype detection, and bias detection.
The easiest way to run the application is using Docker:
# Start MongoDB and the application
docker compose up -d
# The application will be available at http://localhost:8080
# MongoDB will be available at localhost:27017Docker Services:
mongodb- MongoDB 7.0 with authenticationapp- Production application (port 8080)app-dev- Development application with hot reload (port 3000)
To stop the containers:
docker compose downDevelopment with Docker:
# Start only MongoDB for local development
docker compose up mongodb -d
# Then run the development server locally
npm run start:devIf you prefer to install MongoDB locally:
macOS (using Homebrew):
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb/brew/mongodb-communityUbuntu/Debian:
sudo apt-get install mongodb
sudo systemctl start mongodbWindows: Download and install MongoDB Community Server from https://www.mongodb.com/try/download/community
The project is now configured to use a local MongoDB instance. The configuration file src/server/config/config.json has been created with the provided API keys:
- TMDB API Key:
YOUR_TMDB_API_KEY - MyAPIFilms API Key:
YOUR_MYAPIFILMS_API_KEY - Claude API Key:
YOUR_CLAUDE_API_KEY - MongoDB URI:
mongodb://localhost:27017/bechdelTest
Environment Variables:
For Docker deployments, the following environment variables are configured:
THEMOVIEDB- The MovieDB API keyOMDB- OMDB API keyCLAUDE_API_KEY- Claude AI API key for advanced analyticsMONGODB_URI- MongoDB connection stringNODE_ENV- Environment (production/development)PORT- Application port (default: 3000)
npm install
npm run start:dev # Development server with hot reload at http://localhost:3000Available Scripts:
npm run dev- Start development server (alias for start:dev)npm run prod- Build and run production servernpm test- Run test suite with coveragenpm run lint- Run all lintersnpm run deploy- Deploy to production servermake help- Show all available Make commands
npm start- Start basic development server (NODE_ENV=development)npm run start:dev- Start development server with nodemon and hot reloadnpm run start:local- Start with local MongoDB connection (mongodb://localhost:27017/bechdelTest)npm run stop- Kill all running Node.js processes
npm run build- Build production assets with webpacknpm run build:analyze- Build with bundle analysis (ANALYZE=true)npm run build:stats- Generate webpack stats JSON filenpm run runProd- Run production server (NODE_ENV=production)npm run deploy- Deploy to production (Proxmox)
npm test- Run test suite with coveragenpm run test:watch- Run tests in watch modenpm run test:updateSnapshot- Update Jest snapshotsnpm run test:coverage- Run tests with coverage reportnpm run coverage- Generate coverage report for Coveralls
npm run lint- Run ESLint, CSS linting, and Markdown lintingnpm run lint:fix- Fix auto-fixable linting issuesnpm run lint:out- Output linting results to checkstyle XMLnpm run lint:css- Check SCSS/CSS styles with Stylelintnpm run lint:css:fix- Auto-fix CSS linting issuesnpm run lint:md- Check Markdown files with Remark
npm run healthcheck- Run linting and test coverage (CI/CD)
npm run clean- Clean build artifacts and coveragenpm run fresh- Fresh install (clean + reinstall dependencies)npm run reset-db- Reset database (destroy and recreate)
npm run processScript- Run script processor with nodemonnpm run loadScript- Load script directly via directScriptLoadernpm run loadScript:dev- Load script in development mode
If you prefer Make, all common commands are available:
make dev # Start development server
make test # Run tests
make lint # Run linters
make build # Build production assets
make deploy # Deploy to production
make docker-up # Start Docker services
make clean # Clean build artifacts
make help # Show all available commandsThe bechdel.io test suite uses Jest with React Testing Library for comprehensive testing:
npm test # Run all tests with coverage
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run test:updateSnapshot # Update Jest snapshotsTest Coverage:
- Unit tests for React components
- Integration tests for API endpoints
- Snapshot testing for UI consistency
- Mock implementations for external services
You can read more about testing bechdel.io.
npm run lint # Check code quality
npm run lint:fix # Auto-fix linting issues
npm run lint:css # Check SCSS/CSS styles
npm run lint:css:fix # Auto-fix CSS issues
npm run lint:md # Check Markdown filesnpm run build # Build production assets
npm run build:analyze # Build with bundle analysis
npm run build:stats # Generate webpack stats
npm run runProd # Run production servernpm run processScript # Process movie scripts
npm run healthcheck # Run linting and tests
npm run snyk-protect # Security vulnerability checkFor production deployment instructions, see DEPLOYMENT.md.
Quick deployment:
npm run deploy # Deploy to production serverThe deployment script:
- Pulls latest code from GitHub
- Builds Docker images on the server
- Restarts services with zero downtime
- Runs health checks to verify deployment
MongoDB Connection Errors
# Check if MongoDB is running
docker compose ps
# Restart MongoDB
make reset-db
# or
npm run reset-dbPort Already in Use
# Kill all Node processes
npm run stop
# Or find and kill specific port
lsof -ti:3000 | xargs kill -9API Key Issues
- Verify your
.envfile exists and contains valid API keys - Copy
.env.exampleto.envand fill in your keys - For deployment, ensure
.env.deployment.localhas your Claude API key
Docker Issues
# Clean Docker resources
docker compose down -v
docker system prune -a
# Fresh start
make docker-upBuild Errors
# Clean and rebuild
npm run fresh
npm run buildIf you are looking to get your hands on some movie scripts to test, you can check out my CLI Movie Script Grabber https://github.com/JoeKarlsson/movie-script-scraper
The Bechdel Test Script Parser was a collaborative digital humanities project between myself and my sister, Laurel Karlsson. It is the product of a shared passion for film, feminism, and the creative potential of technology. By combining the talents and interests of myself, a software engineer, we've been able to create an innovative data mining tool for film analysis that we hope to continue to work on and improve. You can check out the project on our website.
This project was born when my sister reached out to me for advice on a few ideas she had been mulling over for a digital humanities project. Hoping to do something related to feminist film analysis, she was feeling very limited by my lack of coding experience and hadn't been able to find an existing data mining tool to accomplish what she was looking to do. I immediately offered up my coding expertise, looking to gain experience by building a tool from scratch which would accomplish the specific needs of the project. After brainstorming several different project ideas, we settled on the one you see here.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
|
Joe Karlsson |
Laurel Karlsson |
