Todo/task tracking webapp build in Vue with a backend in Rust using a Postgres DB.
NOTE:
Make sure to develop in WSL, Linux, or MacOS.
cargo watch
seems to not work when running on a Windows machine, which makes development painfully slow because the docker container must be rebuilt every time to view new changes.
-
Make a copy of the
.env.template
file and replace items with<angle-brackets>
with actual data. -
Run the command:
./run_dev.sh
NOTE:
If docker gives you
error getting credentials
errors whenever you build on WSL, please run:rm ~/.docker/config.json
Run the command:
docker-compose down -v
Make sure you have sqlx-cli v0.6.3
installed! The newer versions don't work since rocket
depends on sqlx v0.6
.
Inside the backend
folder, run one of the following commands:
./scripts/run_tests.sh
./scripts/watch_tests.sh
- Accessing Postgresql Database
-
Logging into Postgres
sudo -u postgres psql
-
Commands
\q
- Quit\l
- List databases\c {database}
- Connect to{database}
\dt
- Lists tables
-
Configuration file is stored at
/etc/postgresql/12/main/postgresql.conf
NOTE:
Use an alternative port to
5432
on windows, because you might already have a Windows Postgres DB taking up that port.NOTE:
Add
listen_addresses = '*'
to yourpostgresql.conf
file to ensure you can connect from windows
-