Hackathon Diaries: Lessons from CodeFest

Hackathon Experience

Participating in the Code for Change hackathon was one of the most exhilarating experiences of my life. From brainstorming ideas to coding for hours with my team, the event was a perfect blend of challenge and creativity.

The Preparation Phase

Our journey began three days before the actual event. My team and I spent hours researching potential project ideas, brushing up on our technical skills, and preparing for the intense coding sessions ahead. We knew we wanted to build something that could make a real impact.

Team Collaboration

The 24-Hour Marathon

Day 1: Ideation,Planning and Development Sprint

The hackathon kicked off with an opening ceremony where we received the problem statements. Our team decided to work on developing an platform for reusing the used books. The first 5 hours were dedicated to planning, wireframing, and dividing tasks among team members.

. We worked through the night, fueled by coffee and determination. I was responsible for the frontend development while my teammates handled the backend and AI integration.

// Sample of our  component structure
async function getCoordinates(city) {
    try {
        // Fallback coordinates for major cities
        const fallbackCoords = {
            'new york': { lat: 40.7128, lng: -74.0060 },
            'los angeles': { lat: 34.0522, lng: -118.2437 },
            'chicago': { lat: 41.8781, lng: -87.6298 },
            'london': { lat: 51.5074, lng: -0.1278 },
            'toronto': { lat: 43.6532, lng: -79.3832 }
            // Add more cities as needed
        };

        const normalizedCity = city.toLowerCase().trim();
        if (fallbackCoords[normalizedCity]) {
            return fallbackCoords[normalizedCity];
        }

        // If you have OpenCage API key, use this:
        if (OPENCAGE_API_KEY && OPENCAGE_API_KEY !== 'your-opencage-api-key') {
            const response = await fetch(
                `https://api.opencagedata.com/geocode/v1/json?q=${encodeURIComponent(city)}&key=${OPENCAGE_API_KEY}`
            );
            const data = await response.json();
            
            if (data.results && data.results.length > 0) {
                const { lat, lng } = data.results[0].geometry;
                return { lat, lng };
            }
        }

        // Fallback: return coordinates for a central location
        return { lat: 40.7128, lng: -74.0060 }; // New York
    } catch (error) {
        console.error('Geocoding error:', error);
        return { lat: 40.7128, lng: -74.0060 }; // Fallback to New York
    }
}

function calculateDistance(lat1, lon1, lat2, lon2) {
    const R = 6371; // Earth's radius in km
    const dLat = (lat2 - lat1) * Math.PI / 180;
    const dLon = (lon2 - lon1) * Math.PI / 180;
    const a = 
        Math.sin(dLat/2) * Math.sin(dLat/2) +
        Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * 
        Math.sin(dLon/2) * Math.sin(dLon/2);
    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    return R * c;
}

// Get user's current location (optional)
function getUserLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(
            (position) => {
                userLocation = {
                    lat: position.coords.latitude,
                    lng: position.coords.longitude
                };
            },
            (error) => {
                console.log('Location access denied or unavailable');
            }
        );
    }
}

The Final Push

The last 6 hours were the most intense. We were debugging, testing, and polishing our presentation. Despite the sleep deprivation, the energy in the room was incredible as all teams raced against the clock.

"Hackathons aren't just about writing code; they're about solving problems under pressure and learning to work as a cohesive unit."

Key Lessons Learned

This experience taught me invaluable lessons that go beyond technical skills:

1. Teamwork is Everything

Clear communication and trust among team members were crucial. We learned to leverage each other's strengths and support each other's weaknesses.

2. Time Management

Breaking down the project into manageable chunks and setting realistic milestones kept us on track throughout the event.

3. Embracing Imperfection

We learned that in hackathons, done is better than perfect. Having a working prototype with core functionality is more valuable than a perfect but incomplete project.

The Result and Recognition

Our BookThrift platform impressed the judges with its innovative approach and clean implementation. While we didn't win the top prize, we received special recognition for our user-centric design and received valuable feedback from industry experts.

The most rewarding part was seeing our idea come to life and knowing it could potentially help people struggling with mental health issues.

Hackathon Programming Teamwork Web Development
Sittal Basyal

Sittal Basyal

Data Science Enthusiast & Web Developer passionate about creating intelligent solutions and sharing knowledge through writing.