Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/igorek05m/daily-geogame/llms.txt

Use this file to discover all available pages before exploring further.

Welcome! We’re excited that you’re interested in contributing to Daily GeoGame. This project is open source and welcomes contributions from developers of all skill levels.

Ways to contribute

There are many ways you can help improve Daily GeoGame:
  • Write code: Fix bugs, add new features, or improve existing functionality
  • Improve documentation: Help others understand the project better
  • Report bugs: Let us know when something doesn’t work as expected
  • Share ideas: Suggest new features or improvements
  • Test the game: Play daily and provide feedback on the experience

Development setup

Before you start contributing code, you’ll need to set up your development environment. Follow the installation guide to get Daily GeoGame running locally. Make sure you have:
  • Node.js 20 or higher
  • pnpm installed globally
  • MongoDB Atlas connection string (for database access)

Project structure

Daily GeoGame uses Next.js 15 App Router. Here’s how the codebase is organized:
daily-geogame/
├── app/
│   ├── api/                    # API routes
│   │   ├── country/           # Country data endpoint
│   │   ├── daily/             # Daily country selection
│   │   ├── progress/          # Game progress tracking
│   │   └── stats/             # User statistics
│   ├── components/            # React components
│   │   ├── Footer.tsx
│   │   ├── GameHeader.tsx
│   │   ├── GuessInput.tsx
│   │   ├── GuessList.tsx
│   │   ├── HintGrid.tsx
│   │   ├── HowToPlay.tsx
│   │   ├── LastHint.tsx
│   │   ├── Map.tsx
│   │   ├── Modal.tsx
│   │   ├── Privacy.tsx
│   │   └── StatsModal.tsx
│   ├── hooks/                 # Custom React hooks
│   │   └── useDailyGame.ts
│   ├── lib/                   # Utility libraries
│   │   ├── factbook.ts        # CIA World Factbook data
│   │   ├── geoUtils.ts        # Geography utilities
│   │   └── mongodb.ts         # Database connection
│   ├── types.ts               # TypeScript type definitions
│   ├── layout.tsx             # Root layout
│   └── page.tsx               # Home page
├── public/                     # Static assets
├── package.json
├── tsconfig.json
└── eslint.config.mjs

Key directories

  • app/api/: Server-side API routes that handle game logic, data fetching, and statistics
  • app/components/: Reusable React components for the UI
  • app/hooks/: Custom hooks like useDailyGame for game state management
  • app/lib/: Utility functions for geography calculations, data processing, and database access

Code style guidelines

Daily GeoGame follows standard TypeScript and React best practices:

TypeScript

  • Write type-safe code using TypeScript
  • Define types in app/types.ts or co-locate them with components
  • Avoid using any unless absolutely necessary (disabled in ESLint config)
  • Use interfaces for object shapes and types for unions/primitives

React and Next.js

  • Use React 19 features and modern patterns
  • Prefer function components with hooks
  • Use Next.js App Router conventions (server components by default)
  • Keep components focused and single-purpose
  • Use 'use client' directive only when necessary

ESLint

The project uses ESLint with Next.js configuration. Run the linter before committing:
pnpm lint
ESLint extends next/core-web-vitals and next/typescript with these custom rules:
  • @typescript-eslint/no-explicit-any: off
  • react/no-unescaped-entities: off
  • no-var: off

File naming

  • Components: PascalCase (e.g., GameHeader.tsx)
  • Utilities: camelCase (e.g., geoUtils.ts)
  • Hooks: camelCase with use prefix (e.g., useDailyGame.ts)
  • API routes: lowercase (e.g., route.ts)

Pull request process

Follow these steps to submit your contribution:
1

Fork and clone

Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/YOUR_USERNAME/daily-geogame.git
cd daily-geogame
2

Create a branch

Create a new branch for your changes:
git checkout -b feature/your-feature-name
Use descriptive branch names:
  • feature/ for new features
  • fix/ for bug fixes
  • docs/ for documentation
  • refactor/ for code refactoring
3

Make your changes

Write your code, following the style guidelines above. Test your changes locally:
pnpm dev
Ensure the build passes:
pnpm build
4

Lint your code

Run ESLint to catch any issues:
pnpm lint
5

Commit your changes

Write clear, descriptive commit messages (see conventions below):
git add .
git commit -m "feat: add terrain hint animation"
6

Push and create PR

Push your branch and create a pull request:
git push origin feature/your-feature-name
Go to GitHub and open a pull request against the main branch.

Commit message conventions

Use clear, descriptive commit messages that explain what changed and why. Follow this format:
type: brief description

Optional longer description explaining why this change was made.

Commit types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, spacing)
  • refactor: Code refactoring without changing behavior
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks, dependencies

Examples

feat: add hint reveal animation
fix: correct neighbor country highlighting on map
docs: update installation instructions
refactor: simplify guess validation logic

Issue reporting guidelines

Found a bug or have a suggestion? Here’s how to report it effectively:

Bug reports

When reporting a bug, include:
  1. Clear description: What went wrong?
  2. Steps to reproduce: How can we see the bug?
  3. Expected behavior: What should have happened?
  4. Actual behavior: What actually happened?
  5. Environment: Browser, OS, device type
  6. Screenshots: If applicable

Feature requests

When suggesting a feature, explain:
  1. The problem: What need does this address?
  2. Your solution: How would this feature work?
  3. Alternatives: What other approaches did you consider?
  4. Examples: Are there similar features elsewhere?

Where to report

Open an issue on GitHub: github.com/igorek05m/daily-geogame/issues

Code of conduct

We’re committed to providing a welcoming and inclusive environment. When contributing:
  • Be respectful and considerate
  • Welcome newcomers and help them learn
  • Focus on constructive feedback
  • Assume good intentions
  • Respect differing opinions and experiences
Everyone is here to learn and improve the project together.

License

By contributing to Daily GeoGame, you agree that your contributions will be licensed under the MIT License. This means:
  • Your code can be freely used, modified, and distributed
  • You retain copyright to your contributions
  • The project can continue to be open source
See the full MIT License for details.
Thank you for contributing to Daily GeoGame! Your help makes this project better for everyone.

Build docs developers (and LLMs) love