TravelChain
Overview
A decentralized application that allows users to store and visualize their travel memories using blockchain technology. Originally developed during a 48-hour ASU Blockchain Hackathon, TravelChain provides a secure and decentralized solution for travel enthusiasts to store and visualize their travel memories.
Key Features
- GPS metadata extraction from photos
- Interactive map interface powered by Mapbox API
- Blockchain-based storage on Polygon network
- Secure data management using smart contracts
- Travel memory visualization with interactive mapping
- Firebase integration for temporary image storage
Technical Implementation
Smart Contract Architecture
soliditycontract ImageUpload {
struct Image {
string filename;
int32 longitude; // Using fixed-point arithmetic for 5 decimal places
int32 latitude; // Using fixed-point arithmetic for 5 decimal places
}
Image[] public images;
// Function to upload an image
function uploadImage(string memory _filename, int32 _longitude, int32 _latitude) public {
images.push(Image(_filename, _longitude, _latitude));
}
// Function to get the count of uploaded images
function getImageCount() public view returns (uint) {
return images.length;
}
// Function to get image details by index
function getImage(uint _index) public view returns (string memory, int32, int32) {
require(_index < images.length, "Image does not exist");
Image memory image = images[_index];
return (image.filename, image.longitude, image.latitude);
}
}
Frontend Integration
javascript// Example of metadata extraction and blockchain interaction const uploadMemory = async (photo, location) => { // Extract GPS metadata from photo const metadata = await extractGPSMetadata(photo); // Upload photo to Firebase (temporary storage) const photoHash = await uploadToFirebase(photo); // Store metadata on blockchain const transaction = await travelChainContract.addMemory( photoHash, location, JSON.stringify(metadata) ); await transaction.wait(); };
Current Development State
- Smart contracts deployed on Polygon testnet
- Frontend interface with Mapbox integration complete
- Photo metadata successfully stored on blockchain
- Images temporarily stored in Firebase
Project Screenshots
Memory Upload
The upload interface where users can add new travel memories. This screen handles photo uploads, automatically extracts GPS metadata, and interfaces with both Firebase (for storage) and the blockchain (for metadata).
Memory Gallery
A gallery view of stored travel memories, showing the locations and associated metadata stored on the blockchain. Users can browse their travel history and view details of each memory.
Future Enhancements
- Migration from Firebase to IPFS for decentralized photo storage
- Social features for sharing travel memories
- Advanced filtering and search capabilities
- Mobile app development
- Integration with popular travel platforms
- Enhanced metadata extraction for better location accuracy
- Community features for travel recommendations