Setup - wbobeirne/nycda-ecommerce-server GitHub Wiki

  1. Download (Not clone, not fork) this repository
  2. Replace the src directory with the one from your previous project
    • You can delete the src directory in the folder you downloaded and replace it with yours, starting a new repository
    • Or, you can delete everything in your repository EXCEPT src, and copy in everything from the downloaded folder EXCEPT src
  3. Add back in any node modules you may have added, if any
    • DO NOT replace package.json with your old one. The server requires many modules your old package.json didn't have, and will fail to start if you do this!
  4. Run npm install to install the packages.
  5. While that's running, sign up an imgur.com api app here.
  6. When you've done that, creat your .env file with the following information:
DATABASE_NAME=[PSQL DATABASE NAME]
DATABASE_USER=[PSQL DATABASE USER]
DATABASE_PASSWORD=[PSQL DATABASE PASSWORD]

ADMIN_PASSWORD=[YOUR OWN CUSTOM PASSWORD]

IMGUR_CLIENT_ID=[FROM IMGUR API APP]
IMGUR_CLIENT_SECRET=[FROM IMGUR API APP]
  1. Run npm start, and hopefully everything should work exactly as it did before
  2. Update your README.md to reflect the new technology and setup steps (Your old one will probably not have information about postgres or .env)
  3. Add an attribution to this project to your README. You only need to mention how the server portion was provided by this repo, but obviously you take credit for the app! Failure to do so could be considered plagiarism.
  4. Create, or replace an existing repo with your new code!

Importing Watch Data

If you want to easily get back the same watch data from part one, simply run:

curl https://s3.us-east-2.amazonaws.com/wbobeirne-misc/ecommerce.dump -o "db.dump"
psql -U postgres [POSTGRES_DB_NAME] < db.dump; rm db.dump

Make sure you replace [POSTGRES_DB_NAME] with the name of your database