Anki Conjoined is a comprehensive solution for synchronizing Anki flashcards across multiple devices and enabling collaborative learning through shared decks. This project consists of both a client-side Anki add-on and a server component with a web interface.
Traditional Anki synchronization relies on AnkiWeb, which doesn't support collaborative editing of decks. Anki Conjoined fills this gap by providing:
- Multi-device synchronization independent of AnkiWeb
- Collaborative deck creation and editing
- Permission management for shared decks
- Simple sharing mechanism using unique deck codes
The project consists of three main components:
- Client Add-on: An Anki add-on that enables communication with the server
- Socket Server: A Python socket server that handles card data synchronization
- Web Server: A Django web application for user management, deck administration, and permissions
- Python 3.8 or higher
- Anki 2.1.x installed on your computer
- Command line/terminal access
# Clone the repository
git clone <repository-url>
cd AnkiConjoined
# Create and activate virtual environment
python3 -m venv .venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activate
# Install Python dependencies
pip install django requests# Navigate to Django project
cd Server/WebServer
# Set up database
python manage.py migrate
# Create admin user (you'll use this to log in)
python manage.py createsuperuser
# Test the setup
python manage.py check-
Find your Anki add-ons folder:
- Open Anki
- Go to Tools > Add-ons > View Files
- This opens your add-ons directory
-
Install the add-on:
- In the add-ons directory, create a new folder called
anki_conjoined - Copy ALL contents from the
card_sync_serverfolder into this new folder - The structure should look like:
anki_conjoined/ ├── __init__.py ├── main.py ├── client.py ├── auth_manager.py ├── login_dialog.py ├── settings_dialog.py ├── testAnkiConnected.py └── DataManagement/ └── random_words
- In the add-ons directory, create a new folder called
-
Restart Anki - You should now see a "Card Sync" menu
Terminal 1 - Django Web Server:
cd AnkiConjoined/Server/WebServer
source ../../.venv/bin/activate # Activate virtual environment
python manage.py runserver- This runs the web interface at http://127.0.0.1:8000/
- Keep this terminal open
Terminal 2 - Socket Server:
cd AnkiConjoined/Server
source ../.venv/bin/activate # Activate virtual environment
python server.py- This runs the sync server on localhost:9999
- Keep this terminal open
- Open http://127.0.0.1:8000/ in your web browser
- Click "Register" and create a user account
- Log in to verify your account works
- In Anki, click the "Card Sync" menu
- Select "Settings" and configure:
- Socket Server Host:
127.0.0.1 - Socket Server Port:
9999 - Web Server URL:
http://127.0.0.1:8000
- Socket Server Host:
- Click "Save"
- In Anki, go to "Card Sync" > "Login"
- Enter the username and password you created in Step 5
- If successful, you'll see a "Login successful" message
- Create a deck in Anki with some cards
- Upload to server: Card Sync > Sync with Server > Select your deck > Choose "create"
- Share with others: Give them your deck code from the web interface
- Import shared deck: Card Sync > Sync with Server > Choose "new" > Enter deck code
- Sync changes: Card Sync > Sync with Server > Choose "update" to sync both ways
- View and manage all your decks
- Share deck codes with other users
- Manage user permissions (Creator, Manager, Writer, Reader)
- Edit deck descriptions
# Make sure you created the virtual environment
python3 -m venv .venv
source .venv/bin/activate
pip install django requestscd Server/WebServer
python manage.py migrate
python manage.py check- Make sure you copied ALL files from
card_sync_server/ - Check that the folder is named correctly in your add-ons directory
- Restart Anki completely
- Ensure both servers are running (Steps 4)
- Check firewall settings
- Verify server addresses in Anki settings match your running servers
- Create account through web interface first (Step 5)
- Use exact same credentials in Anki
- Make sure Django server is running
You can modify server settings by editing the configuration files:
To change the socket server host and port, modify the Server class initialization in server.py:
# Find this line at the bottom of server.py:
if __name__ == "__main__":
server = Server() # Default is localhost:9999
# Change it to specify your desired host and port:
if __name__ == "__main__":
server = Server(host="0.0.0.0", port=8888) # Example: listen on all interfaces, port 8888Common host settings:
"localhost"or"127.0.0.1": Only accept connections from the same machine"0.0.0.0": Accept connections from any network interface (needed for remote access)- Specific IP: Only accept connections from that specific interface
To change the Django web server address and port:
# Specify the IP address and port
python manage.py runserver 0.0.0.0:8000 # Listen on all interfaces, port 8000
# Or use a specific IP
python manage.py runserver 192.168.1.100:8000 # Listen on specific IP, port 8000The web interface provides additional features:
- User Management: Add or remove users from decks
- Permission Control: Change user roles and access levels
- Deck Description: Update deck information and descriptions
When multiple users work on the same deck:
-
Permission Levels:
- Creator (c): Full control over the deck, including deletion
- Manager (m): Can manage users and edit cards
- Writer (w): Can add and edit cards
- Reader (r): Can only view and use cards
-
Synchronization Process:
- Changes made by multiple users are tracked by timestamps
- When syncing, only newer or modified cards are transferred
- Each card maintains a unique ID (stable_uid) to track it across systems
If using PyCharm, VS Code, etc.:
- Set Python interpreter to:
<project-path>/.venv/bin/python - Set working directory to appropriate folder:
- Django:
Server/WebServer - Socket Server:
Server - Anki Add-on: Test within Anki
- Django:
- The communication between client and server is not encrypted by default
- Passwords are stored securely in the Django database
- Default setup is for local development only
- For production use, configure proper security settings and consider using HTTPS
Contributions are welcome! Please feel free to submit a Pull Request.