Files
Pac-Man/pacman-server
Ryan Walters 0b5aeceb51 feat: improve test reliability and add request tracing
- Add retry configuration for flaky tests (2 retries for default, 3 for
OAuth)
- Configure test groups with proper concurrency limits (serial: 1,
integration: 4)
- Add tower-http tracing layer with custom span formatting for HTTP
requests
- Simplify database pool handling by removing unnecessary Arc wrapper
- Improve test context setup with better logging and error handling
- Refactor user creation parameters for better clarity and consistency
- Add debug logging for OAuth cookie handling
2025-09-19 17:35:53 -05:00
..

pacman-server

Despite the naming of this crate, it's not a server for the Pac-Man game allowing multiplayer or anything super interesting.

This crate is a webserver that hosts an OAuth login and leaderboard API for the main pacman crate to hook into.

Features

  • Axum Webserver
    • Health Check
    • Inbound Rate Limiting
    • Outbound Rate Limiting
    • Provider Circuit Breaker
  • Database
  • OAuth
    • Discord
    • GitHub
    • Google
  • Leaderboard
    • Score Submission
    • Score Listings
      • Pagination
      • Global / Daily
  • Name Restrictions & Flagging
  • Avatars
    • 8-bit Conversion
    • Storage?
  • Common Server/Client Crate
  • CI/CD & Tests

Todo

  1. Refresh Token Handling (Encryption, Expiration & Refresh Timings)
  2. Refresh Token Background Job
  3. S3 Storage for Avatars
  4. Common Server/Client Crate, Basics
  5. Crate-level Log Level Configuration
  6. Span Tracing
  7. Avatar Pixelization
  8. Leaderboard API
  9. React-based Frontend
  10. Name Restrictions & Flagging
  11. Simple CI/CD Checks & Tests
  12. API Rate Limiting (outbound provider requests)
  13. API Rate Limiting (inbound requests, by IP, by User)
  14. Provider Circuit Breaker
  15. Merge migration files

Notes

Image Handling

Avatar images are stored in S3 as follows:

  • avatars/{user_public_id}/{avatar_hash}.original.png

  • avatars/{user_public_id}/{avatar_hash}.mini.png

  • The original image is converted to PNG and resized to a maximum of 512x512 pixels.

    • Ideally, non-square images are fitted to a square.
  • The mini image is converted to PNG and resized to a maximum of 16x16, 24x24, or 32x32 pixels. TBD.

  • All images receive a Content-Type header of image/png.

Image processing is handled immediately asynchronously, allowing a valid presigned URL to be generated immediately.