fediversion/LOCAL_DEV.md
fullsizemalt b4cddf41ea feat: Initialize Fediversion multi-band platform
- Fork elmeg-demo codebase for multi-band support
- Add data importer infrastructure with base class
- Create band-specific importers:
  - phish.py: Phish.net API v5
  - grateful_dead.py: Grateful Stats API
  - setlistfm.py: Dead & Company, Billy Strings (Setlist.fm)
- Add spec-kit configuration for Gemini
- Update README with supported bands and architecture
2025-12-28 12:39:28 -08:00

2.3 KiB

Local Development Setup (No Docker)

Backend Setup

  1. Create Virtual Environment (if not already done):
cd backend
python3 -m venv venv
source venv/bin/activate  # On Mac/Linux
  1. Install Dependencies:
pip install -r requirements.txt
  1. Set Environment Variables:
export DATABASE_URL="sqlite:///./elmeg.db"
export SECRET_KEY="your-secret-key-for-jwt"
  1. Run Migrations:
alembic upgrade head
  1. Start Backend:
uvicorn main:app --reload --port 8000

Backend will be available at: http://localhost:8000


Frontend Setup

  1. Install Dependencies:
cd frontend
npm install
  1. Set Environment Variables: Create frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
  1. Start Frontend:
npm run dev

Frontend will be available at: http://localhost:3000


Testing the Application

  1. Create a User:

    • Navigate to http://localhost:3000
    • Register a new account
  2. Test Features:

    • Browse shows at /archive
    • Search with Cmd+K
    • Create a group at /groups
    • Check settings at /settings
    • View admin dashboard at /admin (if superuser)
  3. Create Superuser (for admin access):

# In backend directory with venv activated
python -c "
from database import engine
from models import User
from sqlmodel import Session, select
from passlib.context import CryptContext

pwd_context = CryptContext(schemes=['bcrypt'], deprecated='auto')

with Session(engine) as session:
    user = session.exec(select(User).where(User.email == 'your@email.com')).first()
    if user:
        user.is_superuser = True
        user.role = 'admin'
        session.add(user)
        session.commit()
        print(f'User {user.email} is now a superuser')
    else:
        print('User not found')
"

Common Issues

Backend won't start

  • Check if port 8000 is already in use: lsof -i :8000
  • Ensure virtual environment is activated
  • Verify all dependencies installed: pip list

Frontend won't start

  • Check if port 3000 is already in use: lsof -i :3000
  • Clear .next cache: rm -rf .next
  • Reinstall dependencies: rm -rf node_modules && npm install

Database issues

  • Delete and recreate: rm elmeg.db then alembic upgrade head
  • Check migration status: alembic current