Giter Site home page Giter Site logo

nodeapp's Introduction

csc648-fall17-team12

Instructions on how to test locally

These instructions assume you have MySQL Community Server and MySQL Workbench installed. If not: https://dev.mysql.com/doc/workbench/en/wb-installing.html

Setting up the database

  1. Open up MySQL Workbench and create a new connection if one is not already made.

    To do this, press the + next to MySQL Connections. Name the connection anything you like, and set the password if you had set one during configuring the installation. You can test the connection with the Test Connection button, then confirm by pressing OK.

  2. Connect to your server with the connection you have by clicking on it once.

  3. On the left, you should see a navigation box with Management, Instance, and Performance. At the bottom of the box, you can see Schemas. Click the little icon of two arrows facing away from each other to the right of Schemas.

    The box now shows you what databases (schemas) are in your server. There might be none now, but that's okay.

  4. Now we can create a new database for our server.

    Right click the navigation box and select Create Schema...

    Name it anything, for example test, then click Apply. You'll get a pop up to review the code that actually creates the database. You can simply press Apply once more.

  5. Next, we are going to create tables with the given .sql files located in our nodeApp folder in the files that you cloned from GitHub.

    Up at the top navigation bar with File, Edit, etc., go to Server and click Data Import.

    Select the option, Import from Self-Contained File and then click the icon with the ''..." on the right to navigate to the nodeApp folder with the .sql files, listings.sql and t_user.sql.

    After selecting one of the files, below where you clicked Import from Self-Contained File, you can select a Default Target Schema. In this case, it is the database that you created earlier.

  6. Repeat the process for the other .sql file.

  7. You are finished setting up the database! From now on, all you need to remember is how to import .sql files for future testing.

Changing the server.js file

  1. Open up the server.js file in the nodeApp folder.

  2. On line 26 and 27, you'll see

    password : '',
    
    database : 'test',

    Change 'test' to whatever you named your database earlier on, and set the password if you have one on your server.

Testing the search

  1. Open up your terminal and navigate to the folder with the server.js file in it and run it.

    node server.js
    
  2. Open up a browser and do localhost:3000 for the url.

  3. Try out the search. If you type in Mas Banyar in user search, you should get similar names that start with Mas. In listings search, type in San Francisco and you should also get similar cities that start with San.

    Note that the search only works if you press the button. Don't press enter in the search bar! We'll get around to implementing that.

    โ€‹

nodeapp's People

Contributors

arthemg avatar asouza88 avatar dahoang avatar sfsudemo avatar jasoncromer avatar csc648848instr avatar

Watchers

James Cloos avatar  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.