Skip to content

Instantly share code, notes, and snippets.

View infomiho's full-sized avatar
🐶

Mihovil Ilakovac infomiho

🐶
View GitHub Profile
@infomiho
infomiho / main.wasp
Last active March 11, 2024 08:58
Using Wasp with @fontsource (Solution for the "The request url * is outside of Vite serving allow list" issue)
app fontsTest {
wasp: {
version: "^0.12.3"
},
title: "fontsTest",
client: {
rootComponent: import { App } from "@src/App.jsx"
}
}
@infomiho
infomiho / 0-README.md
Last active May 10, 2025 04:57
Using ShadCN with Wasp 0.12+

Using ShadCN with Wasp 0.12 and beyond

Note

We'll be loosly following the Vite instructions for ShadCN since Wasp is using Vite + React: https://ui.shadcn.com/docs/installation/vite We'll skip some of the steps since they don't apply or they are done differently with Wasp.

You won't be able to use the @ alias setup since it's not currently supported by Wasp. Because of this you'll need to adjust some imports when we generate components, but it should be fairly straightforward to do.

1. Enable TailwindCSS if you haven't already

@infomiho
infomiho / .env.server
Last active January 3, 2025 22:02
Implementing custom OAuth provider with Wasp 0.14.1+ (Spotify in this case)
# Put some dummy values here
GOOGLE_CLIENT_ID=x
GOOGLE_CLIENT_SECRET=x
# Put your Spotify client ID and secret here
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
@infomiho
infomiho / main.wasp
Created July 29, 2024 22:13
Custom login API endpoint
app apiAuth {
wasp: {
version: "^0.14.0"
},
title: "api-auth",
auth: {
userEntity: User,
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/",
methods: {
@infomiho
infomiho / main.wasp
Last active July 31, 2024 10:11
Multiple domains for CORS - custom global middleware in Wasp 0.12+
app corsTest {
wasp: {
version: "^0.14.0"
},
title: "cors-test",
server: {
middlewareConfigFn: import { getGlobalMiddleware } from "@src/data",
}
}
@infomiho
infomiho / README.md
Last active January 21, 2025 19:53
Deploy Wasp to a VPS (reverse proxy + Docker)

Deploying a Wasp app to a VPS

Let's deploy a Wasp app directly to a VPS. We'll do things directly on the machine without any management dashboard.

We'll need a couple of things to get this going:

  • a VPS (I'll be using Hetzner, but it doesn't matter which provider you use)
  • a domain name (mostly to have HTTPS)

Our setup will look like this:

  • Ubuntu LTS
@infomiho
infomiho / README.md
Last active March 25, 2025 18:11
Deploying Wasp apps to Coolify

Self-hosting is a great way to have control over your deployment infrastructure (you own the data) and a great way to keep the costs down (you pay a fixed amount per month). One of the smoothest way to manage your self-hosted deployment is Coolify.

Deploying Wasp apps to Coolify is straightforward:

  • create your Coolify apps (client, server and db)
  • build your app's Docker images (e.g. using Github Actions),
  • trigger Coolify to pull the Docker images and deploy them.

It'll take you ~1 hour depending on your level of experience with servers and Github Actions.

Installing Coolify

@infomiho
infomiho / README.md
Last active April 24, 2025 15:39
Deploy Wasp apps to Caprover

Self-hosting is a great way to have control over your deployment infrastructure (you own the data) and a great way to keep the costs down (you pay a fixed amount per month). One of the well established ways to manage your self-hosted deployment is Caprover.

Deploying Wasp apps to Caprover is straightforward:

  • create your Caprover apps (client, server and db)
  • build your app's Docker images (e.g. using Github Actions),
  • trigger Caprover to pull the Docker images and deploy them.

It'll take you ~1 hour depending on your level of experience with servers and Github Actions.

Installing Caprover

@infomiho
infomiho / README.md
Last active November 27, 2024 12:07
Integrate Sentry into a Wasp app

Sentry is a useful tool to track errors that appear in your Wasp application.

Let's see how we can integrate it on the server and the client.

Sign up for Sentry

Make sure you have an account.

Create a project for your server app

const fs = require('fs');
const path = require('path');
/**
* Main function to sync redirects from the appropriate docs version to static directory
*/
function syncRedirects() {
try {
const isDevMode = checkDevelopmentMode();
const staticRedirectsPath = getStaticRedirectsPath();