https://github.com/electerm/electerm-sync-server-vercel
A simple electerm data sync server for Vercel, written with nodejs/ts, data stored in [cloud.mongodb.com](free tier is enough).
https://github.com/electerm/electerm-sync-server-vercel
Last synced: 7 months ago
JSON representation
A simple electerm data sync server for Vercel, written with nodejs/ts, data stored in [cloud.mongodb.com](free tier is enough).
- Host: GitHub
- URL: https://github.com/electerm/electerm-sync-server-vercel
- Owner: electerm
- Created: 2023-06-25T13:01:54.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T00:29:59.000Z (about 1 year ago)
- Last Synced: 2025-03-25T19:21:22.751Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 38.1 KB
- Stars: 1
- Watchers: 2
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vercel Electerm sync server
A simple electerm data sync server for Vercel, written with nodejs/ts, data stored in [[cloud.mongodb.com](https://cloud.mongodb.com/)](free tier is enough).
## Use
fork this project to your own account or org and deployed to [Vercel.com](https://Vercel.com), put proper env in project env setting:(get mongodb url from [[cloud.mongodb.com](https://cloud.mongodb.com/))

```env
JWT_SECRET=some_secret_very_complicated
JWT_USERS=username1,username2,xxxx,hhhh
DB_URL=mongodb+srv://yourusername:xxxxx@cluster0.yyyyy.mongodb.net/electerm_sync_custom_db_name?retryWrites=true&w=majority
```

- Set `https://your-vercel-domain.vercel.app/api/sync` as your sync server url in electerm sync form.
- Set `JWT_SECRET` as your sync JWT SECRET in electerm sync form.
- Set one of `JWT_USERS` as your sync User ID in electerm sync form.
## Dev
```bash
npm i
npm i vercel -g
cp sample.env .env
## local dev
vercel dev
## deploy
vercel deploy
```
## Sync server in other languages
[https://github.com/electerm/electerm/wiki/Custom-sync-server](https://github.com/electerm/electerm/wiki/Custom-sync-server)
## License
MIT