mirror of
https://github.com/arthur-pbty/binouz.git
synced 2026-06-03 23:36:27 +02:00
b7010a1704
- Implemented AuthButton component for Discord sign-in and sign-out functionality. - Created CopyButton component for copying server IP addresses. - Developed EventCard and GradeCard components for displaying events and grades. - Added Footer and Navbar components for site navigation and information. - Introduced PurchaseButton for handling grade purchases with Stripe integration. - Created SectionHeader component for consistent section titles. - Implemented session management with SessionProvider for NextAuth. - Set up PostgreSQL database with Docker and Prisma for data management. - Added admin guard functionality to restrict access to certain routes. - Configured NextAuth with Discord provider for user authentication. - Defined Prisma schema for user, admin, grade, event, and purchase models. - Seeded database with initial grades and events data. - Added SVG hero image for the landing page. - Extended NextAuth types to include additional user properties.
78 lines
1.5 KiB
Markdown
78 lines
1.5 KiB
Markdown
# BinouzUHC
|
|
|
|
Modern Minecraft UHC landing page with Discord authentication, admin panel, and a ready-to-docker stack.
|
|
|
|
## Stack
|
|
|
|
- Next.js (App Router) + TypeScript
|
|
- Tailwind CSS
|
|
- Prisma + PostgreSQL
|
|
- NextAuth (Discord OAuth)
|
|
- Docker / docker-compose
|
|
|
|
## Quick start (Docker)
|
|
|
|
1. Copy env file:
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
2. Fill the values in `.env`:
|
|
|
|
```txt
|
|
NEXTAUTH_SECRET=
|
|
NEXTAUTH_URL=http://localhost:3000
|
|
|
|
DISCORD_CLIENT_ID=
|
|
DISCORD_CLIENT_SECRET=
|
|
|
|
DATABASE_URL=postgresql://user:password@db:5432/binouz
|
|
|
|
ADMIN_DISCORD_ID=
|
|
```
|
|
|
|
3. Build and run:
|
|
|
|
```bash
|
|
docker compose up --build
|
|
```
|
|
|
|
4. (Optional) Seed initial grades/events:
|
|
|
|
```bash
|
|
docker compose exec app npm run db:seed
|
|
```
|
|
|
|
Open http://localhost:3000.
|
|
|
|
## Admin access
|
|
|
|
- Set `ADMIN_DISCORD_ID` in `.env` to the Discord user ID that should be admin.
|
|
- First sign-in will automatically register the user and grant admin access.
|
|
- Admin panel: `/admin`.
|
|
|
|
## Local development (no Docker)
|
|
|
|
```bash
|
|
npm install
|
|
npm run prisma:migrate
|
|
npm run dev
|
|
```
|
|
|
|
## Project structure
|
|
|
|
```
|
|
app/ App Router pages, layouts, API routes
|
|
components/ UI and dashboard components
|
|
lib/ Auth, db, helpers
|
|
prisma/ Prisma schema and seed
|
|
docker/ Docker notes and future overrides
|
|
```
|
|
|
|
## Notes
|
|
|
|
- The purchase flow is mocked and ready for Stripe integration.
|
|
- Discord profile data is stored on sign-in (id, username, avatar).
|
|
- Environment variables are required for OAuth and database access.
|