Skip to content

Quick Start โ€‹

Estimated time: 45-90 minutes Difficulty: Beginner-friendly Prerequisites: Git and Docker installed (see below!)

This guide will take you from zero to making your first contribution to Open Library. It's designed for developers who want to jump in and start contributing quickly, without getting overwhelmed by details.

TIP

Need help? Join our weekly community calls (Tues @ 9am PT) or request a Slack invite.

๐Ÿ“‹ What You'll Learn โ€‹

By end of this guide, you'll know how to:

  1. Set up your development environment with Docker
  2. Understand the basics of Git workflow
  3. Find and select a good first issue
  4. Make a small code change
  5. Test your changes locally
  6. Submit your first pull request

Let's get started!

๐ŸŽฌ Step 0: Get Oriented (15 minutes) โ€‹

Before we dive into code, let's understand what Open Library is and how it works.

Watch the Quick Tour (10 min) โ€‹

This 10-minute video will help you understand the service you'll be contributing to:

Quick Public Tour of Open Library

Review Community Guidelines (5 min) โ€‹

Please review our Code of Conduct. We're committed to creating a safe, inclusive environment for all contributors.

๐Ÿ‹ Step 1: Set Up Your Environment (20-30 minutes) โ€‹

Prerequisites โ€‹

Before starting, ensure you have Docker, Git, and Pre-commit installed on your system.

Check if they're installed:

bash
docker --version
git --version
pre-commit --version

If these commands succeed and show version numbers, you're all set! ๐ŸŽ‰

Need to install?

TIP

Docker Desktop Settings: After installing Docker Desktop, we recommend allocating at least 4GB of RAM (8GB is better) in Docker Desktop โ†’ Settings โ†’ Resources to prevent memory issues during development.


1.1 Clone the Open Library Repository (5 min) โ€‹

Now let's get the Open Library code onto your computer.

Step 1: Fork the repository โ€‹

  1. Go to https://github.com/internetarchive/openlibrary
  2. Click the "Fork" button in the top-right corner
  3. This creates a copy of the repo under your GitHub account

Step 2: Clone your fork โ€‹

sh
# Replace YOUR_USERNAME with your GitHub username
git clone git@github.com:YOUR_USERNAME/openlibrary.git
cd openlibrary

IMPORTANT

Use git@ (SSH) not https:// - otherwise git submodules won't work properly. If you cloned with https by mistake, fix it here.

Step 3: Verify submodules are loaded โ€‹

sh
# These commands populate the infogami submodule
git submodule init
git submodule sync
git submodule update

1.2 Build and Run Open Library (10-15 min) โ€‹

Time to get Open Library running locally!

Build the project:

sh
# From the openlibrary directory (where compose.yaml is)
docker compose build

NOTE

This can take 15-30 minutes on older hardware. If it times out or fails, just run the command again.

Start the application:

sh
# Start Open Library (Ctrl-C to stop)
docker compose up

# Or start in background mode
docker compose up -d

Verify it's working:

  1. Wait until you see logs repeating every few seconds like:

    log
    infobase_1 | 172.19.0.5:45716 - "HTTP/1.1 GET /openlibrary.org/log/2023-02-16:0" - 200 OK
  2. Open your browser to: http://localhost:8080

  3. You should see the Open Library homepage with "development version" in the banner

Congratulations! ๐ŸŽ‰ You now have Open Library running locally.

๐Ÿ”ง Step 2: Understand the Git Workflow (15 minutes) โ€‹

You don't need to be a Git expert to contribute. Here's what you need to know for your first PR.

The Basic Git Flow โ€‹

When contributing, you'll follow this pattern:

text
1. Create a branch for your work
2. Make your changes
3. Test your changes locally
4. Commit your changes
5. Push your branch to your fork
6. Open a pull request

Add the Upstream Repository โ€‹

This lets you stay in sync with the official Open Library repository:

sh
# Add the main repo as a remote called "upstream"
git remote add upstream https://github.com/internetarchive/openlibrary.git

# Verify it was added
git remote -v

You should see both origin (your fork) and upstream (the official repo).

Create Your First Branch โ€‹

Let's create a branch for your first contribution. We use a consistent branch naming convention that includes the issue number and a brief description:

sh
# Ensure you're on the main branch
git switch master

# Pull latest changes from upstream
git pull upstream master

# Create a new branch with issue number and description
# Format: issue-number/type/brief-description
# Example: git switch -c 123/fix/broken-login-button
git switch -c 123/fix/broken-login-button

TIP

Branch naming convention: issue-number/type/brief-description

  • Types include: fix, feature, refactor, docs, test
  • This helps track your work and links branches to issues

๐ŸŽฏ Step 3: Find Your First Issue (15 minutes) โ€‹

Now let's find a good issue to work on.

Good First Issues โ€‹

We've curated issues specifically for new contributors:

Browse Good First Issues

When choosing an issue:

  • โœ… Pick one that's not assigned to anyone
  • โœ… Look for issues labeled with a programming language you know (Python, JavaScript, CSS, etc.)
  • โœ… Check that the issue has been active recently (no stale issues)
  • โŒ Don't pick issues someone else is actively working on

Request to Be Assigned โ€‹

Found an issue you want to work on? Comment on it:

text
Hi! I'd like to work on this issue. I'm a new contributor and this looks like a good place to start.

My understanding of the issue:
[Briefly summarize the problem in your own words]

My proposed approach:
[Explain how you think you'll fix it]

I plan to modify:
[Mention any files or areas you think you'll touch]

Questions:
[Any clarifying questions you have]

TIP

This shows you've read and understood the issue. Maintainers are more likely to assign issues to contributors who demonstrate understanding.

โœ๏ธ Step 4: Make Your Changes (varies by issue) โ€‹

This step depends on the issue you're working on. Here are some general tips:

Finding Relevant Files โ€‹

Need to find where something is in the codebase? Use your code editor's search feature:

Search in your IDE:

  • VS Code: Press Shift + Command + F (Mac) or Ctrl + Shift + F (Windows/Linux) to search all files
  • WebStorm / PyCharm: Press Shift + Shift twice and type "Find in Files"
  • Other editors: Look for "Find in Files" or "Search in Project" in your editor's menu

What to search for:

  • Function or class names
  • Text that appears on the page (in templates)
  • Variable names
  • Error messages

Making Your Changes โ€‹

  1. Edit files using your preferred code editor (VS Code, Vim, etc.)
  2. Test locally as you go
  3. Check your work - run the app and verify your changes work as expected

For frontend changes:

  • Refresh your browser at http://localhost:8080
  • Changes to HTML templates usually show immediately
  • CSS/JS changes may need a rebuild: docker compose run --rm home npm run build-assets

For backend changes:

  • The web server auto-reloads when Python files change
  • Check the console output for errors

๐Ÿงช Step 5: Test Your Changes (10 minutes) โ€‹

Before submitting, make sure your changes work correctly.

Manual Testing โ€‹

  1. Run Open Library locally: docker compose up (if not already running)
  2. Navigate to the page or feature you modified
  3. Test the specific behavior described in the issue
  4. Try to break it - what edge cases exist?

Run Automated Tests โ€‹

We have automated tests to catch common issues:

sh
# Run all tests
docker compose run --rm home make test

# Run tests for a specific file
docker compose run --rm home pytest openlibrary/plugins/somepath/tests/test_file.py

NOTE

If tests fail, you'll need to fix them before submitting your PR.

Run Pre-commit Checks โ€‹

Pre-commit hooks automatically check for code quality issues:

sh
# Run pre-commit on staged files
pre-commit run

# Run on specific files
pre-commit run --files path/to/file.py

๐Ÿ“ Step 6: Commit Your Changes (5 minutes) โ€‹

Time to save your work!

Stage and Commit Your Changes โ€‹

sh
# See what files have changed
git status

# Add the files you've changed
git add path/to/changed_file.py
# Or add all changes:
git add .

# Commit with a descriptive message
git commit -m "Fix: add typehints for coverstore"

๐Ÿš€ Step 7: Push and Create a Pull Request (10 minutes) โ€‹

Push Your Branch to GitHub โ€‹

sh
# Push your branch to your fork
# Replace with your actual branch name from Step 2
git push origin 123/fix/broken-login-button

# If the branch already exists remotely:
git push origin -u 123/fix/broken-login-button

Create Your Pull Request โ€‹

  1. Go to your fork on GitHub: https://github.com/YOUR_USERNAME/openlibrary
  2. You should see a banner asking to create a pull request
  3. Click "Compare & pull request"
  4. Fill out the PR template
  5. Click "Create pull request"

What Happens Next? โ€‹

  1. Automated checks will run (tests, linting, etc.)
  2. Reviewers will look at your changes
  3. Feedback may be requested - don't worry, this is normal!
  4. Address feedback by making more commits to your branch
  5. Get merged! ๐ŸŽ‰

TIP

  • Be responsive to reviewer feedback
  • Ask questions if you don't understand a request
  • It's okay if it takes multiple iterations to get merged

๐ŸŽ‰ Congratulations โ€‹

You've just made your first contribution to Open Library! Here's what to do next:

Keep Contributing โ€‹

Continue Learning โ€‹

Join the Community โ€‹

๐Ÿ†˜ Troubleshooting โ€‹

Docker Won't Start โ€‹

Problem: docker compose up fails with errors

Try these:

  1. Make sure you're in the openlibrary directory (where compose.yaml is)
  2. Stop and remove containers: docker compose down && docker compose rm -v
  3. Try again: docker compose up
  4. If that fails, try a full reset (see below)

Full Reset (nuclear option):

sh
# Stop everything
docker compose down

# Rebuild without cache
docker compose build --pull --no-cache

# Remove old containers and images
docker container prune --filter label="com.docker.compose.project=openlibrary" --force
docker image prune --filter label="com.docker.compose.project=openlibrary" --force

# Remove volumes (wipes database)
docker volume rm openlibrary_ol-build openlibrary_ol-nodemodules openlibrary_ol-postgres openlibrary_ol-vendor openlibrary_solr-data openlibrary_solr-updater-data

# Start fresh
docker compose up

Out of Memory Error โ€‹

Problem: OSError: [Errno 12] Cannot allocate memory

Solution: Increase Docker's allocated memory:

  • Docker Desktop โ†’ Settings โ†’ Resources โ†’ Advanced
  • Set memory to at least 4GB (8GB recommended)
  • Add swap space: 2GB minimum

Can't Access localhost:8080 โ€‹

Problem: Browser won't connect to http://localhost:8080

Try these:

  1. Verify containers are running: docker ps
  2. Check logs: docker compose logs web
  3. Restart containers: docker compose restart
  4. Wait 30-60 seconds and try again

Submodules Not Found โ€‹

Problem: No module named 'infogami' error

Solution:

sh
git submodule init
git submodule sync
git submodule update

Git Permission Denied โ€‹

Problem: Permission denied (publickey) when cloning

Solution: Set up SSH keys:

  1. Generate SSH key
  2. Add SSH key to GitHub account
  3. Re-clone using SSH: git clone git@github.com:YOUR_USERNAME/openlibrary.git

๐Ÿ’ก Tips for Success โ€‹

  • Start small: Pick a simple issue for your first contribution
  • Ask for help: Don't hesitate to ask questions in Slack or on issues
  • Learn by doing: The best way to understand is to make changes and see what breaks
  • Read existing code: Look at similar changes in the codebase
  • Be patient: Code review may take a few days
  • Celebrate! Every contribution, no matter how small, helps improve Open Library

Ready to make a difference? Let's build a better library, together! ๐Ÿ“šโœจ

Back to Developers Handbook