From Digital Ghost Towns to Memory Palaces: My Second Attempt at AR Memory Magic
Honestly, when I first built spatial-memory, I thought I was creating the next big thing in augmented reality. I mean, pinning multimedia memories to real-world GPS locations? It sounds like something out of Black Mirror, right? People would walk through their neighborhoods and see little video memories floating in the air like digital ghosts.
Well, let me tell you something - reality has a way of knocking down even the most ambitious dreams. After my first Dev.to article about the "cruel realities" of this AR memory app, I spent another 3 weeks diving deeper into the rabbit hole. And guess what? I found both more gold and more dirt in this digital minefield.
The Spark: Why Even Bother With AR Memories?
You know that feeling when you're walking down a familiar street and suddenly remember a perfect moment from years past? Maybe it's that coffee shop where you had your first date, or that park bench where you cried after a breakup, or that street corner where you saw the most amazing sunset. Those moments stick with us, but they fade.
I wanted to create something that could preserve those moments and bring them back to life when you revisit the same location. The idea was simple:
- You record a video or audio memory at a specific GPS location
- The memory gets stored with precise location data and metadata
- When you come back to that location, the memory "pops up" in AR, letting you relive that moment
It's like a digital time machine, but instead of traveling through time, you travel through space. I was building this Spring Boot backend that would handle memory storage, geolocation, and WebXR integration for the AR experience.
The Backend Architecture: Spring Boot to the Rescue
@RestController
@RequestMapping("/api/memories")
public class MemoryController {
@Autowired
private MemoryRepository memoryRepository;
@Autowired
private FileStorageService fileStorageService;
@PostMapping
public ResponseEntity<Memory> createMemory(@RequestParam("file") MultipartFile file,
@RequestParam("title") String title,
@RequestParam("description") String description,
@RequestParam("latitude") double latitude,
@RequestParam("longitude") double longitude) {
try {
// Save the multimedia file to S3
String fileUrl = fileStorageService.storeFile(file);
// Create the memory entity
Memory memory = new Memory();
memory.setTitle(title);
memory.setDescription(description);
memory.setFileUrl(fileUrl);
memory.setLatitude(latitude);
memory.setLongitude(longitude);
memory.setCreatedAt(LocalDateTime.now());
// Save to database
Memory savedMemory = memoryRepository.save(memory);
return new ResponseEntity<>(savedMemory, HttpStatus.CREATED);
} catch (Exception e) {
return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@GetMapping("/nearby")
public ResponseEntity<List<Memory>> getMemoriesNearby(@RequestParam("latitude") double latitude,
@RequestParam("longitude") double longitude,
@RequestParam("radius") double radius) {
List<Memory> memories = memoryRepository.findMemoriesWithinDistance(latitude, longitude, radius);
return new ResponseEntity<>(memories, HttpStatus.OK);
}
}
This is the core controller that handles memory creation and retrieval. The Memory entity would contain all the metadata - title, description, location coordinates, file URL, and timestamps.
@Entity
public class Memory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private String description;
private String fileUrl;
@Column(precision = 10, scale = 8)
private double latitude;
@Column(precision = 10, scale = 8)
private double longitude;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
// Getters and setters
}
The backend uses Spring Data JPA for database operations, and it's designed to be RESTful. The findMemoriesWithinDistance method uses spatial queries to find memories within a certain radius of the current location.
The AR Frontend: WebXR and the Reality Check
Here's where things got interesting. For the AR experience, I was using WebXR, which is the web standard for AR and VR experiences.
class ARMemoryViewer {
constructor() {
this.session = null;
this.renderer = null;
this.memories = [];
}
async init() {
try {
// Request AR session
this.session = await navigator.xr.requestSession('immersive-ar', {
requiredFeatures: ['local', 'anchors'],
optionalFeatures: ['plane-detection', 'hit-test']
});
// Create WebGL renderer
this.renderer = new THREE.WebGLRenderer({ antialias: true });
this.renderer.setSize(window.innerWidth, window.innerHeight);
// Add to DOM
document.body.appendChild(this.renderer.domElement);
// Set up session
await this.renderer.xr.setSession(this.session);
// Load memories from backend
await this.loadMemories();
// Start rendering
this.animate();
} catch (error) {
console.error('Failed to initialize AR:', error);
alert('AR not supported on this device');
}
}
async loadMemories() {
try {
const response = await fetch(`/api/memories/nearby?latitude=${this.currentLat}&longitude=${this.currentLng}&radius=100`);
this.memories = await response.json();
// Create AR anchors for each memory
this.memories.forEach(memory => {
this.createMemoryAnchor(memory);
});
} catch (error) {
console.error('Failed to load memories:', error);
}
}
createMemoryAnchor(memory) {
// Create 3D text or image placeholder
const geometry = new THREE.PlaneGeometry(1, 1);
const material = new THREE.MeshBasicMaterial({
color: 0xffffff,
map: new THREE.TextureLoader().load(memory.fileUrl)
});
const mesh = new THREE.Mesh(geometry, material);
// Position based on GPS coordinates
const position = this.gpsToThreePosition(memory.latitude, memory.longitude);
mesh.position.copy(position);
this.renderer.scene.add(mesh);
}
animate() {
this.renderer.setAnimationLoop(() => {
this.renderer.render(this.renderer.scene, this.renderer.camera);
});
}
}
This is the basic structure for the AR viewer. It handles initializing the WebXR session, loading memories from the backend, and positioning them in AR space.
The Brutal Truth: What Actually Happened
So, I built this beautiful system. It had Spring Boot backend, WebXR frontend, S3 file storage, spatial database queries... everything you'd expect from a modern AR app. Then I tried to actually use it.
GPS Precision: The First Nail in the Coffin
Here's what nobody tells you about GPS: it's not as precise as you think. In ideal conditions, you might get 3-5 meters of accuracy. But in cities? Try 20-30 meters. That's the distance between two houses on the same block.
What does this mean for memory anchoring? It means when you're standing exactly where you recorded that coffee shop memory, the AR system might show memories from three blocks away instead. Or worse - it might not show any memories at all because the GPS drifts in and out of the search radius.
AR Device Compatibility: The Nightmare
I tested this on multiple devices:
- iPhone 12 Pro: Works decently, but drains battery like crazy
- Samsung Galaxy S21: Works, but AR positioning is off
- Mid-range Android phone: Doesn't support WebXR at all
- Desktop browser: No AR support whatsoever
The user experience was inconsistent at best. One device would show memories perfectly, another would show them in the wrong places, and some devices couldn't run it at all.
Battery Life: The Silent Killer
Here's a fun statistic: running AR applications can drain your phone battery by 30-50% per hour. Try explaining to users that they need to carry a power bank just to relive their memories.
I calculated that if someone used this app for an hour a day, they'd need to charge their phone twice as often. That's not exactly user-friendly.
What Actually Worked: The Lessons
After building and testing this AR memory app, I learned some valuable lessons that completely changed my approach.
1. GPS + Bluetooth Beaats = Better Precision
Instead of relying solely on GPS, I started experimenting with Bluetooth beacons. By placing small beacons in meaningful locations (coffee shops, parks, etc.), I could achieve much more accurate positioning - within 1-2 meters instead of 20-30 meters.
The updated system uses a hybrid approach:
- GPS for general location
- Bluetooth beacons for precise anchoring
- WiFi triangulation as a backup
2. Progressive Enhancement: Build for the Web First
Instead of jumping straight to AR, I built a web-based memory viewer first. Users could see their memories on a map, click on them to view the content, and only if they had AR-capable devices could they experience the full AR version.
This approach made the app accessible to everyone, not just people with expensive smartphones.
3. User Testing: The Reality Check
I learned this the hard way: never build something you think users will want. Actually talk to them. I interviewed 50 potential users and discovered something interesting:
- 80% loved the idea of preserving memories
- But only 20% were willing to go through the trouble of recording them
- Most people wanted a simpler way to tag and organize existing photos
So I pivoted. Instead of focusing on recording new memories, I built a system that could automatically detect location metadata from existing photos and suggest memories based on that.
The Honest Pros and Cons
Pros:
- Innovation: It's genuinely cool when it works
- Technology Stack: You learn cutting-edge tech (WebXR, spatial databases, AR)
- Emotional Impact: When it works right, it's magical
- User Demand: People love the concept of preserving memories
Cons:
- Technical Complexity: Building and maintaining AR systems is hard
- Device Fragmentation: Not all devices support AR
- Battery Issues: AR drains batteries like crazy
- GPS Inaccuracy: Location-based services are less precise than you'd think
- User Friction: People need to actively record memories, which is work
The Brutal Truth
Honestly, this project taught me that cool technology doesn't equal a viable product. I built something technologically impressive that nobody actually wanted to use regularly.
What I'd Do Differently
If I were to build this again (and I might, because the concept still fascinates me), I'd approach it differently:
- Start Simple: Begin with a web-based memory viewer, then add AR as an enhancement
- Focus on Existing Content: Use existing photos with location metadata instead of requiring new recordings
- Battery Optimization: Implement aggressive battery saving features
- Offline Support: Cache memories locally to reduce battery usage
- Community Features: Let users share memories and build collective memory maps
The Unexpected Benefits
Despite all the challenges, building spatial-memory taught me some valuable skills:
- Advanced Spatial Database Design: I became proficient in PostgreSQL with PostGIS
- WebXR Development: One of the few people who actually knows how to build AR web apps
- Mobile Performance Optimization: Learned how to optimize for battery life
- User Testing Methodology: Discovered the importance of talking to actual users
Plus, I had some genuinely magical moments. There was this one time when I was testing the app and it showed me a video of my daughter's first steps at exactly the spot where they happened. Seeing that memory pop up in AR, in the exact location where it happened... it was genuinely emotional.
The Current State
Right now, spatial-memory is a working proof-of-concept. It's not a polished product, but it demonstrates that the concept is feasible. I've learned so much from this project that I could probably build a version 2.0 that's actually usable.
But here's the thing: would anyone actually use it? That's the question I still don't have the answer to.
So, What Do You Think?
I've shared my journey with this AR memory app - the highs, the lows, the technical challenges, and the emotional moments. But I'm curious about your thoughts:
Would you actually use an app like this? Or is it just a cool idea that sounds better in theory than in practice?
What features would make you actually want to record and use memories? I found people were reluctant to do the work of recording memories, but they loved browsing existing ones.
What technical challenges would you worry about? Battery life? Device compatibility? GPS accuracy?
Have you ever tried any AR apps that actually worked well? I'd love to hear about positive experiences, because most of mine have been... educational.
Honestly, I've spent hundreds of hours on this project, and I'm still not sure if it's worth pursuing. But the concept still fascinates me, and I keep thinking about how to make it actually useful for real people.
What do you think? Am I onto something, or should I just let this digital ghost town fade away?
Top comments (0)