Skip to content

VTUL-CDRS/PromptLibrary

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Backend

  1. Change into the backend directory
  2. Run npm install
  3. If changes are made run npm run build to build with those changes
  4. To run the backend locally, execute npm run start

Frontend

  1. Change into the frontend directory
  2. Run npm install
  3. To run the frontend locally, execute npm run dev

Database Setup and Management

Dumping

We assume that you already have the PostgreSQL server set up. On Windows:

  1. Make sure PostgreSQL is running
  2. Add PostgreSQL/{version}/bin to PATH
  3. Add PostgreSQL/{version}/lib to PATH
  4. Open Windows PowerShell
  5. cd into a directory you want the database to export to
  6. Run the command pg_dump -U {username} -E=UTF-8 -d PromptLibrary -f {filename}.txt, replacing {username} and {filename} with your username and filename
  7. Type your password for the server

Restoring a dump

To load the database from a dump on Windows

  1. Delete your current database if you have one
  2. Remake a new one with the name PromptLibrary
  3. Open Windows PowerShell
  4. cd into the directory with the db dump
  5. Run the command "cat dump.txt | psql PromptLibrary postgres"

Deploying/Serving with Docker

How to deploy

The project has 3 docker-compose files within the PromptLibrary, Frontend, and Backend directories which can be used to deploy the PropmtLibrary. In order to run the entire PromptLibrary, a user should run this command while in the PromptLibrary directory: docker compose up -d --build

If the user desires, the same command can be ran within the Frontend or Backend directory in order to build only the frontend or backend respectively.

First Build

On the first build of the docker container, the user will also need to run the following:

  1. docker exec -it web npx prisma db push
  2. docker exec -it web npx prisma db seed This must be done in order to sync the PostgreSQL database with the Prisma file while also seeding the database.

Important Information

Once deployed, the front end will be visible on localhost:8000 while the backend can be directly accessed within localhost:8080. These ports are determined within the docker-compose.yml files and can be modified if required by the user.

Releases

No releases published

Packages

No packages published

Languages

  • Vue 65.9%
  • TypeScript 30.4%
  • CSS 3.0%
  • Other 0.7%