Skip to content

gdgoc-uic/valentine-wall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

562 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Œ Valentine Wall

A full-stack web application for sending anonymous Valentine's Day messages with virtual gifts, built with modern technologies and containerized for easy deployment.

Tech Stack Tech Stack Tech Stack Tech Stack


πŸ“– Table of Contents


✨ Features

  • βœ‰οΈ Anonymous Messaging - Send Valentine's messages to anyone in the system
  • 🎁 Virtual Gifts - Attach gifts to messages using virtual currency
  • πŸ’° Virtual Economy - Users start with 1000 coins, spend to send messages
  • πŸ† Ranking System - Track most popular recipients by coins received
  • πŸ“§ Email Notifications - Recipients get notified of new messages
  • πŸ–ΌοΈ Social Media Cards - Automatically generated shareable images for each message
  • πŸ” Secure Authentication - Email verification + optional Firebase OAuth (Google/Facebook)
  • πŸ“± Responsive Design - Works on desktop, tablet, and mobile
  • ⚑ Real-time Updates - WebSocket subscriptions for live data updates
  • πŸ—‚οΈ Message Archiving - Download all received messages as a ZIP file
  • 🚫 Profanity Filter - Multi-language content moderation
  • 🎨 Dark Mode Ready - DaisyUI theming support

πŸ› οΈ Tech Stack

Backend

  • Framework: PocketBase 0.11.3 (Go-based BaaS)
  • Language: Go 1.19+
  • Database: SQLite (embedded)
  • HTTP Router: Echo v5
  • Authentication: PocketBase Auth + Firebase Admin SDK
  • Image Rendering: Chrome DevTools Protocol (headless Chrome)
  • Email: SMTP via PocketBase

Frontend

  • Framework: Vue 3.2.45 (Composition API with <script setup>)
  • Language: TypeScript 4.9+
  • Build Tool: Vite 4.0.0
  • Routing: Vue Router 4.1.6
  • State Management: Vuex 4 + Custom Reactive Stores
  • Data Fetching: TanStack Query (Vue Query) 4.24.4
  • Backend SDK: PocketBase JS SDK 0.10.1
  • UI Framework: TailwindCSS 3.2.4 + DaisyUI 2.49.0
  • SSR: Yes (Node.js + Polka server)

Infrastructure

  • Containerization: Docker + Docker Compose
  • Reverse Proxy: Caddy 2 (auto-SSL for production)
  • Image Renderer: Browserless Chrome

πŸš€ Quick Start

Prerequisites

  • Docker Desktop (includes Docker Compose)
  • Git
  • Text editor (VS Code recommended)

1. Clone the Repository

git clone https://github.com/yourusername/valentine-wall.git
cd valentine-wall

2. Create Environment File

Create a .env file in the project root:

ENV=development
BASE_DOMAIN=localhost
BACKEND_URL=http://localhost:8090
FRONTEND_URL=http://localhost:3000
READ_ONLY=false
PROFANITY_JSON_FILE_NAME=profanities.json

# Optional: Firebase OAuth credentials
FIREBASE_API_KEY=
FIREBASE_AUTH_DOMAIN=
FIREBASE_PROJECT_ID=
FIREBASE_STORAGE_BUCKET=
FIREBASE_MESSAGING_SENDER_ID=
FIREBASE_APP_ID=
FIREBASE_MEASUREMENT_ID=

3. Prepare Data Directory

# Linux/Mac
cp -r backend/_data.please_copy backend/_data

# Windows PowerShell
Copy-Item -Recurse backend/_data.please_copy backend/_data

4. Start Development Environment

docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build

First startup takes 3-5 minutes to build images.

5. Access the Application

Create an admin account when first accessing the dashboard.


πŸ“š Documentation

We've created comprehensive documentation to help you get started and develop effectively:

Document Purpose When to Use
SETUP_CHECKLIST.md Step-by-step setup verification Setting up for the first time
DEVELOPMENT_GUIDE.md Complete development guide Learning the codebase, making changes
QUICK_REFERENCE.md Common tasks & commands Daily development, quick lookups

πŸ“– What Each Guide Contains

SETUP_CHECKLIST.md - Your First 30 Minutes

  • βœ… Prerequisites checklist
  • βœ… Step-by-step initial setup
  • βœ… Service verification
  • βœ… Sample data setup
  • βœ… Common issues & fixes

DEVELOPMENT_GUIDE.md - Your Complete Reference (40+ pages)

  • πŸ—οΈ Architecture & how components interact
  • πŸ”§ Making changes in backend (hooks, endpoints, models)
  • 🎨 Making changes in frontend (pages, components, API calls)
  • πŸ“ Common development tasks with examples
  • πŸš€ Production deployment guide
  • πŸ› Troubleshooting section
  • πŸŽ“ Learning path for future projects

QUICK_REFERENCE.md - Your Daily Companion

  • ⚑ Quick command reference
  • πŸ“ File locations cheat sheet
  • πŸ” Debugging tips
  • 🎨 Common TailwindCSS patterns
  • πŸ—„οΈ Database access patterns
  • πŸ’‘ Code snippets for common tasks

πŸ“ Project Structure

valentine-wall/
β”œβ”€β”€ backend/                   # Go + PocketBase backend
β”‚   β”œβ”€β”€ main.go               # Entry point
β”‚   β”œβ”€β”€ server.go             # Custom routes
β”‚   β”œβ”€β”€ *_hooks.go            # Business logic (messages, users, wallets)
β”‚   β”œβ”€β”€ models/               # Database models
β”‚   β”œβ”€β”€ migrations/           # Database migrations
β”‚   β”œβ”€β”€ templates/            # Email & HTML templates
β”‚   └── renderer_assets/      # Fonts, emojis, images
β”‚
β”œβ”€β”€ frontend/                  # Vue 3 + TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.ts           # Client entry
β”‚   β”‚   β”œβ”€β”€ App.vue           # Root component
β”‚   β”‚   β”œβ”€β”€ router.ts         # Routes
β”‚   β”‚   β”œβ”€β”€ client.ts         # PocketBase client
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   └── assets/           # Styles, images
β”‚   β”œβ”€β”€ vite.config.ts        # Vite configuration
β”‚   └── package.json          # Dependencies
β”‚
β”œβ”€β”€ docker-compose.yml         # Base Docker configuration
β”œβ”€β”€ docker-compose.dev.yml     # Development overrides
β”œβ”€β”€ docker-compose.prod.yml    # Production overrides
β”œβ”€β”€ deploy.sh                  # Production deployment script
β”œβ”€β”€ .env                       # Environment variables (you create this)
β”œβ”€β”€ profanities.json           # Profanity filter list
β”‚
β”œβ”€β”€ DEVELOPMENT_GUIDE.md       # πŸ“– Complete development guide
β”œβ”€β”€ SETUP_CHECKLIST.md         # βœ… Setup verification checklist
β”œβ”€β”€ QUICK_REFERENCE.md         # ⚑ Quick reference card
└── README.md                  # πŸ‘ˆ You are here

πŸ’» Development

Development Workflow

Option 1: Docker Compose (Recommended for beginners)

# Start all services
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up

# View logs
docker-compose logs -f backend
docker-compose logs -f frontend

# Restart a service
docker-compose restart backend

Option 2: Local Scripts (Faster hot reload)

# Install dotenv CLI
npm install -g dotenv-cli

# Terminal 1 - Backend
./start-backend.sh serve --http=0.0.0.0:8090 --dir=./pb_data

# Terminal 2 - Frontend
./start-frontend.sh

Making Changes

Backend (Go):

  • Custom routes β†’ backend/server.go
  • Business logic β†’ backend/*_hooks.go
  • Email templates β†’ backend/templates/mail/*.txt.tpl

Frontend (Vue 3):

  • New page β†’ frontend/src/pages/YourPage.vue + add to router.ts
  • Component β†’ frontend/src/components/YourComponent.vue
  • API calls β†’ Use PocketBase SDK via client.ts

See DEVELOPMENT_GUIDE.md for detailed examples.

Admin Dashboard

Access PocketBase admin at http://localhost:8090/_/

  • View/edit all collections
  • Manage users
  • Test API endpoints
  • Configure collection rules
  • View logs

πŸš€ Production Deployment

Prerequisites

# Create external Caddy network (one-time)
docker network create caddy

# Update .env for production
ENV=production
BASE_DOMAIN=yourdomain.com
BACKEND_URL=https://yourdomain.com/pb
FRONTEND_URL=https://yourdomain.com

Deploy

# Deploy all services
./deploy.sh

# Deploy specific services
./deploy.sh backend frontend

Production Architecture

Internet β†’ Caddy (port 80/443, auto-SSL)
            β”œβ”€β†’ Frontend (/)
            └─→ Backend (/pb/*)
                  └─→ Headless Chrome (internal)

See DEVELOPMENT_GUIDE.md for full deployment guide.


πŸ§ͺ Testing

Manual Testing

# Test API endpoint
curl http://localhost:8090/api/collections/messages/records

# Test with authentication
curl -H "Authorization: Bearer YOUR_TOKEN" \
  http://localhost:8090/api/collections/messages/records

Frontend Type Checking

cd frontend
npm run type-check

Build Testing

# Frontend production build
cd frontend && npm run build

# Backend build
cd backend && go build

πŸ› Troubleshooting

Services won't start:

# Check Docker is running
docker ps

# View logs
docker-compose logs

# Clean restart
docker-compose down
docker-compose up --build

Port already in use:

# Windows
netstat -ano | findstr :8090
taskkill /PID <PID> /F

# Linux/Mac
lsof -i :8090
kill -9 <PID>

More troubleshooting: See DEVELOPMENT_GUIDE.md


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Commit: git commit -m 'Add amazing feature'
  5. Push: git push origin feature/amazing-feature
  6. Open a Pull Request

Please read DEVELOPMENT_GUIDE.md to understand the codebase structure.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • PocketBase - Amazing Go backend framework
  • Vue.js - Progressive JavaScript framework
  • Vite - Next generation frontend tooling
  • TailwindCSS - Utility-first CSS framework
  • DaisyUI - Tailwind component library

πŸ“ž Support


Made with ❀️ for Valentine's Day

⭐ Star this repo if you find it helpful!

Report Bug Β· Request Feature

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors