W
Wasp-langterrence

Is it possible to separate client and server wasp build?

each time I update stuff on client, and want to push to netlify, I need to run wasp build, but it rebuild both front and backend, it takes so much time(and sometime I only made change to client code, last second it could successfully build, but now it cannot find DATABASE_URL which is really weird), is it possible to only build front or back? and do we have a solution to integrate CI/CD? like I'm using coolify, let it automatically pull code from github when new code pushes triggered, so it can update automatically. @miho
kapa.ai
kapa.ai20d ago
Hi @terrence. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, it is possible to separate the client and server build in Wasp. When you run wasp build, it generates both the client and server code. However, you can choose to only deploy the client or server code based on your needs. To build the web app (client), you can position yourself in the .wasp/build/web-app directory and run the following commands:
cd .wasp/build/web-app
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
cd .wasp/build/web-app
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
Replace <url_to_wasp_backend> with the URL of the Wasp server that you previously deployed. This will build the web client and put it in the build/ directory in the web-app directory. Since the app's frontend is just a bunch of static files, you can deploy it to any static hosting provider like Netlify[^1^]. As for CI/CD integration, there is an open issue on the Wasp GitHub repository discussing the implementation of a Github CI Action that builds your Wasp app[^4^]. However, as of now, there isn't a built-in solution for CI/CD in Wasp. You might need to set up your own CI/CD pipeline using tools like Jenkins, Travis CI, or GitHub Actions. Regarding the DATABASE_URL issue, make sure you have set this URL as the WASP_WEB_CLIENT_URL environment variable in your server hosting environment[^1^]. [^1^]: (https://wasp-lang.dev/docs/advanced/deployment/manually#netlify-client) [^4^]: (https://github.com/wasp-lang/wasp/issues/602) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @terrence, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
martinsos
martinsos8d ago
@terrence you can certainly have CI/CD, that is not specific to Wasp! We have people normally building Wasp in CI/CD. It is certainly doable in Github Actions. I don't know much about coolify but it should be similar. We don't have a way to build just one piece of code currently. But wasp build should be quite fast I thought hm! How long does it take for you?
terrence
terrence7d ago
It's about 5-10mins, do you have tutorial to setup CI/CD for wasp?Thank you.
miho
miho6d ago
We have a Github action to deploy to Caprover (self hosted PaaS), this might be useful for you? https://github.com/wasp-lang/deploy-to-caprover-action/blob/main/.github/workflows/deploy.yml
GitHub
deploy-to-caprover-action/.github/workflows/deploy.yml at main · wa...
Contribute to wasp-lang/deploy-to-caprover-action development by creating an account on GitHub.
martinsos
martinsos5d ago
Wow 5 to 10 minutes for wasp build? Hmmm. What are your machine's specs?
terrence
terrence5d ago
I have one minipc 7840hs, one desktop 13700k, one old mac i9-9980hk, they all got 32GB mem, and 1-2tb ssd, but I'm doing development in docker dev container, I dont know if that matters a lot, I dont want to setup local env, it normally got messed up though
martinsos
martinsos5d ago
Well I am not sure about minipc or deskotp one, nor do I konw whicn one are you using to build wasp, but i9 should certanly be powerful enough and 32GB is more than plenty. So if your CPU is relatively modern, you should be good, and 5 to 10 minutes for wasp build indeed sounds extreme. Docker might be an issue, if it is writing on the disk of your host machine in a way that slows it down, that has been a common issue https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076 and has some workarounds from what I remember. It depends on the details of the setup though.
Docker Community Forums
File access in mounted volumes extremely slow, CPU bound
(Submitted this via email, but since reports are happening on the forum now, I’m sharing here as well!) Expected behavior File access in volumes should be comparable to access times in non-volumes, similarly to Linux installations of docker, or docker on mac via docker-machine and VirtualBox. Actual behavior File access in volumes is many time...
terrence
terrence5d ago
and I'm pushing production to fly.io, it's indeed very convenient, but I need scale my project now, so I'm thinking migrating to aws, but I dont find a tutorial or solution on the website, I look through on here, there is one thread, but not very detailed, and it's like a month before, do you guys have tutorial for deploy to aws, azure or gcp manually? Thank you,
martinsos
martinsos5d ago
So we don't have yet tutorials for those but we do have manual deployment instrutcions so those should give you enough info to pull it off! https://wasp-lang.dev/docs/advanced/deployment/manually You said you are looking to scale -> I am curious, how is it that Fly.io isn't enough, can't you scale there?
terrence
terrence5d ago
our startup got $5000 aws credits, so, you know, it's better just go with aws for now, basically it's gonnabe free for a while.
Want results from more Discord servers?
Add your server
More Posts
fly.io deployment errorI tried to deploy to fly.io, and I set DATABASE_URL, and I tested it can connect successfully with dfront end developers demand in job marketCan anyone please tell me about the demand of a beginner level front end developer in job market nowPassing Context for Dependency InjectionIs there a standard pattern for passing the context object for database interaction to functions? WGetting Updates to the Open SaaS Template (not working?)I am following the guide in [Getting Started](https://docs.opensaas.sh/start/getting-started/), howeCant find app and blog in my folder but it says wasp already installed.Hi everyone, ive installed Wasp but i cant find where the app and blog folder is at. It keeps says NsignupWhen defining action in main file If i dont want to use entity as i dont want to store in the db. CaStoring additional data in sessionHi everyone 😉 I'm exploring a possibility to develop my new project in WASP which looks really awesOAuth Login Error with Google Credentials in Local EnvironmentHello everyone, I need a bit of help. In my local environment, I've correctly set up the GOOGLE_CLIETypescript not validating included relationThis is likely due to my inexperience with typescript, but I've been trying to access a related propcustomize auth UI button shapeHi, I see there is an appearance to customize the color of the auth UI, how can I change the shape oStarlight missing trailing slashStarlight's sidebar doesn't include a trailing slash ("/") at the end of the URL, leading to a 301 rSuggested cookie consent plugin?I have been trying a few cookie consent plugins for React, but none seem to work well with Wasp (e.gpaypal & other payment gateway integrationI am curious if there is guideline/template for integration of other payment gateway apart from striGoogle Tag ManagerHey everyone, I am implementing Google Tag Manager according to the instructions (attached). The <hecustom http api endpointHello. I am following some of the documents for custom http api endpoint. 8 gave an 'api foobar' defIs it possible to customise titles of Auth component?I create an app in french, I can't let it in english. I saw I can customize the colors but that's noHow can I custom the verification email content?+ Can I use SendGrid template?failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exwhile deploying client on railway LinuxDatabase not started on setting up the projectI have just worked with Wasp-lang and trying to run the first project. The error occurs when I try terror schema.prisma:63Hi Guys, i get the following error when creating a new project in wasp it says schema.primsa is alre