A project for monitoring websites, built with FastAPI and React.
A description of the project's folder structure.
/backend
A backend server using FastAPI, managed with Poetry./backend/linkpulse
A python module containing the FastAPI application, database models, migration scripts, and more./backend/migrations
Migration scripts forpeewee
; most of this is generated automatically.
/frontend
A frontend server using React, managed with pnpm, built with Vite./frontend/Caddyfile
A Caddy configuration file used for proxying API requests to the backend server via Private Networking (Railway)./frontend/nixpacks.toml
Configures the frontend build process for Nixpacks, enabling the use of Caddy for deployment.
Windows WSL is strongly recommended for development. See here for setup instructions.
The following instructions were written for Ubuntu 22.04 LTS, the primary (default) target for WSL.
- Install Node.js 22.x
I recommend asdf
or nvm
for managing this (although asdf
is superior in my opinion, and it's tool/language agnostic). Alternatives are available though.
Assuming you're using Bash/Zsh & Git, you'll need to add this to your bashrc file: . "$HOME/.asdf/asdf.sh"
. Shell completions are recommended, but optional. Refer to documentation here for further detail.
Once added, restart your terminal and cd
into the project root.
asdf plugin add nodejs
asdf install
This installs the version of Node.js specified in .tool-versions
.
Note
If you use Node.js for other projects, you may want to install the version you need & set it as the global version via asdf global nodejs <version>
or asdf install nodejs latest:<version>
. If you don't care, asdf install latest nodejs
also works.
- Install
pnpm
withnpm install -g pnpm
cd frontend
- Install frontend dependencies with
pnpm install
- Start the frontend server with
./run.sh
-
- Install Python 3.12 (
pyenv install 3.12
)
- Install Python 3.12 (
-
Install
poetry
- Requires
pipx
, see here. You will NOT have this by default. This is NOTpip
, do not install either withpip
. - Install with
pipx install poetry
- Requires
-
Install backend dependencies with
poetry install
. -
Start the backend server with
./run.sh
-
(optional) Install the Railway CLI
- Fastest installation is via shell:
bash <(curl -fsSL cli.new)
- Alternatives found here.
- This will let us skip creating a local
.env
file, as well as keeping your database URL synchronized. - You will have to run
railway login
upon install as well asrailway link
in the backend directory.
- Fastest installation is via shell:
A full stack (frontend and backend), automatically reloading project is possible, but it requires two terminals.
- Open a terminal in each respective directory (
/backend
and/frontend
). - Execute
./run.sh
to start the development server for each.- For the backend, you'll either need to have the
railway
CLI installed or a.env
file with the database URL.- See
.env.example
for a list of all available environment variables.
- See
- For the frontend, the defaults are already sufficient.
- For the backend, you'll either need to have the
Warning
The run.sh
scripts provide default environment variables internally; if you want to run the commands manually, you'll need to provide them to .env
files or the command line.