2024-08-12 15:15:31 +12:00
# 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.
2024-08-29 12:59:09 +12:00
## 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!
2024-08-12 15:15:31 +12:00
2024-08-29 12:04:45 +12:00
## Installing the Webservices App
2024-08-09 16:21:51 +12:00
2024-08-29 12:04:45 +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
2024-08-29 12:04:45 +12:00
git clone https://forge.magnificent.nz/lightweight/webservices-app.git webservices-app
2024-08-09 16:21:51 +12:00
2024-08-29 12:04:45 +12:00
then
2024-08-09 16:21:51 +12:00
2024-08-29 12:04:45 +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
2024-08-29 12:04:45 +12:00
Once you've created a project and installed dependencies, start a development server:
2024-08-09 16:21:51 +12:00
2024-08-29 12:04:45 +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
2024-08-29 12:04:45 +12:00
npm run dev -- --open
2024-08-09 16:21:51 +12:00
## Building
To create a production version of your app:
2024-08-29 12:04:45 +12:00
npm run build
2024-08-09 16:21:51 +12:00
You can preview the production build with `npm run preview` .
2024-08-29 11:40:28 +12:00
## 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
2024-09-05 12:21:32 +12:00
npm install
2024-10-04 16:59:49 +13:00
2024-08-29 11:40:28 +12:00
### To build a new image
docker-compose build
2024-09-19 16:23:30 +12:00
You can push your new container to a docker container repository (I use my Forgejo instance!)
2024-08-29 12:04:45 +12:00
docker push forge.magnificent.nz/lightweight/webservices-app:latest
2024-09-19 16:23:30 +12:00
### To deploy the new container
At the location you're running production, pull the updated container
docker-compose pull
To start it up (and tail the logs - CTRL-C to quit out of the logs without affecting running container)
2024-08-29 11:40:28 +12:00
2024-12-02 15:05:24 +13:00
docker-compose rm -sf & & docker-compose up -d & & docker-compose logs -f
2024-08-29 11:40:28 +12:00
### To clear out an old image (if it's running)
docker-compose down --remove-orphans --rmi 'all'