Commit Graph

542 Commits

Author SHA1 Message Date
Ryan Walters
7eb4705b7c fix(ci): use railway redeploy instead of railway up
Changed deployment command from `railway up` to `railway redeploy` because
the Railway service is configured to use an external Docker image from GHCR,
not source code deployment. The `railway up` command was attempting to build
from source with Railpack, which failed since no source code was provided.

The `railway redeploy` command triggers Railway to pull the latest image
from ghcr.io/xevion/pac-man:latest and redeploy the service.
2025-11-22 22:15:50 -06:00
Ryan Walters
a98ad23348 chore(deps): reconfigure Dependabot with granular update groups
Replaced monolithic dependency grouping with 13 separate update groups
across Cargo (game/server), npm (frontend), and GitHub Actions ecosystems.

Key improvements:
- Separate patch/minor/major updates to prevent breaking changes from
  blocking safe updates
- Group by crate (game vs server) for easier review
- Enable auto-merge for patch updates via labels
- Weekly checks with 5 PR limit to avoid spam
- Ignore bevy_ecs 0.17+ and jsonwebtoken 10+ until manual migration

Closed PR #10 (22 jumbled updates causing build failures).
2025-11-22 21:58:27 -06:00
Ryan Walters
3e08720b43 fix(ci): correct Railway CLI invocation in GitHub Actions
The deployment was failing because the workflow used incorrect syntax
with `uses: docker://` which caused Docker to misinterpret `up` as an
executable rather than an argument to the Railway CLI.

Split deployment into a separate job using `container:` at the job level,
allowing the Railway CLI to execute properly. This follows Railway's
official documentation for GitHub Actions integration.
2025-11-22 21:43:04 -06:00
Ryan Walters
c306e992c4 fix(game): resolve race condition in render dirty flag using bitwise OR
The render dirty flag was being reset instead of accumulated, causing
the game to become stuck and unplayable in web builds. Changed from
assignment to bitwise OR to preserve all dirty state updates.

Also adds game layout component and updates Justfile to build frontend.
2025-11-22 21:14:24 -06:00
Ryan Walters
9bf8d0428c feat(ci): trigger Railway deployment immediately after Docker push
Add Railway CLI step to GitHub Actions workflow that deploys to Railway
immediately after the Docker image is pushed to ghcr.io.
2025-11-22 19:08:05 -06:00
Ryan Walters
e00d209047 fix(web): enable prerendering for static deployment
Enable prerendering to generate index.html during build while keeping SSR disabled for Emscripten/WASM compatibility. This allows static hosting platforms to serve the application correctly.
2025-11-22 18:30:09 -06:00
dependabot[bot]
8be95a20ba chore(deps): bump actions/upload-artifact in the dependencies group (#9)
Bumps the dependencies group with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/upload-artifact` from 4 to 5
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 08:44:13 -06:00
Ryan Walters
ad6fd00197 refactor(docker): move frontend build into multi-stage Docker build
- Remove frontend build steps from GitHub Actions workflow
- Add frontend-builder stage using oven/bun:1 in Dockerfile
- Build frontend inside Docker for better consistency and portability
- Copy built frontend from frontend-builder stage to runtime image
- Simplify CI/CD pipeline by consolidating build steps
2025-11-02 22:56:07 -06:00
Ryan Walters
52dee3eee4 feat(server): add trailing slash normalization and API root endpoint
- Add tower-http normalize-path feature to handle trailing slashes
- Implement NormalizePathLayer to trim trailing slashes from URLs
- Add GET /api/ endpoint with API description message
- Fix OAuth callback redirect to use /api/profile path
2025-11-02 22:51:17 -06:00
Ryan Walters
83e389d789 fix(docker): include dist directory in Docker builds
Remove /dist from .dockerignore to ensure frontend build artifacts are
available in the Docker container for deployment.
2025-11-02 20:57:45 -06:00
Ryan Walters
8f8f82630f fix(tests): update all test routes to use /api prefix
All API routes were moved under /api prefix as part of the unified
deployment architecture. Updated test files to reflect this change:

- basics.rs: Update root and auth/providers routes
- health.rs: Update health endpoint routes
- oauth.rs: Update all OAuth and auth callback routes, plus redirect locations
- sessions.rs: Update profile and logout routes

This fixes 9 failing tests that were expecting routes without the /api prefix.
2025-11-02 19:51:52 -06:00
Ryan Walters
45e6131121 feat: implement unified deployment with Docker and Railway integration
This commit introduces a comprehensive deployment strategy that unifies the frontend and backend into a single Docker container served by the Rust backend, streamlining the deployment process and improving production architecture.

Key changes:
- Split CI/CD workflows: separated build.yaml (for CI/PR checks) and deploy.yaml (for production deployment)
- Implemented unified Docker deployment where the Axum server serves both API routes (under /api) and frontend static files
- Added GitHub Container Registry integration for Docker image distribution
- Updated Railway configuration to use the new healthcheck path (/api/health)
- Enhanced postgres.ts script with named volumes and constants for better container management
- Added API client utilities (web/lib/api.ts) and environment configuration (web/.env.example) for frontend-backend communication
- Configured Vite proxy for local development while supporting same-origin requests in production
- Updated Dockerfile to include frontend static files and proper environment variable handling

This architecture eliminates the need for separate deployments and CORS configuration, as the frontend and API are served from the same origin.
2025-11-02 19:31:22 -06:00
Ryan Walters
4002729ef7 fix(ci): update deployment path and add Vike build step
- Add web frontend build step to compile Vike site
- Change artifact upload path from ./dist/ to ./web/dist/
- Install web dependencies before building frontend
2025-11-02 13:44:38 -06:00
Ryan Walters
fb98c077b5 refactor(web): migrate frontend to Tailwind CSS and Vike SSR
- Replace Mantine UI components with Tailwind CSS v4
- Migrate from static HTML to Vike-based SSR framework
- Disable SSR for game page (Emscripten requires browser environment)
- Simplify Emscripten loading to avoid hydration conflicts
- Remove Tailwind download logic from web.build.ts
- Add package manager lockfiles for reproducible builds
- Update .gitignore for node_modules and build artifacts
2025-11-02 13:39:51 -06:00
Ryan Walters
ffc5b8d15b fix: set VCPKG_ROOT for rust-sdl2 to find cargo-vcpkg libraries
cargo-vcpkg installs to target/vcpkg but rust-sdl2's vcpkg-rs crate
auto-detection doesn't reliably find it on all platforms. Set VCPKG_ROOT
explicitly to ensure consistent library discovery across platforms.
2025-11-02 13:06:38 -06:00
Ryan Walters
4f49355892 fix: prevent vcpkg cache poisoning with version-based keys
Cache restore-keys allowed old vcpkg builds to be restored when baseline
changed, causing persistent failures. Extract vcpkg version from Cargo.toml
using cargo metadata and use it as primary cache key component.

- Extract vcpkg baseline via cargo metadata (structured parsing)
- Unified vcpkg cache with version-isolated keys
- Removed manual macOS vcpkg setup and A/B test steps
- Cache cargo-vcpkg binary for faster builds
2025-11-02 12:48:00 -06:00
Ryan Walters
07e0709c50 test: A/B test cargo-vcpkg vs manual vcpkg with 2025.10.17
Adds cargo-vcpkg step alongside manual vcpkg for macOS to determine if
the fix is due to using manual vcpkg or simply upgrading to vcpkg
2025.10.17. Both methods will run to compare behavior.

- Updated vcpkg baseline from 2024.11.16 to 2025.10.17
- Restored macOS triplets in Cargo.toml
- Added duplicate cargo-vcpkg step for macOS builds
2025-11-02 11:52:39 -06:00
Ryan Walters
aeb03aaf52 fix: use manual vcpkg installation for macOS builds
Replaces cargo-vcpkg with direct vcpkg installation for macOS to fix
libogg build failures. Uses vcpkg 2025.10.17 with proper SDL2 package
installation and VCPKG_ROOT environment variable for rust-sdl2
integration. Windows and Linux continue using cargo-vcpkg.
2025-11-02 11:34:55 -06:00
Ryan Walters
3f6126418a ci: update macOS runner versions in build workflow
Update GitHub Actions macOS runners to use macos-15-intel for x86_64 and macos-15 for aarch64 targets to align with latest runner availability.
2025-11-02 10:43:19 -06:00
Ryan Walters
54ef292606 chore: update vcpkg baseline to 2024.11.16
Updates vcpkg from 2024.05.24 to stable 2024.11.16 release to fix
platform-specific build failures. Avoids 2025.x versions which have
breaking vcpkgTools.xml changes incompatible with cargo-vcpkg.
2025-11-02 10:34:54 -06:00
Ryan Walters
13e592502f fix: update vcpkg cache paths and web serve directory
Update GitHub Actions workflows to use correct Cargo.toml/Cargo.lock paths
in root directory instead of pacman/ subdirectory. Fix Justfile web command
to serve from web/dist/client instead of pacman/dist.
2025-11-02 09:57:02 -06:00
Ryan Walters
d9519746b8 fix: proper asset path for emscripten 2025-09-29 15:29:52 -05:00
Ryan Walters
55b31ba31e feat: setup 'web' frontend 2025-09-25 12:37:21 -05:00
Ryan Walters
c524fdb3e7 fix: rewrite oauth provider linking system, add email_verified attribute for providers 2025-09-24 13:38:31 -05:00
Ryan Walters
bdd3c74a2d refactor: general improvements, better comments, structuring of oauth flow (but still broken) 2025-09-24 13:13:10 -05:00
Ryan Walters
655c3c68d5 chore: limit retry to once 2025-09-24 12:08:04 -05:00
Ryan Walters
6134da1d49 chore: log testcontainer request duration, limit request trace to just image 2025-09-24 12:06:24 -05:00
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
Ryan Walters
e1b266f3b2 refactor: rename Claims fields internally, maintain terse serialization with serde rename 2025-09-19 11:56:02 -05:00
Ryan Walters
76985f6390 refactor: allow testing of mocked providers via AuthRegistry creation, avoid creation of responses in auth 2025-09-19 11:50:25 -05:00
Ryan Walters
4a041a7695 test: apply coverage filters to pacman-server crate 2025-09-19 10:46:23 -05:00
Ryan Walters
62b619a3cc ci: adjust timeouts for nextest given docker requirements 2025-09-19 10:28:59 -05:00
Ryan Walters
67c9460c84 refactor(auth): implement session-based PKCE and eliminate provider duplication
- Replace in-memory PKCE storage with encrypted session cookies
- Add PKCE verifier and CSRF state fields to JWT Claims struct
- Move common PKCE validation logic to OAuthProvider trait
- Extract provider-specific methods for token exchange and user fetching
- Remove PkceManager and DashMap-based storage system
- Update GitHub and Discord providers to use new session-based approach
2025-09-19 10:23:33 -05:00
Ryan Walters
7e98bc7488 test: add low slow-timeout for nextest 2025-09-19 09:50:48 -05:00
Ryan Walters
698f95ff32 refactor: clean test setup code, cleanup tests, separate into different files 2025-09-19 09:50:22 -05:00
Ryan Walters
54eca9f447 fix: install crypto provider default select 2025-09-19 08:54:20 -05:00
Ryan Walters
f9e79eb6d6 fix: move railway.json to root, explicitly configure with Dockerfile 2025-09-19 08:35:47 -05:00
Ryan Walters
408b660490 fix: drop unused fast_image_resize, drop toolchain back to 1.86, limit emscripten build to pacman project properly 2025-09-18 23:16:55 -05:00
Ryan Walters
cc06cd88a1 refactor: allow optional database in setup, use derived default 2025-09-18 22:58:38 -05:00
Ryan Walters
e2c725cb95 feat: allow health check forcing in debug, setup test mocking, plan out integration tests 2025-09-18 22:42:00 -05:00
Ryan Walters
350f92ab21 tests: setup basic tests, integration tests with testcontainers 2025-09-18 21:33:15 -05:00
Ryan Walters
3ad00bdcba chore: setup lib for testing, image handling notes in README 2025-09-18 13:18:53 -05:00
Ryan Walters
7f9d3e9158 feat: implement r2 image upload for avatars 2025-09-18 13:18:14 -05:00
Ryan Walters
56e02e7253 refactor: remove unnecessary HashMap for passing code/state strings, formatter lifetime tweak 2025-09-17 13:18:58 -05:00
Ryan Walters
e2f3f6790f refactor: create common pkce handling, max_age on link cookie 2025-09-17 13:08:48 -05:00
Ryan Walters
1be59f474d feat: add Server header middleware, bump version to v0.4.0 2025-09-17 12:37:12 -05:00
Ryan Walters
916428fe76 feat: setup healthcheck route & background task 2025-09-17 12:32:52 -05:00
Ryan Walters
e02c2286bb chore: add .scripts with local postgres setup script, setup todo list in README 2025-09-17 12:23:55 -05:00
Ryan Walters
c12dc11d8f feat: normalize provider details into oauth_accounts table, auth linking intent, provider array in profile response 2025-09-17 11:17:31 -05:00
Ryan Walters
1cf3b901e8 feat: users table with sqlx, migrations, data persistence 2025-09-17 09:43:52 -05:00