Skip to content

Amir-mohammad-ahmady-1234/WorldWise-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Project Setup & Local Development

Prerequisites

Make sure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/your-repo.git
    cd your-repo
  2. Install dependencies:

    npm install

    or

    yarn install

Running the Project Locally

  1. run json-server :
npm run server

or

yarn server
  1. Start the Vite development server:
npm run dev

or

yarn dev
  1. After running the command, you should see an output like this:
VITE vX.X.X  ready in Xms
➜  Local:   http://localhost:5173/
➜  Network: use --host to expose

Open http://localhost:5173 in your browser to see the application running.

Setting Up the Fake API

This project uses a local JSON file (data/cities.json) as a mock API. To serve this file as an API:

  1. Install JSON Server (if not already installed):

    npm install -g json-server
  2. Start the JSON Server:

    json-server --watch data/cities.json --port 3001

    This will start a local API server at:

    http://localhost:3001/cities
  3. You can now make API requests:

Build for Production

To create a production-ready build, run:

npm run build

or

yarn build

This will generate a dist/ folder with optimized assets.


Now you're all set! 🚀 Happy coding!