Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/radu-matei/spin-upstash-todo
https://github.com/radu-matei/spin-upstash-todo
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/radu-matei/spin-upstash-todo
- Owner: radu-matei
- License: mit
- Created: 2022-12-23T12:22:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-23T12:23:06.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T02:24:05.050Z (3 months ago)
- Language: JavaScript
- Size: 128 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TODO application with Upstash and Fermyon Cloud
This is a demonstration of building a full-stack JavaScript application that
runs on Fermyon Cloud and connects to a serverless database hosted by [Upstash](https://upstash.com).The demo is based on the [Upstash blog post showcasing how to build a
minimalist Next.js TODO application with their Redis database](https://upstash.com/blog/nextjs-todo),
and adapts it to use two Spin components:- a Spin component to serve a statically built Next.js UI
- a Spin component written in TypeScript that connects to a Redis database
hosted by Upstash, using the Upstash REST API.## Local development
- [Spin](https://developer.fermyon.com/spin)
- [the Spin JavaScript toolchain](https://developer.fermyon.com/spin/javascript-components)
- [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- a free [Upstash](https://upstash.com) account
- a free [Fermyon Cloud](https://cloud.fermyon.com) accountCreate an `auth.json` file using the credentials for the Upstash Redis database
(using the REST API credentials) based on the template in `auth-template.json`.Finally, install the dependencies for both the front-end and back-end,
then run `spin build` and `spin up`:```bash
$ npm install && cd api && npm install
$ spin build && spin up --follow-allSuccessfully ran the build command for the Spin components
Serving http://127.0.0.1:300
Available Routes
ui: http://127.0.0.1:3000 (wildcard)
api: http://127.0.0.1:3000/api (wildcard)
```At this point, the application should be available at .
## Deploying to Fermyon Cloud
Now that the application is built, we can deploy it to Fermyon Cloud:
```
$ spin deploy
Uploading todo-next-redis-upstash version 1.0.0+r7deafdcc...
Deploying...
Waiting for application to become ready........ ready
Available Routes:
ui: https://todo-next-redis-upstash-gwvinwz6.fermyon.app (wildcard)
api: https://todo-next-redis-upstash-gwvinwz6.fermyon.app/api (wildcard)
```You can check an already deployed instance of this application at
.## Credits
This application is based on [the demo created by Upstash](https://upstash.com/blog/nextjs-todo)
and is adapted to run on Spin and Fermyon Cloud.