INFO:     Started server process [86774]
INFO:     Waiting for application startup.
2026-03-26 17:46:38,877 - passlib.handlers.bcrypt - WARNING - (trapped) error reading bcrypt version
Traceback (most recent call last):
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
    version = _bcrypt.__about__.__version__
              ^^^^^^^^^^^^^^^^^
AttributeError: module 'bcrypt' has no attribute '__about__'
2026-03-26 17:46:39,116 - root - INFO - Demo user created on startup
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)
Using mongomock fallback!
INFO:     127.0.0.1:36360 - "POST /api/auth/login HTTP/1.1" 401 Unauthorized
INFO:     127.0.0.1:45306 - "POST /api/auth/login HTTP/1.1" 200 OK
INFO:     127.0.0.1:45306 - "OPTIONS /api/dashboard/stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:45322 - "GET /api/dashboard/stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:45322 - "GET /api/dashboard/stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "GET /api/games HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "GET /api/games HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "OPTIONS /api/courses/my-enrollments HTTP/1.1" 200 OK
INFO:     127.0.0.1:55674 - "OPTIONS /api/courses/my-enrollments HTTP/1.1" 200 OK
INFO:     127.0.0.1:55674 - "GET /api/courses HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "GET /api/courses/my-enrollments HTTP/1.1" 200 OK
INFO:     127.0.0.1:55678 - "GET /api/courses HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "GET /api/courses/my-enrollments HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "OPTIONS /api/community/stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:55678 - "OPTIONS /api/community/stats HTTP/1.1" 200 OK
INFO:     127.0.0.1:55674 - "GET /api/community/stats HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/server.py", line 664, in get_community_stats
    total_players = await db.users.count_documents({})
                          ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MockAsyncIOMotorCollection' object has no attribute 'count_documents'
INFO:     127.0.0.1:55678 - "GET /api/leaderboard?timeframe=all-time&category=overall&limit=50 HTTP/1.1" 200 OK
INFO:     127.0.0.1:55670 - "GET /api/community/stats HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 148, in simple_response
    await self.app(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/venv/lib/python3.12/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcs/Documents/dev/EduA03-main/backend/server.py", line 664, in get_community_stats
    total_players = await db.users.count_documents({})
                          ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MockAsyncIOMotorCollection' object has no attribute 'count_documents'
INFO:     127.0.0.1:55678 - "GET /api/leaderboard?timeframe=all-time&category=overall&limit=50 HTTP/1.1" 200 OK
