we switched to using make a while ago, forgot to update this doc
2.8 KiB
sidebar_position, description
| sidebar_position | description |
|---|---|
| 11 | Building from source for developing upon Watcharr. |
For Development
This guide will help you setup Watcharr for development in your local environment.
Setup
This section assumes you will be forking the repo on Github, of course you can alter this section to work with your workflow, but if you intend to create a pull request with your work, it may be difficult if you're not also using Github (I don't know :()).
-
Fork the repository
On GitHub you can fork the repository with the 'Fork' button at the top.
-
Get the code by cloning your fork (edit the command and replace
<your username>with your GitHub username or replace the whole url with the correct one pointing to your fork).git clone https://github.com/<your username>/Watcharr.git && \ cd Watcharr
Setting Up Dependencies
You only need to do this once after pulling the codebase for the first time, and again every time the dependencies are changed/updated.
-
Install frontend dependencies (in the project root folder)
npm i -
Install server dependencies (in the
serverfolder). Go does this automatically if you try starting the server and it notices you don't have them.go get .
Running The Code
To run the code, you will need to open up two terminals, one for the frontend and the other for the backend.
We have Makefiles for the frontend and server, so you can simply call make in each directory. Most Linux distros (as far as I know) include make, so you don't need to install anything. If you don't have make, you can either install it (lookup how to get "GNU Make" for your specific OS) OR you can just look inside the Makefiles and manually run the first command in each.
-
Run the frontend (first terminal, in the project root folder)
make -
Run the server (second terminal, in the
serverfolder)makeNote: If you're using Windows, running the server can be a little more complicated. You can follow this: https://github.com/sbondCo/Watcharr/discussions/430#discussioncomment-8894110 which amounts to these steps (the first 3 steps only need to be done once):
-
Set CGO_ENABLED environment variable with go
go env -w CGO_ENABLED=1 -
Install
gcc(if you don't already have it installed) from https://jmeubank.github.io/tdm-gcc/ (found from this answer on stackoverflow: https://stackoverflow.com/a/43588236). -
Install server dependencies again with
go get .in theserverfolder. -
Manually run the server, setting the MODE environment variable in powershell (from the
serverfolder)cmd /V /C "set MODE=DEV&& go run ."
-
-
Visit http://localhost:5173/ and setup Watcharr.
