fix: resolve startup errors and model inconsistencies #9

Merged
kevin merged 5 commits from dev/buxfixes into main 2026-05-10 21:21:00 +00:00
Owner

Summary

Collection of bug fixes discovered during first full startup attempt.
Backend now starts without errors.

Fixes

main.py

  • Fix app.include_router() called before FastAPI() instantiation
  • Add missing imports (engine, SessionLocal, settings)
  • Add missing model imports (city, user, guild) for create_all
  • Add guilds router
  • Remove unused get_db import
  • Remove hardcoded quest seed data (quests come from YAML)
  • Add base_dexterity and base_willpower to HeroClass seed data

quest.py

  • Add missing Float to SQLAlchemy imports
  • Add QuestStatus enum (was missing after earlier edits)
  • Add missing relationships (city, npc, QuestEventInstance)
  • Fix column/relationship ordering (Column before relationship)

guild.py / guilds.py

  • Add missing from pydantic import BaseModel to guilds.py
  • Add GuildType enum import where missing

config.py

  • Fix ALLOWED_ORIGINS parsing — requires JSON array format in .env

Notes

Many of these bugs accumulated from design-first development without
running the server between changes. Going forward: start server after
each significant model change to catch import errors early.

## Summary Collection of bug fixes discovered during first full startup attempt. Backend now starts without errors. ## Fixes ### main.py - Fix `app.include_router()` called before `FastAPI()` instantiation - Add missing imports (`engine`, `SessionLocal`, `settings`) - Add missing model imports (`city`, `user`, `guild`) for `create_all` - Add `guilds` router - Remove unused `get_db` import - Remove hardcoded quest seed data (quests come from YAML) - Add `base_dexterity` and `base_willpower` to HeroClass seed data ### quest.py - Add missing `Float` to SQLAlchemy imports - Add `QuestStatus` enum (was missing after earlier edits) - Add missing relationships (`city`, `npc`, `QuestEventInstance`) - Fix column/relationship ordering (Column before relationship) ### guild.py / guilds.py - Add missing `from pydantic import BaseModel` to guilds.py - Add `GuildType` enum import where missing ### config.py - Fix `ALLOWED_ORIGINS` parsing — requires JSON array format in `.env` ## Notes Many of these bugs accumulated from design-first development without running the server between changes. Going forward: start server after each significant model change to catch import errors early.
Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Fix app.include_router() called before FastAPI() instantiation
- Add missing imports (engine, SessionLocal, settings)
- Add missing model imports (city, user, guild) for create_all
- Add guilds router
- Remove unused get_db import
- Remove hardcoded quest seed data (quests come from YAML)
- Add base_dexterity and base_willpower to HeroClass seed data

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Add city relationship (City back_populates quests)
- Add npc relationship (CityNPC back_populates quests)
- Add guild_id FK to guilds table
- Add QuestEventInstance back_populates quest

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
kevin merged commit 3d37b0769d into main 2026-05-10 21:21:00 +00:00
kevin deleted branch dev/buxfixes 2026-05-10 21:21:00 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kevin/nexus-rpg!9
No description provided.