|
||
---|---|---|
patches | ||
pocketbase/pb_migrations | ||
public | ||
scripts | ||
src | ||
.env.example | ||
.eslintrc.json | ||
.gitignore | ||
.prettierrc.json | ||
LICENSE | ||
README.md | ||
TODO.md | ||
flake.lock | ||
flake.nix | ||
package.json | ||
pnpm-lock.yaml | ||
postcss.config.js | ||
tailwind.config.js | ||
tsconfig.json | ||
vite.config.ts |
README.md
IsGoingGreat
Obviously, credit where credit is due; this project wouldn't exist if it wasn't for the wonderful work of Molly White (and contributors!) on Web3 is Going Just Great.
IsGoingGreat is built on solid-start
and PocketBase.
Setup
Icons
Just like Molly's timeline generator, we're using FontAwesome. FontAwesome does not publish SVGs of their icons to npm, so we must do it manually. There is a script to automate this:
# Use chmod if needed
chmod +x ./scripts/fontawesome.sh
./scripts/fontawesome.sh
We're using the Solid subset of the free icons. You can look through them here: https://fontawesome.com/search?o=r&m=free&s=solid
Developing
Once you've created a project and installed dependencies with npm i
(or pnpm i
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Notes
Look out for comments that start with TODO:
or IMPROVEMENT:
. TODO
s are for tasks that should really get done and IMPROVEMENT
s are potential ideas.
declassify
Various pocketbase
functions return an instance of the Record
class. On static SSR pages, this is not important. However, if you require the data to be accessible on the frontend for interactive purposes, you have to call the declassify
function (a purpose-built function for dealing with Record
s) on the class in order to convert it (and any nested expand
s) from a class to an object:
const eventData = await pb.collection('events').getFirstListItem();
// This does not work
// return eventData;
// This works
return declassify(eventData);
I am not entirely sure why, but I'm assuming that classes cannot be serialized, wheras objects can.
Building
Solid apps are built with adapters, which optimise your project for deployment to different environments.
By default, npm run build
will generate a Node app that you can run with npm start
. To use a different adapter, add it to the devDependencies
in package.json
and specify in your vite.config.js
.