113 lines
3.6 KiB
Markdown
113 lines
3.6 KiB
Markdown
# VTuber Star Awards
|
|
|
|
Monorepo for the VTuber Star Awards MVP.
|
|
|
|
## Stack
|
|
|
|
- Frontend: Vue 3, Vite, Pinia, Tailwind CSS, PrimeVue, shadcn-style Vue UI primitives
|
|
- Backend: ASP.NET Core 8, EF Core 8, PostgreSQL
|
|
|
|
## Structure
|
|
|
|
- `frontend/` Vue application
|
|
- `Backend/` ASP.NET Core API
|
|
- `prototype/` earlier visual prototype work
|
|
- `docker-compose.dev.yml` optional local PostgreSQL container
|
|
|
|
## Frontend
|
|
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
cp .env.example .env
|
|
npm run dev
|
|
```
|
|
|
|
The frontend uses a lightweight local session flow for development:
|
|
|
|
- Sign in from the header
|
|
- `Viewer Login` unlocks nomination and voting
|
|
- `Admin Login` unlocks the admin routes and management views
|
|
- Voting and nominations can be resubmitted; the backend updates the existing user state instead of blindly duplicating submissions
|
|
|
|
## Backend
|
|
|
|
Development uses the same local PostgreSQL defaults as `docker-compose.dev.yml`:
|
|
|
|
```text
|
|
Host=localhost;Port=5433;Database=vtuber_star_awards_dev;Username=vtsa_dev;Password=change-me-local-only
|
|
```
|
|
|
|
Those defaults are already present in `Backend/appsettings.Development.json`. For other environments, keep `Backend/appsettings.json` empty and set `VTSA_POSTGRES` or `ConnectionStrings__Postgres`.
|
|
|
|
```bash
|
|
cd Backend
|
|
dotnet restore
|
|
dotnet build
|
|
ASPNETCORE_ENVIRONMENT=Development dotnet run --urls http://127.0.0.1:5084
|
|
```
|
|
|
|
## Local Database
|
|
|
|
If Docker is available locally:
|
|
|
|
```bash
|
|
docker compose -f docker-compose.dev.yml up -d
|
|
cd Backend
|
|
dotnet ef database update
|
|
```
|
|
|
|
Default dev database:
|
|
|
|
```text
|
|
Host=localhost;Port=5433;Database=vtuber_star_awards_dev;Username=vtsa_dev;Password=change-me-local-only
|
|
```
|
|
|
|
Override `VTSA_DEV_POSTGRES_USER` and `VTSA_DEV_POSTGRES_PASSWORD` before starting Docker if you want different local credentials.
|
|
|
|
If `dotnet ef database update` is unavailable in the current environment, the repository also contains a bootstrap SQL script:
|
|
|
|
```bash
|
|
cd Backend
|
|
psql "Host=localhost Port=5433 Database=vtuber_star_awards_dev Username=vtsa_dev Password=change-me-local-only" -f Migrations/InitialCreate.manual.sql
|
|
```
|
|
|
|
Verify the runtime wiring:
|
|
|
|
```bash
|
|
curl http://127.0.0.1:5084/api/health
|
|
curl http://127.0.0.1:5084/api/health/database
|
|
```
|
|
|
|
Development auth/session endpoints:
|
|
|
|
```bash
|
|
curl -X POST http://localhost:5084/api/auth/dev-login \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"twitchUserId":"jayuhime_demo","displayName":"Jayuhime","role":"admin"}'
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Public endpoints live under `/api/public/*`
|
|
- Admin summary endpoint lives under `/api/admin/dashboard`
|
|
- Session endpoints live under `/api/auth/*`
|
|
- Database connectivity and pending migrations are exposed at `/api/health/database`
|
|
- Current frontend store falls back to static seed-like data if the API is unavailable
|
|
- The admin dashboard now includes a lightweight risk center and audit log for suspicious submit patterns and reviewed admin actions
|
|
|
|
## Suggested Backend Rollout Phases
|
|
|
|
1. Public participation core
|
|
- Home, nominations, voting, clip submission, winner archive
|
|
- Backend focus: overview/category/archive reads plus persisted user participation state
|
|
2. Admin season setup
|
|
- Admin years, categories, candidates, season status
|
|
- Backend focus: season/category/candidate CRUD and current-year switching
|
|
3. Review and moderation
|
|
- Admin reviews, nominations inbox, clips, risk center
|
|
- Backend focus: nomination approval/rejection, clip moderation states, risk resolution workflows
|
|
4. Reporting and operations
|
|
- Admin dashboard, analytics, user logs, settings health checks
|
|
- Backend focus: richer aggregates, audit search/filtering, operational health endpoints
|