Skip to content
Rana0CodesPublic

About

Developer portfolio and content management features powered by Firebase, with an authenticated admin workflow and contact integration.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Portfolio Website with Firebase Backend

A modern, responsive portfolio website with a dynamic work section powered by Firebase Firestore and Authentication.

🌟 Features

  • Responsive Design: Fully responsive on all devices (mobile, tablet, desktop)
  • Modern UI: Glassmorphism effects, smooth animations, and micro-interactions
  • Firebase Integration: Real-time project data from Firestore
  • Admin Panel: Secure dashboard for managing projects
  • Search & Filter: Dynamic project filtering and search functionality
  • Contact Form: Web3Forms integration with comprehensive validation and spam protection
  • Image Hosting: Flexible image hosting using any free service (ImgBB, Imgur, etc.)
  • Hardened Security: Production-ready Firestore rules with field-level validation
  • No Cost: Completely free to run (Firebase free tier + free image hosting + Web3Forms free tier)

πŸ“‹ Prerequisites

  • A Google account (for Firebase)
  • Basic knowledge of HTML/CSS/JavaScript
  • A code editor (VS Code, Sublime Text, etc.)
  • A web browser

πŸš€ Quick Start

1. Firebase Setup

Follow the detailed Firebase Setup Guide to:

  • Create a Firebase project
  • Set up Firestore database
  • Enable Authentication
  • Get your Firebase configuration

2. Configure Firebase

Your Firebase configuration is already set up in js/firebase-config.js. This file is gitignored for security.

Important: Never commit js/firebase-config.js to GitHub!

3. Configure Web3Forms (Contact Form)

  1. Go to Web3Forms
  2. Sign up for a free account
  3. Create a new form and get your access key
  4. Update the access key in contact.html (line 142):
    <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY_HERE">

4. Deploy Security Rules

Copy the rules from firestore.rules and paste them in your Firebase Console:

  1. Go to Firebase Console β†’ Firestore Database β†’ Rules
  2. Paste the rules from firestore.rules
  3. Click "Publish"

Security Features & Scope:

  • Field-level schema validation for all project data (isValidProjectData(), isValidTitle())
  • Category whitelist enforcement and URL structure checks
  • Authentication check: write and delete operations restricted to request.auth != null
  • Note on Security Scope: These rules establish standard production schema boundaries against unauthorized web writes; code-level review does not constitute an enterprise-certified penetration test.
  • Quota Considerations: Built on Firebase Spark (free tier); adheres to Google's 50,000 reads/day quota ceiling.

5. Create Admin User

  1. Go to Firebase Console β†’ Authentication
  2. Click "Add user"
  3. Enter your email and password
  4. This will be your admin login

6. Test Locally

  1. Open work.html in your browser
  2. You should see the work section (empty initially)
  3. Open admin.html to access the admin panel
  4. Log in with your Firebase credentials
  5. Add your first project!
  6. Test the contact form at contact.html

πŸ“ Project Structure

Portfolio/
β”œβ”€β”€ index.html              # Homepage
β”œβ”€β”€ work.html               # Work section (redesigned with Firebase)
β”œβ”€β”€ admin.html              # Admin panel
β”œβ”€β”€ contact.html            # Contact page
β”œβ”€β”€ services.html           # Services page
β”œβ”€β”€ resume.html             # Resume page
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ style.css           # Global styles
β”‚   β”œβ”€β”€ header.css          # Header styles
β”‚   β”œβ”€β”€ work.css            # Work section styles (redesigned)
β”‚   β”œβ”€β”€ contact.css         # Contact page styles
β”‚   └── admin.css           # Admin panel styles
β”œβ”€β”€ js/
β”‚   β”œβ”€β”€ firebase-config.js  # Firebase configuration (gitignored)
β”‚   β”œβ”€β”€ firebase-config.example.js  # Template
β”‚   β”œβ”€β”€ work.js             # Work section logic (redesigned)
β”‚   β”œβ”€β”€ admin.js            # Admin panel logic
β”‚   β”œβ”€β”€ contact.js          # Contact form logic with Web3Forms
β”‚   └── header.js           # Header navigation
β”œβ”€β”€ firestore.rules         # Firestore security rules
β”œβ”€β”€ .gitignore              # Git ignore file
└── README.md               # This file

🎨 Work Section Features

For Visitors

  • Search: Search projects by title, description, or technology
  • Filter: Filter by category (Web Apps, AI/ML, Analytics, Collaboration)
  • Responsive Grid: Beautiful card layout that adapts to all screen sizes
  • Smooth Animations: GSAP-powered scroll animations
  • Loading States: Skeleton loaders while data loads
  • Error Handling: Graceful error messages if something goes wrong

For Admins

  • Secure Login: Firebase Authentication
  • Add Projects: Create new projects with all details
  • Edit Projects: Update existing projects
  • Delete Projects: Remove projects
  • Image URLs: Paste any public image link (no upload needed!)
  • Real-time Updates: Changes appear instantly on the work page

οΏ½ Contact Form Features

Web3Forms Integration

  • No Backend Required: Form submissions handled by Web3Forms API
  • Email Notifications: Receive submissions directly to your email
  • Spam Protection: Honeypot field and built-in rate limiting
  • Comprehensive Validation:
    • Name validation (minimum 2 characters)
    • Email format validation
    • Message length validation (minimum 10 characters)
    • Service selection required
  • User Feedback: Success/error notifications with visual feedback
  • Loading States: Animated spinner during submission
  • Form Reset: Automatic form clearing after successful submission

Setup Your Contact Form

  1. Get Web3Forms Access Key:

    • Visit web3forms.com
    • Sign up for free (no credit card required)
    • Create a new form
    • Copy your access key
  2. Update contact.html:

    • Open contact.html
    • Find line 142: <input type="hidden" name="access_key" value="...">
    • Replace with your access key
  3. Configure Email Settings (Optional):

    • Log in to Web3Forms dashboard
    • Set custom subject lines
    • Add CC/BCC recipients
    • Enable/disable notifications
  4. Test the Form:

    • Open contact.html in browser
    • Fill out all fields
    • Submit and check your email

οΏ½πŸ–ΌοΈ Image Hosting

You can use any free image hosting service:

Recommended Services

  1. ImgBB (Easiest)

  2. Imgur

  3. Cloudinary (Professional)

  4. GitHub (For developers)

    • Add images to /images/projects/
    • Use GitHub Pages URL

πŸ”’ Security

Firebase Security

  • Hardened Firestore Rules: Production-ready security with comprehensive validation
    • Public read access for portfolio display
    • Authenticated write access only (prevents unauthorized modifications)
    • Field-level validation (type checking, length limits, format validation)
    • Category whitelist enforcement (web, ai, analytics, collaboration)
    • URL format validation for all image and project links
    • Array size limits to prevent DoS attacks
    • Explicit denial of extra fields and unauthorized collections
  • Authentication: Firebase Authentication for admin panel access
  • Protected Configuration: Firebase config is gitignored and never committed

Contact Form Security

  • Web3Forms Integration: Secure form submission without backend code
  • Spam Protection: Honeypot field for bot detection
  • Client-side Validation:
    • Name: minimum 2 characters
    • Email: proper format validation
    • Message: minimum 10 characters
    • Service selection required
  • Rate Limiting: Built-in Web3Forms protection
  • No Database Exposure: Form submissions go directly to email

Protection Against Code Copying

Even if someone copies your entire GitHub repository, they cannot:

  • Modify your Firestore database (authentication required)
  • Add fake projects (strict validation rules)
  • Delete or corrupt data (admin authentication required)
  • Access your Firebase project (config is gitignored)
  • Spam your contact form (honeypot + validation)

🌐 Deployment

GitHub Pages

  1. Push your code to GitHub (firebase-config.js is gitignored)
  2. Go to repository Settings β†’ Pages
  3. Select branch and folder
  4. Your site will be live at https://yourusername.github.io/portfolio

Important: You'll need to manually upload firebase-config.js to your hosting or use environment variables.

Alternative Hosting

  • Netlify: Drag and drop your folder
  • Vercel: Connect your GitHub repo
  • Firebase Hosting: firebase deploy

πŸ“ Adding Your First Project

  1. Open admin.html in your browser
  2. Log in with your Firebase credentials
  3. Click "Add New Project"
  4. Fill in the form:
    • Title: Project name
    • Category: Select category
    • Description: Brief description
    • Image URL: Paste public image link
    • Technologies: Comma-separated (e.g., "React, Node.js, MongoDB")
    • GitHub URL: Link to repo (optional)
    • Live URL: Link to demo (optional)
    • Order: Display order (1, 2, 3...)
    • Featured: Check if featured project
  5. Click "Save Project"
  6. View it on work.html!

πŸ› Troubleshooting

Projects not loading?

  • Check browser console for errors
  • Verify Firebase config is correct
  • Ensure Firestore rules are deployed

Can't log in to admin?

  • Verify user exists in Firebase Console β†’ Authentication
  • Check email/password are correct
  • Clear browser cache

Images not displaying?

  • Verify image URL is publicly accessible
  • Test URL in new browser tab
  • Use direct image links (not webpage links)

Contact form not working?

  • Verify Web3Forms access key is correct
  • Check browser console for errors
  • Ensure all required fields are filled
  • Test with a different email address
  • Check spam folder for confirmation emails

πŸ“š Documentation

🎯 Features Roadmap

  • Web3Forms contact form integration
  • Hardened Firebase security rules
  • Comprehensive form validation
  • Project categories management
  • Bulk import/export
  • Image optimization
  • Analytics dashboard
  • Multi-language support
  • Dark/light theme toggle

🀝 Contributing

This is a personal portfolio project, but feel free to fork and customize for your own use!

πŸ“„ License

MIT License - feel free to use this for your own portfolio!

πŸ’‘ Tips

  1. Optimize Images: Use TinyPNG.com to compress images before uploading
  2. Backup Data: Regularly export your Firestore data
  3. Monitor Usage: Check Firebase Console for usage stats
  4. Test Responsively: Always test on mobile, tablet, and desktop
  5. Contact Form Testing: Test with different email providers to ensure delivery
  6. Security: Never commit firebase-config.js to version control
  7. Performance: Use browser DevTools to monitor load times
  8. SEO: Update meta tags and descriptions for better search visibility

πŸ†˜ Need Help?

  1. Check the Firebase Setup Guide
  2. Review browser console for errors
  3. Verify Firebase Console settings
  4. Check Firestore rules are deployed

Built with ❀️ using Firebase, Web3Forms, HTML, CSS, and JavaScript

About

Developer portfolio and content management features powered by Firebase, with an authenticated admin workflow and contact integration.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages