https://github.com/efefurkankarakaya/library-app
A book library app built on React Native and Realm
https://github.com/efefurkankarakaya/library-app
expo react-native realm typescript
Last synced: 4 months ago
JSON representation
A book library app built on React Native and Realm
- Host: GitHub
- URL: https://github.com/efefurkankarakaya/library-app
- Owner: efefurkankarakaya
- License: mit
- Created: 2023-06-04T21:45:03.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-15T23:42:44.000Z (almost 3 years ago)
- Last Synced: 2025-04-14T21:34:46.424Z (about 1 year ago)
- Topics: expo, react-native, realm, typescript
- Language: TypeScript
- Homepage:
- Size: 9.11 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Library App
A book library application built on React Native and Realm.

## Technologies
- React Native (v0.71.8)
- React (v18.2.0)
- Realm (v11.10.1)
- Typescript (v4.9.4)
- Expo CLI (v48.0.18)
- Redux Toolkit (v1.9.5)
- React Native Gesture Handler (v2.9.0)
- React Native Screens (v3.20.0)
- React Native SVG (v13.4.0)
- Moment Timezone (v0.5.43)
- Jest (v29.2.1)
## Dependencies
- Node.js 18.16.0 LTS
- Brew (to install pods and watchman)
- Ruby (optional, for pods)
- Android Studio (to install SDKs and emulator)
- Xcode (to build iOS)
- Java Development Kit (JDK) 11
## How To Run?
### On Emulator
- Run `$ npm install` to install dependencies.
- Then `$ npm run {ios | android}` to run application on specified platform.
### On Real Device
- Run `$ npm install` to install dependencies.
- Connect mobile device via `USB` and make sure `USB Debugging` is allowed on your phone.
- Then `$ npm run {ios | android} --localhost`
## Possible Problems and Solutions
### $ npm run android → android/gradlew exited with non-zero code: 1
Probably, you have a different version of JDK than expected. According to the documentation, the most compatible and suggested version is JDK11.
You can find the JDK11 installer by clicking here.
### $ npm run android → Build failed: SDK location not found.
- Create a file named `local.properties` under `android/` folder in project.
- Set inside `sdk.dir = {YOUR_SDK_PATH}`
- Then run `$ npm run android`
### $ npx expo start → Missing Realm constructor.
```
ERROR Error: Missing Realm constructor. Did you run "pod install"? Please see https://docs.mongodb.com/realm/sdk/react-native/install/ for troubleshooting, js engine: hermes
ERROR Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes
```
In a Realm project, you can't use `$ npx expo start`. Realm uses customized native codes and because of that it requires platform builds. This command does not create builds (also does not use existing ones) and that explains why it fails.
You need to run the project using by
`$ npx expo run:ios`
or
`$ npx expo run:android`
In `package.json` these scripts are already defined like below:
`$ npm run ios` → `$ npx expo run:ios`
`$ npm run android` → `$ npx expo run:android`
Feel free to use both ways, but don't forget to use the correct scripts which create and use the platform builds.
## Registration
### As a Privileged User (aka: SU, Super User)
All you need to do is using an e-mail address that ends with `@protonmail.com`
### As a Regular User
Just sign up with an e-mail address that does not end with `@protonmail.com`
## Use Cases
### Case 1: Librarian
Consider that you are a librarian, you need to create entries of books.
You should be able to:
- Access to full CRUD operations (create, read, update and delete) for books.
- Upload image.
- Take photograph.
- Change image of a book.
- Change any detail of book.
- Save changes.
Therefore, a basic case should be like:
- User signs up with an e-mail address that ends with `@protonmail.com` to be privileged user.
- User logs in.
- User swipes right to create a new book.
- User takes a photograph of a book.
- User enters details of the book.
- User saves the book.
- User sees the book in home, and keep goes create new books.
- User swipes right again.
- User picks an book image from gallery.
- User enters details of the book.
`...`
### Case 2: Regular Library User
Consider that you are a user of a library application and you want to borrow some books.
You should be able to:
- Access book data.
- Borrow or put back books.
Therefore, a basic case should be like:
- User signs up with their personal information.
- User logs in and sees the books.
- User taps on a book that interested in.
- User taps on `Borrow` button.
`... (after a while)`
- User wants to return the book, logs in the app.
- User goes to `My Books` screen.
- User taps on the book, that they want to return.
- User taps on `Put Back` button in detail screen.
## Screenshots
### Login

### Sign Up

### Sign Up (onChange)

### Sign Up (onSubmit)

### Home

### Details (w/ SU Privileges)

### My Books (Borrowed)

### Camera (Requires SU Privileges)

### Camera (onImagePick)