Code Monkey home page Code Monkey logo

nyt-cra's Introduction

New York Times React Search

Application developed using Create-React-App to build out a New York Times article search, using their API. Application will display desired results to user, with the ability to save to a Mongo Database.

Getting Started

Either clone or fork the repo, from the command line navigate to your cloned directory, and run the following commands:

Install all dependancies from package.json by navigating to your project root directory.

npm install 

While dependancies are installing, you can start MongoDB, so that your dev enviornment can talk to the database.

In terminal window run:

mongod

Open up another and run:

mongo

These commands start up the MongoDB and allow it to listen for open connections.

After depencies are finished installing, open another terminal window and run npm start, in order to compile the react front end.

npm start

In another terminal window, navigate to the /Backend directory, and run

node server.js

or if using Nodemon:

nodemon server.js

This will boot up your local server.

Prerequisites

In order for the application to run, you must have Node and MongoDB installed on your computer.

If using Homebrew, Mongo can be installed via the command:

brew install mongodb

After making sure your system is running Node, package.json has all the npm packages needed to run application.

npm install

Deployment

Application can be deployed using Heroku in which you will find more detailed instructions on how to do so.

After you have already created a new or cloned the repo, cd into the directory and create a new Heroku app.

The heroku create CLI command creates a new empty application on Heroku, along with an associated empty Git repository. If you run this command from your app’s root directory, the empty Heroku Git repository is automatically set as a remote for your local repository.

heroku create

You can use the git remote command to confirm that a remote named heroku has been set for your app:

git remote -v

To deploy your app to Heroku, you typically use the git push command to push the code from your local repository’s master branch to your heroku remote, like so:

git push heroku master

If you come across any errors, it would be advised to review the Heroku documentation for further explanation.

In order to deploy your project to Heroku, you must set up an mLab provision. mLab is remote MongoDB database that Heroku supports natively. Follow these steps to get it running:

After you create a Heroku app in your project directory.

  1. Run this command in your Terminal/Bash window:

    • heroku addons:create mongolab

    • This command will add the free mLab provision to your project.

  2. You'll need to find the URI string that connects Mongoose to mLab. Run this command to grab that string:

    • heroku config | grep MONGODB_URI

    • Notice the value that appears after MONGODB_URI =>. This is your URI string. Copy it to a document for safekeeping.

  3. When you’re ready to connect Mongoose with your remote database, simply paste the URI string as the lone argument of your mongoose.connect() function. That’s it!

Built With

Author

nyt-cra's People

Contributors

rcowles3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.