Skip to content

CarlosCanet/advientea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Adviente - Tea Advent Calendar ๐Ÿต

Project Type GitHub deployments Tech Stack License

A gamified advent calendar web application for tea lovers, built with Next.js 16, featuring daily challenges, user authentication, and a ranking system. This app is designed for the community participating in this special event.

Try the app | Bug report

๐ŸŽฏ Project Overview

Each accepted participant is responsible for curating their assigned day, updating tea information, and setting the daily atmosphere. A logistical coordinator (affectionately known as the Execu-TEA-ve) assigns days and manages the distribution of physical tea packs to all participants beforehand.

On the designated days (typically early December), the cycle unfolds as follows:

  • Morning: Essential brewing instructions and initial mood setting.
  • Noon & Afternoon: Enhanced atmosphere (music, photos, stories) is revealed.
  • Evening: The tea's identity and purchase details are finally unveiled.

Participants can also play AdivinaTรฉ (Guess the Tea). Registered users earn points by guessing any or all of the following: tea name, ingredients, type, and/or the contributor. You can guess just one field or all of them. Points for each correct guess are calculated immediately and stored, and revealed at the same time as tea name but if you only guess the contributor the points remain hidden until the final revelation day.

โœจ Features

  • ๐Ÿ” Secure Authentication: User registration, login, and password recovery with BetterAuth
  • ๐Ÿ“… Interactive Calendar: Grid-based advent calendar with daily tea reveals
  • ๐ŸŽฎ Gamification: Guess tea info daily and earn points based on accuracy and timing
  • ๐Ÿ† Ranking System: Daily and overall leaderboards with highlighted top 3 users
  • ๐Ÿ“– Story Content: Progressive narrative reveals with optional YouTube media
  • ๐Ÿ–ผ๏ธ Image Management: Cloudinary integration for avatars and tea day images
  • ๐Ÿ‘ฅ User Roles: Admin (full system access), Execu-TEA-ve (curate all teas and stories), and User (assigned to one specific day)
  • โœ… Test-Driven Development: Vitest + React Testing Library

๐Ÿ—„๏ธ Database Schema

  • User: Authentication, profile, assigned day
  • Day: Tea information (name, infusion time, properties)
  • TeaIngredient: Ingredients associated with a Tea
  • StoryTea: Narrative content with progressive reveals
  • TeaGuess: User guesses with calculated points
  • StoryImage: Multiple images per tea day story
  • Badge (Future): Achievement definitions
  • UserBadge (Future): User-badge assignments

โ†•๏ธ Key Workflows

Daily Reveal Cycle (19:00 UTC)

  • Tea name, ingredients, and type are revealed
  • If a user only guesses the contributor, points remain hidden until final day
  • Daily ranking is updated
  • Contributor identity remains hidden until final day
  • Overall ranking is shown after final day

Tea Guessing Game

  1. What you can guess (any combination):

    • Tea name
    • Ingredients
    • Tea type
    • Contributor (who proposed this tea)
  2. Scoring:

    • Submit guesses anytime before reveal time
    • Points calculated immediately using string similarity algorithm
    • Only your last guess for each field counts

๐Ÿ› ๏ธ Tech Stack & Decisions

This project uses cutting-edge technologies to explore modern web development patterns and evaluate their production-readiness:

Next JS React TypeScript TailwindCSS daisyUI Prisma PostgreSQL BetterAuth Resend Cloudinary Vitest

Core Framework Choices

Next.js 16 (App Router)

  • Native server actions for type-safe mutations without API routes
  • Async dynamic params (await params) for cleaner route handling
  • Turbopack stability for faster dev/build cycles

Tailwind CSS v4 + daisyUI 5

  • New @import and @plugin syntax for simplified configuration
  • Inline theme definitions for better maintainability
  • Component-first approach with daisyUI reducing custom CSS by ~60%

BetterAuth over NextAuth

  • Type-safe auth with zero config boilerplate
  • Built-in Prisma adapter with proper TypeScript inference
  • Simpler session management for this use case (no OAuth complexity needed)

Vitest over Jest

  • Resolved Jest compatibility issues with Prisma in integration tests (ESM/CommonJS mismatch)
  • Native ESM support eliminates transform configuration overhead
  • Faster test execution in watch mode
  • Better TypeScript integration out-of-the-box

Trade-offs Accepted

  • Benefits: Modern DX, performance improvements, cleaner codebase
  • Risks: Limited community resources, potential breaking changes
  • Mitigation: Comprehensive test coverage (TDD), detailed documentation, MCP integration for AI-assisted documentation

Learning Outcomes

  • Mastered Next.js 16 async patterns and Server Component best practices
  • Evaluated Tailwind v4 migration path (worth it for new projects)
  • Proved BetterAuth viability for production auth flows
  • Developed workflows for managing bleeding-edge dependencies safely

๐Ÿ—๏ธ Architecture & Design Principles

The code adheres to high-quality software engineering standards to ensure maintainability, scalability, and code health:

  • SOLID Principles: Ensuring modular and testable component architecture.
  • KISS & DRY: Keeping logic simple and avoiding duplication, especially in server actions and services.
  • Clean Code: Meaningful naming conventions, small functions, and self-documenting code.
  • TDD (Test-Driven Development): Writing tests before implementation to guide design and ensure reliability.
  • Mobile-First: Designing UI/UX priorities for mobile devices using Tailwind's responsive utilities.

๐Ÿค– AI-Assisted Development

This project leverages modern AI tools to enhance productivity and code quality:

  • AI Agents: Specialized roles defined in AGENTS.md (e.g., UI Agent, Database Agent, Testing Agent) to handle specific domains.
  • MCP (Model Context Protocol): Integration with external tools (GitHub, Sentry, Documentation) to provide rich context to the AI assistant.
  • GitHub Copilot: Used for code generation, refactoring, and following the strict guidelines defined in .github/copilot-instructions.md.

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18.17 or later
  • pnpm (recommended) or npm/yarn/bun

Installation

  1. Clone the repository
git clone https://github.com/CarlosCanet/advientea.git
cd advientea
  1. Install dependencies
# Using pnpm (recommended)
pnpm install

# Or using npm
npm install
  1. Set up environment variables
cp .env.example .env

Edit .env and add your credentials.

  1. Set up the database
# Using pnpm
pnpm dlx prisma generate
pnpm dlx prisma migrate dev --name init

# Or using npx
npx prisma generate
npx prisma migrate dev --name init
  1. Run the development server
# Using pnpm
pnpm dev

# Or using npm
npm run dev

Open http://localhost:3000 with your browser to see the result.

Scripts

npm run dev       # Start development server with Turbopack
npm run build     # Build for production
npm run start     # Start production server
npm run lint      # Run ESLint
npm run test      # Run tests with Vitest
npx prisma studio # Open Prisma Studio (DB GUI)

๐Ÿ“ƒ Documentation

Technical Documentation

About

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages