This is a initial application of an Affiliate Marketing Program to help content creators, publishers and bloggers monetize their traffic. You can signup, create an product, delete it and add comments.
Table of contents:
git clone git://github.com/jhonatantft/affiliate-marketing-program.git
npm install
cp .env.example .env
npm startThen visit http://localhost:3000/
NOTE: Do not forget to set the twitter, google, linkedin and github CLIENT_IDs and SECRETs. In development env, you can set the env variables in .env and replace the values there. In production env, it is not safe to keep the ids and secrets in a file, so you need to set it up via commandline. If you are using heroku checkout how environment variables are set here.
npm testYou can also use docker for development. Make sure you run npm install on your host machine so that code linting and everything works fine.
npm i
cp .env.example .envStart the services
docker-compose up -dView the logs
docker-compose logs -fIn case you install a npm module while developing, it should also be installed within docker container, to do this first install the module you want with simple npm i module name, then run it within docker container
docker-compose exec node npm iIf you make any changes to the file, nodemon should automatically pick up and restart within docker (you can see this in the logs)
To run tests
docker-compose exec -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm testNote that we are overriding the environment variable set in .env file because we don't want our data erased by the tests.
Note: The difference between exec and run is that, exec executes the command within the running container and run will spin up a new container to run that command. So if you want to run only the tests without docker-compose up, you may do so by running docker-compose run -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test
You can use a GUI like MongoDB Compass to visually explore your data.
Note: Don't forget to create credentials to your database
MIT