freeCodeCamp / freeCodeCamp/mobile

Replace `sqflite` with file-based JSON storage

Open
#1,657 2 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
Dominant language
Dart
Stars
581
Forks
197
Avg merge
9d 11h
Merged PRs (30d)
1

Description

We currently use the `sqflite` package to persist article data in the app. This is more complex than our needs require. The goal is to replace `sqflite` with a simpler file-based JSON storage system.

## Requirements
- Store all articles as a list in a single `articles.json` file inside the app’s documents directory.
- Ensure the storage layer gracefully handles the case where `articles.json` does not yet exist.
- Provide helper functions to:
- Load all articles from the JSON file at app startup.
- Save the current in-memory list of articles back to the JSON file.
- Add, update, and delete articles in memory, then persist changes to disk.

## Acceptance criteria
- App can be installed fresh and run without `sqflite`.
- A clean install correctly creates `articles.json` when the first article is saved.
- After migration, existing user data is preserved and stored in the new JSON file format.
- All bookmark tests pass with the new JSON storage implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.