This is an Expo project created with create-expo-app.
-
Install dependencies
npm install
-
Start the app
npx expo start
In the output, you'll find options to open the app in a
- development build
- Android emulator
- iOS simulator
- Expo Go, a limited sandbox for trying out app development with Expo
You can start developing by editing the files inside the app directory. This project uses file-based routing.
When you're ready, run:
npm run reset-projectThis command will move the starter code to the app-example directory and create a blank app directory where you can start developing.
To learn more about developing your project with Expo, look at the following resources:
- Expo documentation: Learn fundamentals, or go into advanced topics with our guides.
- Learn Expo tutorial: Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
Join our community of developers creating universal apps.
- Expo on GitHub: View our open source platform and contribute.
- Discord community: Chat with Expo users and ask questions.
Create a collection (table) named saved_movies in your Appwrite database with the following attributes and indexes so it works with the save/list/delete helpers:
Attributes (columns)
- movie_id: integer (required)
- TMDB numeric movie id used for de-duplication and lookups.
- title: string (required)
- Movie title stored for quick display.
- poster_url: string (required)
- Pre-built TMDB poster URL. Can be an empty string when no poster is available.
- createdAt: integer (required)
- Unix epoch milliseconds (number). Used for sorting newest first.
- device_id: string (required)
- A per-device identifier used to scope saved movies when the app has no auth.
Recommended indexes
- by_movie_device (key index) on [movie_id, device_id]
- Speeds up queries like: Query.equal("movie_id", ), Query.equal("device_id", ), Query.limit(1).
- by_device_createdAt (key index) on [device_id, createdAt]
- Speeds up listSavedMovies: Query.equal("device_id", ), Query.orderDesc("createdAt").
- Optional: Make by_movie_device a unique index to enforce one saved record per movie per device.
Permissions
- If you rely on device_id scoping (no user auth), you can set collection-level permissions to allow reads and writes for anyone, or use an API key. In production, prefer authenticated users and store user_id instead of device_id.
Environment variables needed
- EXPO_PUBLIC_APPWRITE_SAVED_TABLE_ID: The collection ID for saved_movies.
- EXPO_PUBLIC_APPWRITE_DATABASE_ID: Your Appwrite database ID.
Types in code
- The SavedMovieDoc interface in interfaces/interfaces.d.ts mirrors these attributes and is used by the client helpers.