Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Shankar-105/Social-Media-Api
/ functions
Functions
373 in github.com/Shankar-105/Social-Media-Api
⨍
Functions
373
◇
Types & classes
106
↳
Endpoints
72
Function
get_recent_chats
( db: AsyncSession = Depends(getDb), currentUser: models.User = Depends(oauth2.getCurrentUser) )
app/messaging/chat_history.py:147
Function
get_reserved_tasks
Get list of reserved tasks (tasks pulled from queue but not yet executed). Returns: List of reserved tasks waiting to execute.
app/routes/celery_tasks.py:99
Function
get_saved_posts
( db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(oauth2.getCurrentU
app/routes/saved.py:99
Function
get_shared_post_reactions
( shared_id: int, db: AsyncSession = Depends(db.getDb), currentUser: models.User = Depends(oauth2.
app/messaging/share_reaction.py:24
Function
get_task_status
Get status and result of a specific task. Returns: - task_id: UUID of the task - status: PENDING, STARTED, RETRY, FAILUR
app/routes/celery_tasks.py:13
Function
get_token
(client, create_test_user)
pytests/conftest.py:316
Function
get_unread_count
Return the count of unread notifications - used for the badge number.
app/services/notification_service.py:142
Function
get_unread_notification_count
( db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(oauth2.getCurrentU
app/routes/notifications.py:65
Function
get_user_avatar
(user_id:int, db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/users.py:82
Function
get_user_posts
(user_id:int, limit:int=Query(10, ge=1, le=100), offset: int = Query(0, ge=0), db:AsyncSession=Depends(db.getD
app/routes/users.py:210
Function
get_user_profile
(user_id:int, db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/users.py:24
Function
get_vote_stats
(db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/me.py:250
Function
get_voted_posts
(db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/me.py:228
Function
get_worker_stats
Get statistics about all Celery workers. Returns: Worker stats including pool size, processed tasks, total tasks.
app/routes/celery_tasks.py:126
Function
hashPassword
Hash a password using bcrypt — offloaded to a thread pool to avoid blocking the event loop.
app/utils/thread_helpers.py:27
Function
health_check
Comprehensive health check for the API and its dependencies.
app/main.py:206
Function
integrity_exception_handler
(request: Request, exc: IntegrityError)
app/utils/exception_handlers.py:32
Function
is_blacklisted
Checks if a token is in the Redis blacklist.
app/services/redis_service.py:166
Function
lifespan
(app: FastAPI)
app/main.py:58
Function
likeAComment
(commentId:int, comment:sch.CommentVoteRequest=Body(...), db:AsyncSession=Depends(getDb), currentUser:models.U
app/routes/like.py:84
Function
list_users
(db:AsyncSession=Depends(db.getDb))
app/routes/users.py:123
Function
load_missed_content
( user_id: int, db: AsyncSession=Depends(db.getDb) )
app/messaging/load_missed_msgs.py:11
Function
loginUser
(userCred:OAuth2PasswordRequestForm=Depends(),db:AsyncSession=Depends(db.getDb),_:None=Depends(login_limiter))
app/routes/auth.py:30
Function
logout
(token: str = Depends(oauth2.oauth2_scheme), db: AsyncSession = Depends(db.getDb))
app/routes/auth.py:79
Function
mark_all_notifications_read
( db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(oauth2.getCurrentU
app/routes/notifications.py:88
Function
mark_all_read
Bulk-mark every unread notification for a user as read.
app/services/notification_service.py:152
Function
mark_as_read
(payload: dict, reader_id: int, db: AsyncSession)
app/messaging/read_receipt.py:13
Function
messageUser
( payload:schemas.MessageSchema, user_id:int, db:AsyncSession )
app/messaging/dm.py:15
Function
mock_db
Mock database session for testing.
pytests/test_cross_process_chat_delivery.py:26
Function
mock_redis_client
Mock Redis client for testing.
pytests/test_cross_process_chat_delivery.py:18
Function
mock_session_factory
()
pytests/test_notification_pubsub.py:30
Function
msg_reactions
( msg_id:int, db: AsyncSession = Depends(db.getDb), currentUser: models.User = Depends(oauth2.getC
app/messaging/msg_reaction.py:22
Function
myProfile
(db:AsyncSession=Depends(db.getDb),currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/me.py:26
Function
operational_error_handler
(request: Request, exc: OperationalError)
app/utils/exception_handlers.py:82
Function
override_getDb
()
pytests/conftest.py:273
Function
purge_queue
Purge all tasks from a specific queue. WARNING: This will delete all pending tasks in the queue! Args: queue_name: Name of queue
app/routes/celery_tasks.py:170
Function
react
( reaction:schemas.ReactionPayload, user_id:int, db: AsyncSession )
app/messaging/msg_reaction.py:55
Function
react_to_shared_post
( reaction: schemas.ReactionPayload, user_id: int, db: AsyncSession )
app/messaging/share_reaction.py:57
Function
reconcile_denormalized_counters_task
(self)
app/tasks/reconciliation_task.py:9
Function
refresh_token
(payload: sch.RefreshTokenRequest = Body(...), db: AsyncSession = Depends(db.getDb), _: None = Depends(refresh
app/routes/auth.py:72
Function
register_user
(userData:sch.UserSignupRequest=Body(...), db:AsyncSession=Depends(db.getDb), _:None=Depends(signup_limiter))
app/routes/users.py:97
Function
remove_follower_endpoint
(user_id:int, follower_id:int, db: AsyncSession = Depends(getDb), currentUser: models.User = Depends(oauth2.ge
app/routes/connect.py:106
Function
reply_msg
( payload:schemas.ReplyMessageSchema, user_id:int, db:AsyncSession )
app/messaging/reply_msg.py:16
Function
reply_share
( payload:schemas.ReplyToShareSchema, user_id:int, db: AsyncSession )
app/messaging/reply_to_share.py:15
Function
resend_verification_otp
(payload: sch.ResendVerificationOtpRequest, db: AsyncSession = Depends(db.getDb), _: None = Depends(forgot_pas
app/routes/auth.py:178
Function
reset_password
(payload: sch.ResetPasswordSchema, db: AsyncSession = Depends(db.getDb), _: None = Depends(reset_password_limi
app/routes/auth.py:121
Function
reset_password_authenticated
(request:schemas.PasswordResetRequest=Body(...),db:AsyncSession=Depends(db.getDb),currentUser:models.User=Depe
app/routes/changepassword.py:36
Function
revoke_all_user_tokens
Revoke every refresh token for a user (called on password change).
app/services/token_service.py:121
Function
revoke_task
Revoke (cancel) a specific task. Args: task_id: UUID of task to revoke terminate: If True, terminate the task if it's cu
app/routes/celery_tasks.py:151
Function
root_home
()
app/main.py:112
Function
rotate_refresh_token
( db: AsyncSession, old_token_str: str )
app/services/token_service.py:43
Function
saveOtp
(db:AsyncSession,email:str,otp:str,minutes:int=2)
app/services/otp_service.py:23
Function
save_post
( post_id: int, db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(
app/routes/saved.py:44
Function
search
(searchParams: sch.SearchRequest = Depends(), db: AsyncSession = Depends(db.getDb), currenUser: models.User =
app/routes/search.py:16
Function
send_media
( file: UploadFile = File(...), to: int = Form(...), current_user = Depends(oauth2.getCurrentUser)
app/messaging/media_msg.py:23
Function
send_otp_email
(to_email:str,otp:str)
app/services/email_service.py:21
Function
send_otp_email
(self, to_email: str, otp: str)
app/tasks/email_tasks.py:8
Method
send_to_user
(self, message: str, receiver_id: int)
app/utils/socket_manager.py:171
Function
send_verification_email
(to_email: str, otp: str)
app/services/email_service.py:46
Function
send_verification_email
(self, to_email: str, otp: str)
app/tasks/email_tasks.py:17
Method
send_wrapper
(message)
app/utils/observability.py:98
Function
setup
()
loadtests/load.js:17
Function
setup
()
loadtests/stress.js:18
Function
setup
()
loadtests/smoke.js:16
Function
setup_celery_logging
Ensure Celery workers use structlog.
app/utils/logging.py:107
Function
setup_test_db
()
pytests/conftest.py:235
Function
share_post
1. Validate post exists 2. Validate receiver exists & not self 3. Save SharedPost record 4. Push a **preview** to receiver via WebSoc
app/messaging/share.py:26
Function
sqlalchemy_exception_handler
(request: Request, exc: SQLAlchemyError)
app/utils/exception_handlers.py:69
Function
test_actor_basic_maps_profile_picture_alias
()
pytests/test_edge_cases.py:203
Function
test_add_comment
(client, get_token)
pytests/test_comments.py:1
Function
test_can_edit_response_schema
Verify CanEditResponse for edit_msg endpoint
pytests/test_edge_cases.py:118
Function
test_celery_queue_and_beat_configuration
()
pytests/test_celery_infrastructure.py:37
Method
test_chat_listener_extracts_receiver_id
Test that _chat_messages_listener extracts receiver_id from payload.
pytests/test_cross_process_chat_delivery.py:289
Function
test_comment_create_response
Verify comment creation returns CommentDetailResponse
pytests/test_edge_cases.py:145
Function
test_comment_list_response_schema
Verify comments return proper CommentListResponse
pytests/test_schema_validation.py:96
Function
test_comment_stats_response_schema
Verify CommentStatsResponse
pytests/test_edge_cases.py:58
Method
test_connection_manager_ignores_offline_users
Test that ConnectionManager doesn't crash when user is offline.
pytests/test_cross_process_chat_delivery.py:268
Method
test_connection_manager_offline_doesnt_crash
Test that ConnectionManager doesn't crash for offline users.
pytests/test_cross_process_chat_delivery.py:253
Function
test_create_notification_falls_back_to_local_send_when_redis_fails
()
pytests/test_notification_pubsub.py:59
Function
test_create_notification_publishes_to_redis_and_includes_receiver_id
()
pytests/test_notification_pubsub.py:13
Function
test_create_post
(client, get_token)
pytests/test_posts.py:1
Function
test_create_post_requires_auth
(client)
pytests/test_posts.py:20
Function
test_create_post_response_has_core_fields
(client, get_token)
pytests/test_posts.py:25
Function
test_delete_comment_not_exist
(client, get_token)
pytests/test_comments.py:11
Function
test_delete_for_everyone_is_single_transition
(db_session_factory, monkeypatch)
pytests/test_concurrency_hardening.py:118
Method
test_deleted_message_publishes_to_redis
Test that delete_msg.delete_for_everyone publishes to Redis.
pytests/test_cross_process_chat_delivery.py:89
Method
test_deleted_share_publishes_to_redis
Test that delete_shares.delete_share_for_everyone publishes to Redis.
pytests/test_cross_process_chat_delivery.py:215
Method
test_direct_message_publishes_to_redis
Test that dm.messageUser publishes to Redis for cross-process delivery.
pytests/test_cross_process_chat_delivery.py:48
Function
test_end_to_end_cross_process_scenario
Conceptual end-to-end test for cross-process message delivery. Scenario: - User 1 on Process 1 sends message to User 2 - User 2
pytests/test_cross_process_chat_delivery.py:338
Function
test_error_responses_consistent_format
Verify all error responses follow same format
pytests/test_schema_validation.py:77
Function
test_feed_response_structure
Verify FeedResponse schema
pytests/test_edge_cases.py:100
Function
test_follow_is_atomic_under_concurrency
(db_session_factory)
pytests/test_concurrency_hardening.py:156
Function
test_follow_response_includes_count
Verify follow/unfollow returns FollowResponse with count
pytests/test_schema_validation.py:153
Function
test_follow_unfollow
(client, get_token)
pytests/test_connections.py:1
Function
test_get_all_users
(client, get_token)
pytests/test_users.py:11
Function
test_get_notifications_empty
Fresh test user starts with zero notifications.
pytests/test_notfications.py:3
Function
test_get_post
(client, get_token)
pytests/test_posts.py:9
Function
test_invalid_token_returns_401
Verify authentication failures are consistent
pytests/test_edge_cases.py:135
Method
test_listener_handles_missing_receiver_id
Test that listener gracefully handles messages without receiver_id.
pytests/test_cross_process_chat_delivery.py:303
Function
test_load_missed_claims_each_message_once
(db_session_factory)
pytests/test_concurrency_hardening.py:85
← previous
next →
201–300 of 373, ranked by callers