Inspiration

TerraRium was born from our desire to make staying fit fun and adventurous. In a world where most of us spend too much time sitting, we wanted to create something that would inspire people to get up and move by turning exercise into an exciting game.

What it does

TerraRium is an app that transforms your daily activities into an exciting virtual adventure. It's like having a personal fitness game. As you move and stay active, your in-game character reflects your real-life health and energy levels.

How we built it

To create TerraRium, we used the power of modern technology. We built it with tools like Next.js and Node.js, and we used Firebase for handling user data and authentication. We also connected to the Terra API to gather health, sleep, and activity data and a little bit of Math Magic in our algorithm for calculations.

Challenges we ran into

We faced some challenges along the way. One of them was dealing with limitations in accessing character data. We also had to figure out the best way to calculate points and levels based on your health data. We worked hard to find the right balance, so the game isn't too easy or too tough. For instance this code block:

const updateStats = async (data, uid) => {
        const docRef = doc(db, "pets", uid)
        const docSnap = await getDoc(docRef);

        const currentStats = docSnap.data()

        const calories = Math.trunc(Number(data.calories_data.net_activity_calories))
        currentStats['energy'] = Math.min(Math.round(currentStats['energy'] + (calories * 0.1)), 100)

        if ((currentStats['xp'] + calories) >= Math.round(Math.pow(currentStats['level'], 3) * 20)) {
            currentStats['strength'] = Math.round(currentStats['strength'] * 1.0080) + 3
            currentStats['endurance'] = Math.round(currentStats['endurance'] * 1.025)
            currentStats['stamina'] = Math.round(Math.log(Math.pow(currentStats['level'], 5)) * 3) + 1
            currentStats['level'] += 1
        }

        currentStats['xp'] += calories

        updateDoc(docRef, currentStats);
    }

Accomplishments that we're proud of

One of our proudest achievements is bringing TerraRium to life. We've created an app that makes fitness more enjoyable and engaging. We successfully integrated various technologies and received positive feedback from users who feel fitter and happier.

What we learned

Through this journey, we've learned that making fitness fun is key to motivating people to stay active. We've also gained valuable insights into using health data to create an exciting game.

What's next for TerraRium

The journey continues! In the future, we plan to refine TerraRium based on user feedback. We're also exploring opportunities to expand to other platforms. We plan to refine TerraRium based on user insights and expand its reach to iOS and beyond. Our goal is to keep inspiring people to lead healthier lives while having a great time.

Built With

Share this project:

Updates