/cashtools-api

API for CashTools: Mobile app to manage personal money built in twitch livestreams

Primary LanguageRust

CashTools API

This is the backend of a mobile app called CashTools. It exists to manage personal money. You can follow the app development on the twitch channel. Check the mobile app repository too. It's written in Rust mainly using Rocket, Juniper, Diesel and Postgres.

Dependencies

Unfortunately, you will need to install libpq-dev and openssl-dev manually to run the project. To do it run:

sudo apt install libpq-dev openssl-dev

How to run locally + local database

Start a Postgres instance locally and add the database url in a file called .env.local. It should look like this:

DATABASE_URL=...
JWT_SECRET=...
ENV=DEV
API_PORT=8080

To run all migrations in your database, run:

make migration-run

To start the API simply run the following command:

make run

How to run locally + remote database

To do it you should add a new variable to you .env.local called DB_APPNAME and set the DATABASE_URL correctly. You can get those informations from fly.io dashboard.

After it, run:

make proxy

WARNING: If it doesn't work, check if you have fly CLI installed and correctly authenticated.

Now you can just run the project as you expect:

make run