Complete technical documentation for AntWeb - the world's largest online database of ant images, specimen records, and natural history information.
Live Site: https://www.antweb.org
API: https://api.antweb.org/v3/
Repository: https://github.com/calacademy-research/antweb
This documentation suite provides comprehensive technical information about AntWeb's architecture, data model, API, and development processes.
⭐ NEW - Strategic development planning
-
ROADMAP.md - 20-Year Development Roadmap
- Strategic modernization priorities
- Phase-by-phase implementation plan
- Technology decisions and trade-offs
- Timeline and success metrics
-
PHASE1.md - Phase 1: Security & Foundation (Detailed)
- Week-by-week implementation guide
- Release management & versioning
- Authentication system overhaul
- Dependency updates and database migration
-
ARCHITECTURE.md - System Architecture Overview
- Technology stack (Java, Python, MySQL, Docker)
- High-level architecture and data flow
- Core components and their interactions
- Deployment configurations
- Performance and security considerations
-
DATABASE.md - Database Schema & Data Model
- Complete schema documentation for 50+ tables
- Entity-relationship diagrams
- Key tables: taxon, specimen, image, geolocale
- Specimen upload file format (42 columns)
- Query patterns and optimization
- Migration system
-
API.md - RESTful API Documentation
- All v3 API endpoints
- Request/response formats
- Authentication and rate limiting
- Code examples (Python, JavaScript, R, cURL)
- Error handling
- Best practices
-
DEVELOPMENT.md - Developer Guide
- Environment setup (Docker, database, file storage)
- Project structure and organization
- Development workflow
- Testing and debugging
- Code style guidelines
- Git workflow and contribution process
Getting the code running:
# 1. Clone repository
git clone git@github.com:calacademy-research/antweb.git
cd antweb
# 2. Set up Docker
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
# 3. Download database snapshot (get credentials from team)
scp root@antweb.org:/root/ant-currentDump.sql.gz ./
# 4. Load database
docker volume create antweb_database
# (see DEVELOPMENT.md for full commands)
# 5. Start services
ln -sf docker-compose.dev.yml docker-compose.override.yml
docker-compose up -d
# 6. Visit http://localhostComplete setup instructions: See DEVELOPMENT.md → "Initial Setup"
Making your first API request:
# Get all Camponotus specimens
curl "https://api.antweb.org/v3/specimens?genus=camponotus&limit=10"
# Get a specific specimen
curl "https://api.antweb.org/v3/specimens/CASENT0106322"
# Search taxa
curl "https://api.antweb.org/v3/taxa?subfamily=formicinae&rank=genus"Complete API documentation: See API.md
Key deployment commands:
# Staging deployment
ln -sf docker-compose.stage.yml docker-compose.override.yml
docker-compose up -d --build
# Production deployment
ln -sf docker-compose.prod.yml docker-compose.override.yml
docker-compose up -d --build
# Database backup
docker-compose exec mysql mysqldump -uantweb -p ant | gzip > backup.sql.gzComplete deployment guide: See ARCHITECTURE.md → "Deployment"
| Layer | Technology |
|---|---|
| Backend | Java (Struts), Apache Tomcat |
| API | Python (Flask), SQLAlchemy |
| Database | MySQL 5.x |
| Search | Apache Solr |
| Frontend | JSP, JavaScript, jQuery |
| Infrastructure | Docker, Docker Compose |
| Web Server | Caddy (automatic HTTPS) |
| File Storage | DigitalOcean Spaces (S3-compatible) |
Detailed breakdown: ARCHITECTURE.md → "Technology Stack"
- Specimens: 500,000+ records
- Taxa: 50,000+ ant species and subspecies
- Images: 200,000+ high-resolution images (~1.6 TB)
- Geographic Locations: 5,000+ countries, states, and regions
- API Requests: ~1M per month
- Taxonomic Database - Complete ant taxonomy based on Bolton's catalog
- Specimen Records - Museum specimens with location, images, and metadata
- Image Gallery - Multiple views (head, dorsal, profile) for most species
- Geographic Distribution - Species occurrence maps and endemic species tracking
- RESTful API - Programmatic access to all data
- Curator Tools - Web-based tools for data upload and management
antweb/
├── src/org/calacademy/antweb/ # Java source code
│ ├── home/ # Database access layer (TaxonDb, SpecimenDb, etc.)
│ ├── upload/ # File upload processing
│ └── util/ # Utilities
├── web/ # Frontend (JSP templates, JS, CSS)
├── api/v3/ # Python Flask API
├── db/ # Database schema and migrations
├── WEB-INF/ # Web application configuration
├── docker/ # Docker configuration
└── doc/ # Legacy documentation
Detailed structure: DEVELOPMENT.md → "Project Structure"
1. Taxonomic Hierarchy
Subfamily (e.g., "formicinae")
└─ Genus (e.g., "camponotus")
└─ Species (e.g., "camponotus pennsylvanicus")
└─ Subspecies (e.g., "camponotus pennsylvanicus ferrugineus")
2. Database Schema
Primary tables:
taxon- All ant taxa (subfamilies to subspecies)specimen- Individual museum specimensimage- Specimen/taxon imagesgeolocale- Geographic locationsgeolocale_taxon- Species distributions
See: DATABASE.md → "Core Entity-Relationship Model"
3. Data Flow
User Upload → Validation → Database Insert → Index Update → Web Display
↓
Backup to S3
See: ARCHITECTURE.md → "Data Flow"
Add a new web page:
- Create JSP template in
web/ - Create Action class in
src/org/calacademy/antweb/ - Register in
WEB-INF/struts-config.xml - Deploy:
docker-compose exec antweb ant deploy
See: DEVELOPMENT.md → "Add a New Page"
Add a database table:
- Create migration SQL in
db/upgrade/{version}/ - Create Java Db class in
src/org/calacademy/antweb/home/ - Apply migration and redeploy
See: DEVELOPMENT.md → "Add a Database Table"
Add API endpoint:
- Create SQLAlchemy model in
api/v3/home/ - Add route to
api/v3/api.py - Test with cURL
See: DEVELOPMENT.md → "Add an API Endpoint"
Upload specimen data:
- Prepare tab-delimited file with 42 columns
- Upload via web interface at
/upload.do - Verify upload in logs
See: DATABASE.md → "Specimen Upload File Format"
Upload images:
- Prepare images named
{code}_{shot}_{num}.jpg - Upload via web interface
- Images automatically processed and stored
See: ARCHITECTURE.md → "Image Upload Flow"
We welcome contributions! Whether you're fixing bugs, adding features, improving documentation, or reporting issues.
- Read the docs - Especially DEVELOPMENT.md
- Set up environment - Follow the Quick Start above
- Find an issue - Check GitHub Issues
- Ask questions - Contact antweb@calacademy.org
- Fork the repository
- Create a feature branch (
feature/my-new-feature) - Make your changes
- Write/update tests and documentation
- Submit a pull request
Detailed process: DEVELOPMENT.md → "Contributing"
- Bug fixes - Fix issues, improve stability
- New features - Add functionality after discussion
- Documentation - Improve or add documentation
- Tests - Add unit or integration tests
- Performance - Optimize queries or code
- UI/UX - Improve user interface
These documentation files follow these conventions:
- Markdown format - GitHub-flavored markdown
- Code examples - Runnable, tested examples
- Clear structure - Logical sections with clear headings
- Cross-references - Links between related sections
- Version info - Updated with major changes
When to update:
- New features added
- API changes
- Database schema changes
- Deployment process changes
- Breaking changes
How to update:
- Edit relevant .md file in
/docs - Update "Last Updated" date
- Include in pull request with code changes
- Get documentation reviewed
- GitHub Issues: https://github.com/calacademy-research/antweb/issues
- Email: antweb@calacademy.org
- Live Site Help: https://www.antweb.org/feedback.do
When reporting bugs, please include:
- Description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment (browser, OS, etc.)
- Screenshots if applicable
We're always looking to improve! Submit feature requests via GitHub Issues with:
- Clear description of the feature
- Use case / motivation
- Proposed implementation (optional)
- Willingness to contribute
AntWeb data is provided under Creative Commons licenses (varies by content). Check individual record license fields for specific terms.
Code: [License information to be added]
AntWeb is maintained by the California Academy of Sciences and supported by contributions from myrmecologists worldwide.
Project Lead: Brian Fisher
Development Team: Past and present contributors listed in CONTRIBUTORS.md
Special thanks to:
- Bolton's World Catalog of Ants (taxonomic authority)
- AntWiki community
- Museum collections worldwide
- Individual photographers and researchers
- AntWiki: https://www.antwiki.org
- Bolton's Catalog: References in AntWiki
- California Academy of Sciences: https://www.calacademy.org
- AntCat: https://github.com/calacademy-research/antcat
- AntWeb Mobile: (if applicable)
If using AntWeb data in research, please cite:
Fisher, B.L. and AntWeb. [Year]. AntWeb. Version [X.X].
California Academy of Sciences. Available from: https://www.antweb.org
(accessed [date])
- Initial comprehensive documentation created
- Architecture, Database, API, and Development guides
- Consolidated legacy documentation
- Added quick start guides and examples
Last Updated: January 2026
Documentation Version: 1.0
AntWeb Version: 8.105+
| I want to... | Go to... |
|---|---|
| Understand the system architecture | ARCHITECTURE.md |
| Learn the database schema | DATABASE.md |
| Use the API | API.md |
| Set up development environment | DEVELOPMENT.md |
| Deploy to production | ARCHITECTURE.md → Deployment |
| Upload specimen data | DATABASE.md → Specimen Upload |
| Add a new feature | DEVELOPMENT.md → Development Workflow |
| Fix a bug | DEVELOPMENT.md → Debugging |
| Optimize performance | ARCHITECTURE.md → Performance |
| Report an issue | GitHub Issues |