A full-stack application for exploring and managing retro video game consoles, built with NestJS (Backend) and Nuxt 4 (Frontend). Features GitHub OAuth authentication, a beautiful glassmorphism UI, and Docker containerization with hot-reloading support.
- ๐ฎ Browse Consoles - View retro gaming consoles with their top games
- ๐ GitHub OAuth Login - Secure authentication via GitHub
- โ Suggest Consoles - Authenticated users can add new consoles
- ๐๏ธ Delete with Animation - Remove your consoles with animation effects
- ๐จ Modern UI - Glassmorphism design with Tailwind CSS
- ๐ฑ Responsive - Works on all device sizes
- โก Hot Reloading - Development mode with instant updates (Docker + Windows compatible)
- ๐ก๏ธ JWT Authentication - Secure API endpoints
- ๐ OAuth 2.0 - GitHub login integration with Passport.js
- ๐ฏ RESTful API - Clean, organized endpoints
- ๐ค User Ownership - Track who created each console
- ๐ Authorization - Users can only delete their own consoles
- ๐ณ Dockerized - Multi-stage builds for dev and production
- Framework: NestJS 10
- Language: TypeScript
- Authentication: Passport.js (GitHub Strategy)
- JWT: @nestjs/jwt
- Runtime: Node.js 22
- Package Manager: pnpm
- Containerization: Docker (multi-stage builds)
- Framework: Nuxt 4
- Language: TypeScript
- UI Library: Vue 3 (Composition API)
- Styling: Tailwind CSS 3
- State Management: Vue composables (useState)
- HTTP Client: Nuxt $fetch
- Containerization: Docker with hot-reloading support
- Container Orchestration: Docker Compose
- Development: Hot-reloading with file watching (polling for Windows)
- Production: Optimized multi-stage Docker builds
- Startup Script: Interactive bash script for dev/prod mode selection
- Node.js v22+ (or use Docker)
- Docker & Docker Compose
- GitHub OAuth App credentials
- pnpm (if running locally without Docker)
Create a .env file in the backend directory:
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_CALLBACK_URL=http://localhost:3001/api/auth/callbackNote: Create a GitHub OAuth App at GitHub Developer Settings with the Authorization callback URL set to
http://localhost:3001/api/auth/callback.
bash start-docker.shThe script will prompt you to:
- Choose development (with hot-reloading) or production mode
- Decide whether to rebuild containers
- Optionally start the containers
Development Mode (with hot-reloading):
export FRONTEND_TARGET=stage-dev
docker compose up -dProduction Mode:
export FRONTEND_TARGET=stage-prod
docker compose up -d --buildAccess the Application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
Backend:
cd backend
pnpm install
pnpm run start:devFrontend:
cd frontend
pnpm install
pnpm run dev.
โโโ backend/ # NestJS backend
โ โโโ src/
โ โ โโโ auth/ # OAuth & JWT authentication
โ โ โโโ console/ # Console CRUD operations
โ โ โโโ user.controller.ts
โ โ โโโ main.ts
โ โโโ Dockerfile # Multi-stage Docker build
โ โโโ package.json
โโโ frontend/ # Nuxt 4 frontend
โ โโโ app/
โ โ โโโ pages/ # Route pages (index, dashboard, suggest)
โ โ โโโ composables/ # useAuth composable
โ โ โโโ middleware/ # Auth middleware
โ โ โโโ assets/ # CSS and styles
โ โโโ Dockerfile # Multi-stage Docker build (dev/prod)
โ โโโ nuxt.config.ts # Nuxt configuration
โ โโโ package.json
โโโ docker-compose.yml # Container orchestration
โโโ start-docker.sh # Interactive startup script
โโโ README.md
GET /api/consoles- List all consoles
GET /api/user/profile- Get authenticated user profilePOST /api/consoles- Create a new console (auto-assigns createdBy)DELETE /api/consoles/:id- Delete a console (only if you created it)
GET /api/auth/github- Initiate GitHub OAuth flowGET /api/auth/callback- GitHub OAuth callback (redirects to frontend with JWT)
- User clicks "Log In with GitHub" on homepage
- Redirected to GitHub OAuth authorization
- After approval, redirected to backend callback
- Backend generates JWT and redirects to frontend dashboard with token
- Frontend stores token in cookie and fetches user profile
- User can now suggest and delete consoles
- View: All users can see all consoles
- Create: Authenticated users can suggest new consoles
- Delete: Users can only delete consoles they created
- Validation: Duplicate ID and name checks before creation
- Animation: Explosion effect when deleting
- Hot Reloading: File changes instantly reflected (uses polling for Windows compatibility)
- Volume Mounts: Source code mounted for live updates
- Multi-Stage Builds: Separate stages for base, dev, build, and production
- Optimized Images: Production images exclude dev dependencies
stage-base: Common dependencies and setupstage-dev: Development with hot-reloadingstage-build: Build production assetsstage-prod: Serve production build
FRONTEND_TARGET: Controls which Docker stage to use (stage-devorstage-prod)NUXT_PUBLIC_API_BASE: API base URL (default:http://localhost:3001/api)
The frontend uses Vite with polling enabled to support hot-reloading in Docker on Windows:
// nuxt.config.ts
vite: {
server: {
watch: {
usePolling: true,
interval: 1000,
},
},
}The backend enables CORS for the frontend origin:
app.enableCors({
origin: 'http://localhost:3000',
credentials: true,
});MIT
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with NestJS and Nuxt 4
- Styled with Tailwind CSS
- Authenticated with Passport.js
- Containerized with Docker