Giter VIP home page Giter VIP logo

code-challenge-p2-wk-2's Introduction

๐Ÿค– Bot Battlr Web App

Bot Battlr web app shows the galactic overlord a web app that will allow them to browse through a list of robots, view a robot's details, and, enlist a bot into their army.

Table of Contents

๐Ÿš€ Getting started

Before proceeding, make sure to download or to clone the project files onto your machine in order to run the project.

GIT

To clone this repo ensure you have Git installed onto your local machine.

To check if git is already installed, run this command in your terminal:

git --version

Using https

git clone https://github.com/Se7enseads/Bot-Battlr

Using SSH

To use SSH you first need to fork this repo onto your github account.

To fork this repo click the drop down button or arrow next to the name fork and then click on create a new fork or click this link to direct you to the forking page.

Click on Create Fork to fork.

Fork image

Fork page

After forking the repo, click on the drop down arrow next to the green code button, select the SSH option and copy the code provided.

SSH image

[email protected]:[Your-username]/[repo]

For more information about git you can checkout the git documentation.

Usage

To use the web app, the required files are need to have been downloaded or cloned. (Refer to the GIT section in Getting Started).

Setup

To run the app follow these steps:

  1. Open your file explorer or press Ctrl + E.

  2. Navigate to where you cloned the folder in this step.

  3. Right-click on the folder.

  4. Click on Open with Application and select Visual Studio Code.(The location of these buttons may vary depending on your Operating System)

  5. Open a new terminal by doing Ctrl + Shift + backtick or on the title bar select Terminal and the select New Terminal.

  6. A terminal should pop up from the bottom of the screen.

  7. Run the following command to install the dependencies needed to run the app and start the app:

npm install && npm run dev

install & start

  1. While holding Ctrl click on the blue link http://localhost:5173, this should open the web app on the default browser. You can copy the link and paste in your preferred browser.

Note: If there is something else running on port 5173 the program will automatically use another port another port e.g port 5174.

npm_dev_5174

JSON Server Setup

To run this challenge you will need a Mock API (Application Programming Interface) or Mock server to create an API to fetch/get data from.

To start using JSON Server, we need to install it.

Without closing the terminal, on the right side click the + icon on the top right of the terminal to create a new terminal.

Plus icon

  1. First check if NPM(Node Package Manager) is already installed:
npm -v

Make sure that the number displayed is greater than 9 or better is the latest. If so continue to step 2

Note: To download the latest version of npm, run the following command on the terminal:

npm install -g npm
  1. To start JSON Server, run the following command in the terminal in VSCode. In our case the [name].json is db.json and make sure the [name].db is in that directory.
json-server --watch src/data/db.json

When run, you'll see some messaging about how to access our JSON data. By default, JSON Server will start up on port 3000. You should see a notice that you can access the server at http://localhost:3000. Refer here if you encounter any errors.

JSON Server

For more information about JSON Server checkout their homepage.

Note : Leave the Terminal open for the server to continue running in the background

In the browser the page should look like this:

Bot Battlr App

Bot Army App

Note :

  • If you encounter any errors refer here.
  • Pressing the X on the terminal does not kill any process it just hides. To show the terminal press Ctrl + backtick

X Icon

โš  Common Errors

Npm Error

  1. This error signals that the npm command you run is not correct for the project it should be:
npm run dev
  1. If the website loads but the styling if off check if you have an ad-blocker (U-Block) or a network monitor that is blocking the styling.

  2. If the page loads without any data check the path the json server is watching or check if there is a db.json in the current directory.
    If this happens json server creates automatically default data and a db.json to go with it in that directory

Json Server Default

๐Ÿ“ License

Copyright ยฉ 2023 Kyle Mututo.
This project is MIT licensed.

๐Ÿ‘† Back to Top

code-challenge-p2-wk-2's People

Contributors

se7enseads 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.