feat: Complete backend API setup with registration endpoint

- Added user registration endpoint (/api/v1/auth/register)
- Created MongoDB database connection module
- Fixed user models to match frontend signup form
- Exposed backend port 8000 for development
- Configured Vite proxy for API requests
- Successfully tested user registration flow

Backend is now fully functional with:
- MongoDB connection
- User registration with password hashing
- JWT token generation
- Proper error handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2025-08-31 11:46:04 +09:00
parent 0aa6db1b3b
commit 8996bd8638
6 changed files with 89 additions and 6 deletions

View File

@ -0,0 +1,20 @@
import os
from motor.motor_asyncio import AsyncIOMotorClient
from typing import Optional
mongodb_client: Optional[AsyncIOMotorClient] = None
database = None
async def connect_to_mongo():
global mongodb_client, database
mongodb_url = os.getenv("MONGODB_URL", "mongodb://localhost:27017")
mongodb_client = AsyncIOMotorClient(mongodb_url)
database = mongodb_client.oauth_db
async def close_mongo_connection():
global mongodb_client
if mongodb_client:
mongodb_client.close()
async def get_database():
return database