Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohit-s96/redis-search-service
search and comment service for my blog
https://github.com/mohit-s96/redis-search-service
Last synced: 19 days ago
JSON representation
search and comment service for my blog
- Host: GitHub
- URL: https://github.com/mohit-s96/redis-search-service
- Owner: mohit-s96
- Created: 2022-01-20T20:34:35.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-17T17:42:23.000Z (7 months ago)
- Last Synced: 2024-06-17T20:13:26.271Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 186 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## search, comment and auth service
While building an autocomplete search for my [blog](https://mohits.dev), I ran into a bottleneck with vercel serveless functions. I couldn't get the search query time as low as I wanted because upstash redis didn't have a cloud instance anywhere near me.
So I made this nodejs server, hosted it on a ec2 instance and the queries went sub 100ms. Initially it was just for search but later I added the comment service and the github authentication service to this as well because redis is very fast and I like the freedom you get with having your own VPS.
### setup
- The ec2 instance is configured with nginx as the reverse-proxy and a node process managed with pm2. It runs a redis service locally.
- For nodejs I use express.
- It uses route based folder structure with a custom replacement for the require directory package to load all the routers and initializers at application start.
- Uses zod for runtime schema validation.### run
> requires a redis instance running on your machine the connection url, password in the env file
install dependencies
```bash
yarn
```run local server (uses the [tsc-watch](https://www.npmjs.com/package/tsc-watch) package)
```bash
yarn dev
```build
```bash
yarn build
```