This is the public showcase repository for card.tccards.tn. It serves the static HTML, CSS, and JavaScript that renders the beautiful, SEO-optimized digital business cards for users.
- Dynamic URL Routing: Supports both
https://card.tccards.tn/@usernameandhttps://card.tccards.tn/id_<uuid>formats. - SEO & Social Media Previews: A Cloudflare Worker intercepts bot requests (WhatsApp, Twitter, Facebook, LinkedIn) and dynamically serves the correct Open Graph metadata for the user.
- Dark Glassmorphism Card: Ensures maximum text readability and a premium aesthetic, even against bright or complex user-uploaded background images.
- Dynamic Gradients: Supports named presets like
ocean,sunset,midnight,neon, andpurplefetched from the database. - Random Profile Discovery: Visiting
https://card.tccards.tn/@Random-profileorhttps://card.tccards.tn/@randomautomatically loads a random user profile from a curated list. - Contact & vCard Support: Allows visitors to view contact details, download vCards, and copy contact information instantly.
- Frontend: HTML5, Tailwind CSS, Pure Vanilla JavaScript
- Backend Data: Google Apps Script (
profile.gs) and Google Sheets - Routing & SEO: Cloudflare Worker
- Hosting: GitHub Pages (via GitHub Actions workflow)
tc-card/Basic/
├── .github/
│ └── workflows/
│ └── static.yml # GitHub Actions workflow for deployment
├── profile/ # Main public profile card
│ ├── index.html
│ ├── main.js
│ └── style.css
├── profile.gs # Google Apps Script backend (Data lookup & cache)
├── worker.js # Cloudflare Worker (Routing & Bot handling)
├── .redirects # Redirects file (Netlify/Pages)
├── 404.html # Custom 404 error page
├── 504.html # Custom 504 error page
├── index.html # Root landing (likely handles redirects)
└── README.md # This file
- Create a Google Sheet and a sheet named
Form. - Add the exact headers:
Timestamp,Name,Email,Link,Tagline,Phone,Address,Social Links,Style,Profile Picture,Form Email,ID,Status. - Deploy
profile.gsas a Web App (Execute as: Me, Access: Anyone). - Copy the deployment URL and update the
idvalue insideconst CONFIG = {inprofile/main.js.
- Create a new Worker in Cloudflare.
- Copy
worker.jsinto your worker. - Create a Route for
card.tccards.tn/*(Proxied). - Ensure assets (CSS/JS) pass through to the correct
profile/directory on GitHub Pages.
- Push all files to this repository.
- The
.github/workflows/static.ymlwill automatically deploy the site. - Ensure
card.tccards.tnpoints to your GitHub Pages URL (via a CNAME record).
The .redirects file handles root URL redirects. For example, /profile/@username should route to the static profile/index.html if needed. Ensure your workflow or hosting provider respects these rules.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Company: TC Cards
- Website: tccards.tn
- Live Demo: card.tccards.tn