DEV Community

Causal Zap
Causal Zap

Posted on

Cozy Games - Casual Online Gaming Platform

This is the official project for the Cozy Games casual online gaming platform, built with Next.js. The website is dedicated to providing multiple free, no-download, low-stress browser games and is deeply optimized for search engines (SEO) and AI crawlers.

Project Overview
The Cozy Games platform curates healing simulation, time-management, and idle games that run directly in the browser, offering users an instant relaxation experience. This project serves as the official website, providing an extensible framework capable of supporting various types of casual browser games.

Supported Cozy Game List (Example Content)
My Perfect Hotel - Homepage Feature, hotel management and time-management simulator.
Idle Lumber Inc. - Idle tycoon game, focusing on resource management and automation.
Duck Duck Clicker - Simple clicker and incremental game.
Travelers Rest - Farm and inn simulation (High search potential).
Slime Rancher 2 - Exploration and collection cozy game (High search potential).
Planet Clicker - Idle placement and planet upgrade game.
Casual Puzzle Game (Placeholder) - Satisfies platform breadth requirement.
Core Features (Refocused on Cozy Games Value)
Multi-Game Embedding & Display - Supports embedding and showcasing various HTML5 casual games.
Unified Game Page Templates - Every game features a complete cozy-themed introduction, low-pressure gameplay guide, and in-depth FAQ strategy.
Deep SEO Guide Support - Dedicated, in-depth guide pages for core games like My Perfect Hotel to capture high-value long-tail traffic.
Search Engine Optimization (SEO) - Complete meta tags and structured data, emphasizing "Cozy Games" and "Free Online" keywords.
AI Crawler Specific Optimization - Dedicated llms.txt file providing structured information about our casual games.
Responsive Design - Full support for various devices and screen sizes, ensuring users can relax and play on mobile and tablet.
Game Recommendation System - Recommends similar low-stress simulation games on every game page.
Technical Stack
Framework: Next.js 13.5.1 (App Router)
Language: TypeScript 5.2.2
Styling: Tailwind CSS 3.3.3
UI Components: Radix UI (Full accessibility component library)
Deployment: Vercel
SEO: next-sitemap 4.2.3
Forms: React Hook Form + Zod
Icons: Lucide React
Project Structure
/
├── app/ # Next.js Application Directory (App Router)
│ ├── my-perfect-hotel/ # My Perfect Hotel Game Page
│ ├── idle-lumber-inc/ # Idle Lumber Inc. Game Page
│ ├── games/ # Game List and Data Configuration
│ ├── about/ # About Page
│ ├── contact/ # Contact Page
│ ├── privacy-policy/ # Privacy Policy Page
│ ├── terms-of-service/ # Terms of Service Page
│ ├── layout.tsx # Global Layout
│ ├── page.tsx # Homepage (Featuring My Perfect Hotel)
│ ├── schema.ts # Structured Data Configuration
│ └── globals.css # Global Styles
├── components/ # React Component Library
│ ├── game-section/ # Game Display Components
│ ├── layout/ # Layout Components (Header, Footer)
│ ├── templates/ # Page Templates (GamePageTemplate)
│ ├── home/ # Homepage Components
│ ├── features/ # Game Features Components
│ ├── what-is/ # Game Introduction Components
│ ├── how-to-play/ # Gameplay Instructions Components
│ ├── faq/ # FAQ Component
│ ├── other-games/ # Other Game Recommendation Components
│ ├── rating/ # Rating Component
│ └── ui/ # Base UI Components (Radix UI-based)
├── config/ # Configuration Files
│ ├── site.ts/js # Site Base Configuration
│ ├── content.ts # Game Content Configuration
│ ├── layout.ts # Layout Configuration
│ └── theme.ts # Theme Configuration
├── hooks/ # Custom React Hooks
├── lib/ # Utility Functions Library
├── public/ # Static Assets
│ ├── assets/ # Images and Other Resources
│ │ ├── my-perfect-hotel/ # My Perfect Hotel Assets
│ │ ├── idle-lumber-inc/ # Idle Lumber Inc. Assets
│ │ └── img/ # Site General Images
│ ├── game/ # Game Files Directory
│ │ ├── my-perfect-hotel/ # My Perfect Hotel Game Files
│ │ ├── idle-lumber-inc/ # Idle Lumber Inc. Game Files
│ │ └── ... # Other Game Files
│ ├── llms.txt # AI Crawler Content Summary
│ ├── llms-full.txt # AI Crawler Full Content
│ ├── robots.txt # Search Engine Crawler Rules
│ └── sitemap.xml # Site Map
├── next.config.js # Next.js Configuration (Including Game Route Rewrites)
├── next-sitemap.config.js # Sitemap and robots.txt Configuration
├── tailwind.config.ts # Tailwind CSS Configuration
├── tsconfig.json # TypeScript Configuration
└── components.json # shadcn/ui Component Configuration
Development Guide
Environment Requirements
Node.js 16.x or higher
npm or yarn
Environment Variable Configuration
Create a .env.local file in the project root:

Google Analytics Configuration

Please replace with your own Google Analytics ID

NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX

Other optional configurations

NEXT_PUBLIC_SITE_URL=https://your-domain.com

Installation
npm install

or

yarn install
Local Development
npm run dev

or

yarn dev
Visit http://localhost:3000 to view the website.

Build Project
npm run build

or

yarn build
Generate Sitemap
npm run sitemap

or

yarn sitemap
Game Embedding Guide
The site embeds games via iframe, with a corresponding embed route for each game:

/my-perfect-hotel.embed → /game/my-perfect-hotel/index.html
/idle-lumber-inc.embed → /game/idle-lumber-inc/index.html
/duck-duck-clicker.embed → /game/duck-duck-clicker/index.html
... (Embed routes for other games)
Adding a New Game Guide
To add a new game, follow these steps:

Add Game Files: Place game files into the public/game/[game-name]/ directory.
Create Game Page: Create the page directory and files in app/[game-name]/.
Configure Game Data: Add game information to app/games/game-data.ts.
Add Game Content: Create the game's content.ts configuration file (for guides, features, etc.).
Configure Route Rewrites: Add the embed route to next.config.js.
Add Game Assets: Place relevant images in public/assets/[game-name]/.
Related Links and Resources
Official Pages
🏠 Homepage: Cozy Games Official Website
📞 Contact Us: Contact Us
ℹ️ About Us: About Us
🔒 Privacy Policy: Privacy Policy
📋 Terms of Service: Terms of Service
External Links (Footer Quick Links)
(Note: These should be replaced with relevant Cozy Game-focused external links)

Cozy Game Substack: Cozy Game Blog
Patreon Support: Patreon Support Page
AI Crawler Optimization
This project features special optimization for AI crawlers, aimed at promoting low-stress, casual game content:

Dedicated Content Files: Provides llms.txt and llms-full.txt files containing structured casual game information.
robots.txt Configuration: Directs AI crawlers to the dedicated files, limiting access to other parts of the site.
License
© 2025 Cozy Games. All rights reserved. All games on the platform are free to play and require no download.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.