unoffical wafrn mirror
wafrn.net
atproto
social-network
activitypub
1# Developing wafrn
2
3## Project Structure
4
5Wafrn is split between an [Angular](https://angular.dev) frontend and a [NodeJS](https://nodejs.org/en) backend.
6
7```text
8packages/
9├── frontend/
10│ ├── routes/
11│ ├── util/
12│ ├── README.md
13│ └── ...
14└── backend/
15 ├── src/
16 │ ├── app/
17 │ ├── assets/
18 │ └── ...
19 ├── README.md
20 └── ...
21```
22
23(Tree made with [tree.nathanfriend.io](https://tree.nathanfriend.io/))
24
25## Contributing
26
27If you would like to help develop the Frontend or Backend, read the README.md of the respective package.
28
29- [Frontend - README.md](../packages/frontend/README.md)
30- [Backend - README.md](../packages/backend/README.md)
31
32## Local setup
33
34If you only want to develop Wafrn frontend, you can point it at a working instance. See [Frontend - README.md](../packages/frontend/README.md) for more details
35
36If you want to setup both the backend and frontend locally there are a couple of helper scripts that can help you set up a local environment:
37
381. Run `./install/env_local_setup.sh`. This will setup the backend and frontend environment files to point to each other locally.
39
402. Run `docker compose up`. This will start up the required services: PostgreSQL, Redis and Caddy
41
42> **Note:** If you're not a fan of docker, or you already have these services running, you can also install PostgreSQL, Redis and Caddy manually.
43
44> **Note:** If you are running Caddy manually, or you are not using Docker Desktop but a more native docker installation, you will need to edit `packages/frontend/Caddyfile` and replace `host.docker.internal` with `localhost` for it to work properly.
45
463. Set up the the backend:
47
48```sh
49cd packages/backend
50npm i
51npm run db:migrate
52```
53
544. Set up the frontend:
55
56```sh
57cd packages/frontend
58npm i
59npm exec -- ng build --configuration=devlocal
60```
61
625. Start backend & frontend
63
64```sh
65cd packages/backend
66NODE_TLS_REJECT_UNAUTHORIZED=0 npm start
67```
68
69```sh
70cd packages/frontend
71npm exec -- ng serve --host 0.0.0.0 --configuration=devlocal
72```
73
746. If all is well go to `https://localhost` to see your app
75
76The default username/password for local installation is: `admin@example.com` / `Password1!`
77
78> **Note:** You can run `caddy trust` to install Caddy's root certificates, to the system store. This will remove the security warnings from your browser. You can also do `caddy untrust` once you're finished with the development.
79
80> **Warning:** Due to how the Fediverse and Bluesky operates not all features will be accessible when developing the backend locally. You might [want to host your own Wafrn instance](./deployment.md) as a staging server if you wish to develop features that require proper access to the Fediverse and/or Bluesky