fe
- Frontendconfig
- Configuration filesapplication.yml
- Application enviromental variables for bothfe
andbe
configuration
be
- Backendprisma
- Postgres ORM
- Clone the repo
yarn setup
- Configure
fe/config/application.yml
with your own local postgres connection url likepostgresql://username@localhost:5432/veritext_box
- Due to the way prisma loads env variables in development, you will need to make sure your
pg
connection url is set toDATABASE_URL
in your.env
file located atbe/prisma/.env
yarn db:migrate:dev
yarn db:seed
(optional)yarn dev
- If you are having trouble getting your
DATABASE_URL
to work, try runningyarn db:generate
and thenyarn db:migrate:dev
again.
If you don't have postgres installed locally, you can use the following commands to get it set up.
brew install postgresql
brew services start postgresql
There are several guides to creating a database using the homebrew cli tool, but the following is a quick guide to get you started with pgAdmin4.
- Install pgAdmin4
https://www.pgadmin.org/download/pgadmin-4-macos/
- Open pgAdmin4
- After opening pgAdmin4, you will be prompted to create a "master password". This is the password you will use to login to pgAdmin4. You can just click enter to skip this password step or you can create a password.
- Click
Add New Server
- Under the
General
tab, give your database a name in the input field labeledName
- Click the
Connection
tab - Under
Host name/address
, enterlocalhost
- Under
Port
, enter5432
- Keep username as
postgres
- Keep password empty
- Click
Save
Now you should be taken to the dashboard of your database. If you followed the steps above, your connection string should be postgresql://postgres@localhost:5432/database_name
. You can use this connection string to connect to your database using the DATABASE_URL
variable in your .env
file.