- Svelte 50.5%
- TypeScript 37.5%
- CSS 11.4%
- JavaScript 0.4%
- HTML 0.2%
nontrinsic
Deploy Status Last Commit Uptime Translation status
This is the full-stack web app for the Nontrinsic platform made with SvelteKit and uses Supabase for the database, authentication, and media storage—just for nonsense!
Check it out: https://nontrinsic.linerly.xyz
Read more about the backstory in the About page.
Development
If you want to work on the Nontrinsic web app, these are the things that you need to do.
Nontrinsic uses Supabase; you must set up Supabase first. You can use the managed version of Supabase, or the self-hosted version. Once you've set up a project in Supabase, you can download the nonsense database from https://nontrinsic.linerly.xyz/api/v1/nonsense as a CSV file and import it into the nonsense_list table, in the public schema, in the PostgreSQL database on Supabase.
To use the Nontrinsic web app locally, first clone the repository, go into the repository directory, then install the dependencies:
git clone https://codeberg.org/nontrinsic/web.git &&
cd web &&
npm install
Make sure to prefill these environment variables in .env.local (make a new file with that name) in the root directory:
PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
PUBLIC_SUPABASE_ANON_KEY=sb_publishable_YOUR_ANON_KEY
PUBLIC_SUPABASE_STORAGE_BUCKET=nonsense
SUPABASE_SERVICE_ROLE_KEY=sb_secret_YOUR_SERVICE_ROLE_KEY
NEWS_RSS=https://your-news-source/rss
IMAGE_ENDPOINT=https://localhost:3000/render
IMAGE_TOKEN=yourimagetoken
PUBLIC_BASE_URL=http://localhost:5173
METABASE_SECRET_KEY=metabasesecretkey
PUBLIC_METABASE_URL=https://your-metabase-instance
WORD_OF_THE_DAY_API=https://wordoftheday.freeapi.me
REPORT_WEBHOOK_URL=https://discord.com/api/webhooks/yourid/yourtoken
Note
You must fill
PUBLIC_SUPABASE_URLandPUBLIC_SUPABASE_ANON_KEYto use the web app locally with minimum functionality. In the Supabase dashboard, go to your project, click on "Connect" at the top, then go to the "API Keys" tab to get the URL and the publishable (anon) key. It is recommended to use a publishable key rather than a legacy anon key by going to API settings in the dialog.Use the storage bucket name that you're using in Supabase Storage to store media in
PUBLIC_SUPABASE_STORAGE_BUCKET. If you haven't made one yet, in the Supabase dashboard, go to your project, click on "Storage" in the side bar, then click on "New bucket". Fill innonsenseas the name and enable "Public bucket". Make sure to add a new policy so that authenticated users can upload media to accompany nonsense entries by going into the newly-made bucket, then clicking on "Policies", then "New policy", then "For full customization". Add a policy name like "Upload media", enable "INSERT" in the Allowed operation section, then selectauthenticatedfrom the dropdown for the Target roles section. Once done, click on "Review" and (adjust again if needed) then click on "Save policy".
SUPABASE_SERVICE_ROLE_KEYmust be filled to test the submission functionality. In your project, go to the Project Settings, then API Keys.
METABASE_SECRET_KEYandPUBLIC_METABASE_URLcan be left out if you don't have Metabase available to be shown in the Stats page (see Metabase documentation for embedding); only the official Tableau Public dashboard will be shown for the nonsense database on Nontrinsic.
NEWS_RSSandWORD_OF_THE_DAY_APIare optional, and they are only used in some entries that use special variables (${breaking_news}and${word_of_the_day}).
IMAGE_ENDPOINTandIMAGE_TOKENare required to use the share functionality for nonsense entries. Seenontrinsic/imagefor more information.
REPORT_WEBHOOK_URLis required for the entry reporting endpoint to work.
Start the development server
npm run dev
...then open your browser and go to http://localhost:5173
Self-hosting Nontrinsic in production is beyond this documentation, as you will need to adjust the adapter for SvelteKit to use for whatever deployment platform you're using, etc.
Donate
Nontrinsic, being a side project once, just happens to be my school project now; I have lots of free time to work on this!
I believe nonsense should be free. The cost of developing and hosting Nontrinsic is (essentially) free, but there's the cost of publishing the mobile apps to complement the web platform and investing in new hardware for development.
If you'd like to support me to make sure I can keep continuing all of this, consider contributing financially via Liberapay, Ko-fi, or PayPal. Thank you!
Translations
Help translate Nontrinsic on Codeberg Translate!
License
The Nontrinsic web app is licensed under the GNU Affero General Public License, while the database itself is licensed under CC0 1.0 Universal which you can download a copy of it.