Application to demonstrate how to use Realm Sync with a Web App to do basic operations (CRUD)
This is the live example of the Web application running
This application will list a table of contacts added to Mongo Realm and will synchronize the data with Realm Sync.
Operation allowed:
- Log in with Email/Password or Google
- Show list of contacts
- Create a new contact
- Update contact
- Delete contact
This application is self-contained in a Docker container. You need to set several things in order to build and run this application.
- You need to add your Realm Id to
api.files/routes/app.js
file in order to be able to open a Realm with your Realm Cloud. For this, this project uses the librarydotenv
to be able to load secrets to your application. This library is listed in thepackage.json
. - To be able to use this project, you will need to create a
.env
file. You could use the.env.template
as a template. You will need: - Change
.env
variables to match your working directory.CLIENT_PATH:
Is the directory where you've clone this project plus the folder/api.files
.BACKEND_PATH:
Is the directory where you've clone this project.NGINX_APIX_LOGS:
Is the directory where you want to store the client logs fileAPP_ID
From your Realm Cloud App.CLIENT_ID
From your Google Credentials Project.
Example of a .env
file:
# Application's path (absolute or relative)
CLIENT_PATH={{current-directory}}/api.files/
BACKEND_PATH={{current-directory}}
# Logs path
NGINX_APIX_LOGS={{current-directory}}/logs/nginx/
# Secrets
CLIENT_ID=
APP_ID=
This project is based on NodeJS and Bootstrap. These are the libraries used in this project:
- npm
- express
- nodemon
- realm
- socket
- cors
- bson
All these libraries are in the package.json
.
When executing a docker-compose up --build -d
all the packages are automatically installed.
Follow the link to the Wiki page for a step by step instruccionts on how to run this application.