A web application to crowd-source the location of UF campus cats so more people can visit them
- Start the backend (instructions below)
- Move to
frontend
directory npm install
- Build
- Development:
npm start
(access through provided dev server) - Production:
npm run build
(access through the backend)
- Development:
- Create the
.env
file inbackend/
- Setup database (instructions below)
- Run
cargo run
inbackend/
- Install Postgres then start with
pg_ctl -D /usr/local/var/postgresql@14 start
- Install SQLx CLI
cargo install sqlx-cli
- Add
DATABASE_URL
to.env
- Create database
sqlx database create
- Run migrations
sqlx migrate run
- Install Docker
- Create
.env
with everything exceptDATABASE_URL
in/
- Run:
docker compose up
DATABASE_URL
- URL to the postgres database
- in the form
postgres://USERNAME:PASSWORD@localhost/cat-tracker
JWT_SECRET
- The key used for auth
- Generate with
openssl rand -base64 32
GOOGLE_MAP_KEY
- Key used to connect to google maps api
- Get it from Chung
RUST_LOG
(optional)- How much you want the backend to log
backend=LEVEL,tower_http=LEVEL
SQLX_OFFLINE
(optional)- Skip checking if sqlx queries match the running database when compiling
PORT
(optional local, required docker)- The port to run the backend on
- Local:
/backend/.env
- Docker:
/.env
- Deployment: Managed by heroku
- After Changing a
query!
:cargo sqlx prepare
- New Migration:
sqlx migrate add <name>
Migrations are automatically applied to the database when the backend is run
Run the backend and then view /api/docs