Developing wafrn#
Project Structure#
Wafrn is split between an Angular frontend and a NodeJS backend.
packages/
├── frontend/
│ ├── routes/
│ ├── util/
│ ├── README.md
│ └── ...
└── backend/
├── src/
│ ├── app/
│ ├── assets/
│ └── ...
├── README.md
└── ...
(Tree made with tree.nathanfriend.io)
Contributing#
If you would like to help develop the Frontend or Backend, read the README.md of the respective package.
Local setup#
If you only want to develop Wafrn frontend, you can point it at a working instance. See Frontend - README.md for more details
If 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:
-
Run
./install/env_local_setup.sh. This will setup the backend and frontend environment files to point to each other locally. -
Run
docker compose up. This will start up the required services: PostgreSQL, Redis and Caddy
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.
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/Caddyfileand replacehost.docker.internalwithlocalhostfor it to work properly.
- Set up the the backend:
cd packages/backend
npm i
npm run db:migrate
- Set up the frontend:
cd packages/frontend
npm i
npm exec -- ng build --configuration=devlocal
- Start backend & frontend
cd packages/backend
NODE_TLS_REJECT_UNAUTHORIZED=0 npm start
cd packages/frontend
npm exec -- ng serve --host 0.0.0.0 --configuration=devlocal
- If all is well go to
https://localhostto see your app
The default username/password for local installation is: admin@example.com / Password1!
Note: You can run
caddy trustto install Caddy's root certificates, to the system store. This will remove the security warnings from your browser. You can also docaddy untrustonce you're finished with the development.
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 as a staging server if you wish to develop features that require proper access to the Fediverse and/or Bluesky