mirror of
https://github.com/sbondCo/Watcharr.git
synced 2026-08-07 07:14:44 +00:00
0a38171836
we switched to using make a while ago, forgot to update this doc
80 lines
2.8 KiB
Markdown
80 lines
2.8 KiB
Markdown
---
|
|
sidebar_position: 11
|
|
description: 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 :()).
|
|
|
|
1. Fork the repository
|
|
|
|
On GitHub you can fork the repository with the 'Fork' button at the top.
|
|
|
|

|
|
|
|
2. 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).
|
|
|
|
```bash
|
|
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.
|
|
|
|
1. Install frontend dependencies (in the project root folder)
|
|
|
|
```
|
|
npm i
|
|
```
|
|
|
|
2. Install server dependencies (in the `server` folder). 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 `Makefile`s 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.
|
|
|
|
1. Run the frontend (first terminal, in the project root folder)
|
|
|
|
```bash
|
|
make
|
|
```
|
|
|
|
2. Run the server (second terminal, in the `server` folder)
|
|
|
|
```bash
|
|
make
|
|
```
|
|
|
|
**Note:** 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):
|
|
|
|
1. Set CGO_ENABLED environment variable with go
|
|
|
|
```
|
|
go env -w CGO_ENABLED=1
|
|
```
|
|
|
|
2. 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).
|
|
|
|
3. Install server dependencies again with `go get .` in the `server` folder.
|
|
|
|
4. Manually run the server, setting the MODE environment variable in powershell (from the `server` folder)
|
|
|
|
```
|
|
cmd /V /C "set MODE=DEV&& go run ."
|
|
```
|
|
|
|
3. Visit [http://localhost:5173/](http://localhost:5173/) and setup Watcharr.
|