-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update readme, add package.json dev script for raspberry pi
- Loading branch information
1 parent
7d3a123
commit b619cec
Showing
4 changed files
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
# create-svelte | ||
## Browser App | ||
|
||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
The browser app uses a pub/sub model to listen for messages from the Raspberry Pi. | ||
|
||
## Creating a project | ||
### Prerequisites | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
- Copy `.env.example` to `.env` and fill in the values. | ||
- Run `npm install` | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
### Dev | ||
|
||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
|
||
## Developing | ||
- Run `npm run dev` | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
### Production | ||
|
||
```bash | ||
npm run dev | ||
- Run `npm run build` | ||
- Serve preview via `npm run preview` | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
## Raspberry Pi | ||
|
||
## Building | ||
- cd `raspberrypi/` | ||
- Run `npm install` | ||
|
||
To create a production version of your app: | ||
Add this to your raspotify config file: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
OPTIONS="--onevent 'node ~/path/to/gatefold/raspberrypi/main.js'" | ||
``` | ||
|
||
### Dev | ||
|
||
- Run `npm run dev` to publish a test message | ||
|
||
You can preview the production build with `npm run preview`. | ||
## Useful links | ||
|
||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | ||
- https://github.com/dtcooper/raspotify/issues/171#issuecomment-507423901 | ||
- https://github.com/librespot-org/librespot/blob/aa880f8888226a8e5fc6e1e54dfb7cf58176ac95/src/player_event_handler.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters