- Ensure you have
Node 19
,Ruby 3.2.2
, &pnpm
installed on your machine. - Create and fill in
.env
using.env.example
as an example. - Setup your postgres database. If you prefer just command line you can use the command below. DBngin is also a quick and easy way to get a local db started.
Brew install postgresql
- Setup your client:
pnpm client:setup
- Setup your API:
pnpm api:setup
- Start your API:
pnpm api:start
- Start your client (new terminal tab):
pnpm client:start
Run pnpm api:test
to run the rails app tests. The client does not have any tests currently.
- Create and fill in
.env
using.env.example
as an example in the/scripts
directory. - Run
bundle install
- Run the script in the following format:
ruby pdf_to_pages_embeddings.rb product_engineering_challenge.pdf
- Copy the resulting csv files
product_engineering_challenge.pdf.embeddings.csv
&product_engineering_challenge.pdf.pages.csv
to the/api/app/data/
directory. You will notice this already has the generated files, so the application can work.
Deployment is done with Railway. A push with changes to the main
branch will trigger a new deploy.
To deploy a new frontend run pnpm run build:prod
, commit, and push to main
.
Railway Ruby docs can be found here
The root directory for the application for Railway is /api
The build command is bundle exec rails db:migrate