Setup - wbobeirne/nycda-ecommerce-server GitHub Wiki
- Download (Not clone, not fork) this repository
- Replace the
srcdirectory with the one from your previous project- You can delete the
srcdirectory 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 EXCEPTsrc
- You can delete the
- 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!
- Run
npm installto install the packages. - While that's running, sign up an imgur.com api app here.
- 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]
- Run
npm start, and hopefully everything should work exactly as it did before - Update your
README.mdto reflect the new technology and setup steps (Your old one will probably not have information about postgres or.env) - 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.
- 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