Skip to main content

Category Management

Categories are the foundation of Budget Bee’s organization system, allowing you to classify and analyze your financial transactions.

Overview

Categories help you:
  • Organize transactions into meaningful groups
  • Analyze spending patterns by category
  • Create budgets based on categories
  • Generate reports showing category breakdowns
  • Visualize data with color-coded charts

Default Categories

Budget Bee automatically creates three categories when you sign up:
-- From packages/core/migrations/init.sql
CREATE OR REPLACE FUNCTION create_default_categories () RETURNS TRIGGER AS $$
BEGIN
    INSERT INTO categories (name, user_id)
    VALUES ('Food', NEW.id), ('Travel', NEW.id), ('Sales', NEW.id);
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;

Food

Restaurants, groceries, coffee shops, and food delivery

Travel

Transportation, hotels, flights, car rentals, and gas

Sales

Revenue from sales, services, or other income sources
You can customize, rename, or delete these categories as needed.

Creating Categories

1

Open Category Dialog

Click Categories in settings or create a category from the transaction editor.
2

Enter Category Details

name
string
required
Category name (e.g., “Entertainment”, “Utilities”, “Freelance Income”)
description
string
Optional description to clarify the category’s purpose
color
string
6-character hex color code (without #) for visual identification
3

Save Category

Click Save to create the category. It’s immediately available for transactions.
// From apps/web/components/category-dialog.tsx
const handleSubmit = async (data: CategoryFormValues) => {
  const mutation = isEditing ? 'update' : 'insert';
  
  await db.from('categories')[mutation]({
    name: data.name,
    description: data.description,
    color: data.color,
    user_id: user.id,
    organization_id: activeOrganization?.id
  });
  
  toast.success(`Category ${isEditing ? 'updated' : 'created'}`);
};

Color Coding

Categories support custom colors for visual identification:

Choosing Colors

  • Use distinct colors for different category types
  • Consistent color schemes improve usability
  • Consider accessibility (avoid relying solely on color)

Color Examples

CategorySuggested ColorHex Code
IncomeGreen10b981
FoodOrangef97316
HousingBlue3b82f6
TransportationYelloweab308
EntertainmentPurplea855f7
HealthcareRedef4444
UtilitiesTeal14b8a6
// Category badge with color
// From apps/web/components/category-badge.tsx
export function CategoryBadge({ category }) {
  return (
    <Badge 
      style={{ 
        backgroundColor: `#${category.color}`,
        color: 'white'
      }}
    >
      {category.name}
    </Badge>
  );
}

Category Hierarchy

Budget Bee currently supports flat categories. Subcategories are planned for future releases: Current structure:
Food
Travel
Entertainment
Utilities
Planned hierarchy:
Food
  ├─ Groceries
  ├─ Restaurants
  └─ Coffee Shops
  
Travel
  ├─ Flights
  ├─ Hotels
  └─ Car Rental
For now, use descriptive names to create pseudo-subcategories like “Food - Groceries” and “Food - Restaurants”.

Managing Categories

Editing Categories

1

Open Category List

Navigate to settings or use the category picker in transaction dialogs.
2

Select Category

Click on the category you want to edit.
3

Modify Details

Update the name, description, or color.
4

Save Changes

Click Save to update the category.
Renaming a category updates it for all existing transactions using that category.

Deleting Categories

When you delete a category:
  1. The category is removed from the system
  2. Existing transactions keep their category reference but show as “Uncategorized”
  3. The deletion cannot be undone
-- Category deletion behavior
create table transactions (
  -- ...
  category_id uuid references categories (id) on delete set null,
  -- ...
);
Instead of deleting, consider renaming or merging categories to preserve transaction history.

Category Picker

The category picker provides quick category selection:
// From apps/web/components/category-picker.tsx
export function CategoryPicker({ value, onValueChange }) {
  const { data: categories } = useCategories();
  
  return (
    <Popover>
      <PopoverTrigger>
        <Badge>{selectedCategory?.name || 'Select Category'}</Badge>
      </PopoverTrigger>
      <PopoverContent>
        <Command>
          <CommandInput placeholder="Search categories..." />
          <CommandList>
            {categories?.map(category => (
              <CommandItem
                key={category.id}
                onSelect={() => onValueChange(category.id)}
              >
                <CategoryBadge category={category} />
                {category.name}
              </CommandItem>
            ))}
          </CommandList>
        </Command>
      </PopoverContent>
    </Popover>
  );
}

Picker Features

  • Search: Type to filter categories
  • Color preview: See category colors before selecting
  • Create new: Add categories without leaving the dialog
  • Recent categories: Frequently used categories appear first

Category Analytics

Use categories to analyze your spending:

Spending by Category

View total spending for each category:
  • Identify your highest expense categories
  • Compare spending across categories
  • Track category trends over time

Category Charts

Visualize category data:
  • Donut charts: Show spending proportions
  • Bar charts: Compare category amounts
  • Line charts: Track category spending over time
  • Stacked charts: Show category breakdown by month

Database Schema

Categories are stored with this structure:
create table categories (
  id uuid primary key default gen_random_uuid(),
  name varchar(255) not null,
  description varchar(1000),
  color varchar(6),
  user_id text references users (id),
  organization_id text references organizations (id)
);

Row-Level Security

Categories use RLS to ensure data isolation:
CREATE POLICY limit_categories ON categories FOR ALL TO authenticated USING (
  organization_id = org_id ()
  OR (
    organization_id IS NULL
    AND user_id = uid ()
  )
)
WITH CHECK (
  organization_id = org_id ()
  OR (
    organization_id IS NULL
    AND user_id = uid ()
  )
);

Organization Categories

In multi-user organizations:
  • Personal categories: Visible only to you (organization_id is NULL)
  • Shared categories: Visible to all organization members
  • Organization admins: Can create shared categories
  • Members: Use shared categories, create personal ones
Create shared categories for common expenses like “Office Supplies” or “Client Entertainment” in business organizations.

Category Import/Export

Export your category structure:
[
  {
    "name": "Groceries",
    "description": "Food and household items",
    "color": "10b981"
  },
  {
    "name": "Utilities",
    "description": "Electricity, water, internet",
    "color": "3b82f6"
  }
]
Import categories to:
  • Migrate from another app
  • Share category structures with team members
  • Backup your category configuration
  • Set up new organization accounts

Best Practices

Keep It Simple

Start with 5-10 categories. Add more only as needed.

Be Consistent

Always categorize transactions the same way for accurate reporting.

Use Clear Names

Choose descriptive names that are obvious to all users.

Color Code

Assign distinct colors to make categories instantly recognizable.

Common Category Schemes

Personal Finance

  • Housing (rent, mortgage, property tax)
  • Transportation (car payment, gas, public transit)
  • Food (groceries, dining out)
  • Utilities (electricity, water, internet, phone)
  • Insurance (health, auto, life, home)
  • Healthcare (doctor visits, prescriptions)
  • Entertainment (movies, concerts, hobbies)
  • Personal Care (haircuts, gym, clothing)
  • Savings & Investments
  • Debt Payments
  • Miscellaneous

Business Finance

  • Revenue
  • Cost of Goods Sold
  • Payroll
  • Office Expenses
  • Marketing & Advertising
  • Professional Services
  • Travel & Entertainment
  • Equipment & Supplies
  • Insurance
  • Utilities
  • Taxes
  • Miscellaneous

Troubleshooting

Check:
  • The category wasn’t deleted
  • You have the correct organization selected
  • The category belongs to your account or organization
  • Browser cache is up to date (try refreshing)
Verify:
  • You’re not trying to delete a system category
  • You have the necessary permissions
  • The category isn’t linked to a budget
  • Try reassigning transactions to another category first
Ensure:
  • The color code is 6 hex digits (e.g., ff0000)
  • No # symbol in the color code
  • Valid hex characters only (0-9, a-f)
This may happen if:
  • The category was renamed after transaction creation
  • A bulk edit changed categories
  • Data was imported with incorrect category mapping
Use bulk edit to fix incorrect categories.

Build docs developers (and LLMs) love