chris510 / magic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TechStacks + Libraries used

Setup

  • First please clone this repo onto your desktop directory. Two ways to set up:
  1. Docker
  2. Manually with npm

Docker

  1. From the root directory, please run
    docker compose up

Manual

  1. You'll need postgres installed on your local machine.
  2. Once Postgres is installed, you'll need to create a database for this exercise. Please name the database 'magic'. From psql, you'd need to so something like:
psql                          // To launch the postgres terminal
create table magic           // To create the database
\q                           // Exit the terminal
psql -d magic                // to relaunch the terminal, but connected specifically to your new database.
  1. Once you have the database created, you're ready to run the server. Navigate back to the root directory, and run:
cd server
npm install
npm run start
  1. We will now need to run the client. Open a new terminal tab and run
cd client
npm install
npm run start

For either methods, we can test that the client works by going to the below URL and we should see a form.

http://localhost:3000/

We can also test that we are properly connected to the server by going to

http://localhost:3001/api/products/1

You should get a JSON response back from the server:

{
    "id":1,
    "name":"Magic Potion",
    "description":"Awesome's new revolutionary awesome skin product!",
    "price":49.99,
    "maxPurchase":3
}

About


Languages

Language:JavaScript 91.1%Language:HTML 6.6%Language:CSS 1.4%Language:Dockerfile 0.9%