A modern, responsive website built with React, TypeScript, and Express.js, designed for deployment on Vercel.
Cool Shot Systems is a full-stack web application featuring:
- Frontend: React 18 with TypeScript, Tailwind CSS, and Vite
- Backend: Express.js API with serverless functions
- Database: Neon PostgreSQL (configurable)
- Styling: Tailwind CSS with custom design tokens
- Icons: Lucide React
- Forms: React Hook Form with Zod validation
- 🎯 Modern, responsive design
- 📱 Mobile-first approach
- ⚡ Fast loading with Vite
- 🔒 Type-safe with TypeScript
- 📧 Contact form with Telegram notifications
- 🤖 AI-powered chat using Google Gemini 2.0 Flash
- 🎨 AI image generation with Google Gemini Imagen 4.0 (Gifted API fallback)
- 🎨 Beautiful UI with Radix components
- 🌙 Theme support
- 📊 Analytics integration ready
-
Install Vercel CLI
npm i -g vercel
-
Clone and Install
git clone https://github.com/RayBen445/Cool-shot-site.git cd Cool-shot-site npm install -
Deploy to Vercel
vercel
Follow the prompts:
- Set up and deploy?
Y - Which scope? (select your account)
- Link to existing project?
N - What's your project's name? (accept default or customize)
- In which directory is your code located?
./
- Set up and deploy?
Set these environment variables in your Vercel dashboard:
# AI Chat & Image Generation (recommended for full AI features)
GEMINI_API_KEY=your_google_gemini_api_key
# Telegram Bot Notifications (optional)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
# Database (optional - uses in-memory storage by default)
DATABASE_URL=your_neon_database_urlGetting Your Gemini API Key:
- Visit Google AI Studio
- Sign in with your Google account
- Click "Get API Key" in the left sidebar
- Create a new API key or use an existing one
- Copy the API key and add it to your Vercel environment variables
Note on AI Services:
- Chat functionality: Uses Google Gemini 2.0 Flash model for intelligent conversations
- Image generation: Prioritizes Google Gemini's Imagen 4.0 with Gifted API as fallback for reliability
- If
GEMINI_API_KEYis not set, chat will not work and image generation will use Gifted API only
-
Install Dependencies
npm install
-
Start Development Server
npm run dev
This starts both the frontend and backend in development mode with hot reloading.
-
Open Browser
http://localhost:5000
npm run dev- Start development servernpm run build- Build both frontend and backendnpm run build:client- Build only frontend (used by Vercel)npm run start- Start production server locallynpm run check- TypeScript type checking
Cool-shot-site/
├── api/ # Vercel serverless functions
│ ├── contact.ts # Contact form API endpoint
│ ├── gemini-chat.ts # AI chat using Google Gemini
│ └── generate-image.ts # AI image generation (Gemini + Gifted fallback)
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Application pages/routes
│ │ ├── hooks/ # Custom React hooks
│ │ └── lib/ # Utility functions
│ └── index.html # HTML template
├── server/ # Express backend (for local dev)
│ ├── index.ts # Server entry point
│ ├── routes.ts # API route definitions
│ ├── storage.ts # Data storage layer
│ └── email.ts # Notification service
├── shared/ # Shared types and schemas
│ └── schema.ts # Zod schemas and types
├── vercel.json # Vercel deployment configuration
└── vite.config.ts # Vite build configuration
Submit a contact form inquiry.
Request Body:
{
"firstName": "string",
"lastName": "string",
"email": "string",
"company": "string (optional)",
"service": "string (optional)",
"message": "string"
}Response:
{
"success": true,
"inquiry": {
"id": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"company": "string",
"service": "string",
"message": "string",
"createdAt": "date"
}
}Retrieve all contact inquiries (admin endpoint).
Send a message to the AI chat assistant powered by Google Gemini.
Request Body:
{
"message": "string"
}Response:
{
"success": true,
"result": "string (AI response)",
"response": "string (AI response)",
"message": "string (AI response)"
}Generate AI images using Google Gemini with Gifted API as fallback.
Request Body:
{
"prompt": "string (image description)"
}Response:
{
"success": true,
"result": "string (image URL or data URL)",
"imageUrl": "string (image URL or data URL)",
"provider": "gemini | gifted",
"message": "string (success message)"
}Environment Variables:
GEMINI_API_KEY- Your Google Gemini API key (recommended for both chat and image generation)- Image generation will fallback to Gifted API if Gemini is unavailable
- React 18 - Modern React with hooks
- TypeScript - Type safety and better DX
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible UI primitives
- React Hook Form - Performant forms with validation
- Zod - Runtime type validation
- Lucide React - Beautiful icons
- Wouter - Minimalist routing
- Node.js - JavaScript runtime
- Express.js - Web framework
- TypeScript - Type safety across the stack
- Vercel Functions - Serverless API endpoints
- Zod - Request validation
- Neon PostgreSQL - Serverless PostgreSQL
- Drizzle ORM - Type-safe database operations
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details.
For technical support or questions, please contact:
- Email: heritage@coolshotsystems.com
- GitHub: @RayBen445
CSSLab uses Supabase as its primary database.
Before deploying or running locally with the database, apply the schema located in db/schema.sql to your Supabase project using the Supabase Dashboard's SQL Editor. This will create the required projects, templates, and template_requests tables with Row Level Security (RLS) policies configured for secure client-side access.
Add the following environment variables to your local .env file and your Vercel deployment settings:
# Supabase Configuration
# For Next.js projects, use NEXT_PUBLIC_...
NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# For Vite projects, use VITE_...
VITE_SUPABASE_URL=your-supabase-project-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-keySecurity Note: Only expose the public anon key to the client. Never expose the Supabase Service Role Key. Client-side database actions are securely restricted using Row Level Security (RLS).
The repository includes a vercel.json file properly configured with:
- Dynamic SPA rewrites handling client-side routing like
/p/[id]. - Vercel Edge Runtime for any defined API functions (
api/**/*.ts). - Standard web security headers (
X-Frame-Options,X-Content-Type-Options,Referrer-Policy).
To deploy:
- Connect your GitHub repository to Vercel.
- In the Vercel project settings, add the required Environment Variables.
- Deploy! Vercel will automatically use the
vercel.jsonconfiguration to build the client and set up serverless routes.