From e5ab862fe81dbe646142763d4ef8bf8fe982ed0b Mon Sep 17 00:00:00 2001 From: Martin Sosic Date: Wed, 21 Jun 2023 17:26:42 +0200 Subject: [PATCH] Updated Waspleau to work in development with Wasp 0.11 --- examples/waspleau/README.md | 27 ++++++++++++--------------- examples/waspleau/main.wasp | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/examples/waspleau/README.md b/examples/waspleau/README.md index b94207d31..d7b88331e 100644 --- a/examples/waspleau/README.md +++ b/examples/waspleau/README.md @@ -1,27 +1,24 @@ # Waspleau -Welcome to the Waspleau example! This is a small Wasp project that will allow you to setup an easy Dashboard that pulls in data via [Jobs](https://wasp-lang.dev/docs/language/features#jobs) and stores them in the database. +Welcome to the Waspleau example! This is a small Wasp project that tracks status of wasp-lang/wasp repo via a nice looking dashboard. +It pulls in data via [Jobs](https://wasp-lang.dev/docs/language/features#jobs) and stores them in the database. -The deployed version of this example can be found at https://waspleau.netlify.app/ +This example project can serve as a good starting point for building your own dashboard with Wasp, that regularly pulls in external data by using Jobs Wasp feature. -## Step 1 +The deployed version of this example can be found at https://waspleau.netlify.app/ . -Clone this repo +## Running in development -## Step 2 - -Update ext/workers with whatever you want to track, add them to main.wasp as a `job`, and optionally import and use them in `serverSetup.js` (or other server-side code). - -## Step 3 (with PostgreSQL running) - -`NODE_ENV=development DATABASE_URL="postgresql://postgres@localhost/waspleau-dev" wasp db migrate-dev` - -## Step 4 - -`NODE_ENV=development DATABASE_URL="postgresql://postgres@localhost/waspleau-dev" wasp start` +1. `wasp start db` to run the development database. +2. `wasp start` to run the app. +3. You might need to do `wasp db migrate-dev` if running the app for the first time or after db changes -> keep an eye out for warning from Wasp. This will start your background workers as Wasp Jobs and present a dashboard UI that will auto-refresh every minute. +## Modifying the example to track the data of your choice + +Update ext/workers with whatever you want to track, add them to main.wasp as a `job`, and optionally import and use them in `serverSetup.js` (or other server-side code). + Note: As you develop your own workers, keep in mind each time you save a file in the project it will automatically reload everything, including restarting your server, which may re-submit or terminate running `job`s. ## Heroku Deployment Note diff --git a/examples/waspleau/main.wasp b/examples/waspleau/main.wasp index 81e4b1822..43c7cf4ef 100644 --- a/examples/waspleau/main.wasp +++ b/examples/waspleau/main.wasp @@ -12,7 +12,7 @@ app waspleau { db: { system: PostgreSQL }, dependencies: [ - ("axios", "^0.27.2") + ("axios", "^1.4.0") ] }