webservices-app/README.md

73 lines
2 KiB
Markdown
Raw Normal View History

# Webservices App
This is an app I'm creating to visualise data I've created (in JSON form) describing my self-hosted (professional, volunteer, & personal) webservices.
## Credits
Developed by Dave Lane, [Open Source Technologist](https://oerfoundation.org/about/staff/#Dave_Lane) at the [OER Foundation](https://oerfoundation.org). Many thanks to support from the Foundation for this exploratory work!
## Installing the Webservices App
2024-08-09 16:21:51 +12:00
You can clone this repository from my [Forgejo instance](https://forge.magnificent.nz) using this command (replacing the latter webservices-app with your preferred directory name!):
2024-08-09 16:21:51 +12:00
git clone https://forge.magnificent.nz/lightweight/webservices-app.git webservices-app
2024-08-09 16:21:51 +12:00
then
2024-08-09 16:21:51 +12:00
cd webservices-app
npm install
or, if you're using pnpm, use `pnpminstall` or for yarn, `yarn`. That will install the svelte and other javascript dependencies.
2024-08-09 16:21:51 +12:00
## Developing
Once you've created a project and installed dependencies, start a development server:
2024-08-09 16:21:51 +12:00
npm run dev
2024-08-09 16:21:51 +12:00
# or start the server and open the app in a new browser tab
npm run dev -- --open
2024-08-09 16:21:51 +12:00
## Building
To create a production version of your app:
npm run build
2024-08-09 16:21:51 +12:00
You can preview the production build with `npm run preview`.
## Deployment
### To set up your SvelteKit project, ensure that your svelte.config.js file has this line:
// import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-node';
and then run
npm install
(which runs these)
npm i -D @sveltejs/adapter-node
npm i dotenv
npm i --save-dev @sveltejs/enhanced-img
### To build a new image
docker-compose build
### You can push your new container to a docker container repository (I use my Forgejo instance!)
docker push forge.magnificent.nz/lightweight/webservices-app:latest
### To start it up (and tail the logs - CTRL-C to quit out of the logs without affecting running container)
docker-compose up -d && docker-compose logs -f
### To clear out an old image (if it's running)
docker-compose down --remove-orphans --rmi 'all'