- Introduction
- Project Structure
- Installation
- Running the Project
- Available Scripts
- Configuration
- Dependencies
- Components
- Contexts
- Pages
- Routing
- Styling
- API
- License
WorldWise is a React application built with Vite. It provides a minimal setup to get React working in Vite with HMR and some ESLint rules. The project includes various components, contexts, and pages to manage and display city and country information.
.env.local
.eslintrc.json
.gitignore
biome.json
data/
cities.json
index.html
package.json
public/
README.md
src/
App.jsx
components/
AppNav.jsx
AppNav.module.css
BackButton.jsx
Button.jsx
Button.module.css
City.jsx
City.module.css
CityItem.jsx
CityItem.module.css
CityList.jsx
CityList.module.css
CityMap.jsx
CityMap.module.css
CountryItem.jsx
CountryItem.module.css
CountryList.jsx
...
contexts/
hooks/
index.css
main.jsx
pages/
vercel.json
vite.config.js
To install the project dependencies, run:
npm installTo start the development server, run:
npm run devdev: Starts the Vite development server.build: Builds the project for production.preview: Previews the production build.server: Starts a JSON server to serve thedata/cities.jsonfile.
The project uses Vite for configuration. The Vite configuration file is located at vite.config.js.
react: ^18.2.0react-dom: ^18.2.0react-router-dom: ^6.9.0json-server: ^0.17.3leaflet: ^1.9.3react-leaflet: ^4.2.1react-datepicker: ^4.11.0
@vitejs/plugin-react: ^3.1.0eslint: ^8.36.0eslint-config-react-app: ^7.0.1vite: ^4.2.0vite-plugin-eslint: ^1.8.1@types/react: ^18.0.28@types/react-dom: ^18.0.11@babel/plugin-proposal-private-property-in-object: ^7.21.11@biomejs/biome: 1.9.2
The components are located in the src/components directory. Some key components include:
CityCityListCountryListFormSpinnerFullPage
The contexts are located in the src/contexts directory. Key contexts include:
CitiesContextFakeAuthContext
The pages are located in the src/pages directory. Key pages include:
HomepageProductPricingLoginAppLayoutPageNotFoundProtectedRoute
The routing is managed using react-router-dom and is defined in the App component. Key routes include:
/: Homepage/product: Product page/pricing: Pricing page/login: Login page/app: Protected route with nested routes for cities, countries, and forms.
The project uses CSS modules for styling. The styles are located alongside their respective components in the src/components directory.
The project uses a JSON server to serve city data from the data/cities.json file. To start the JSON server, run:
npm run serverThis project is licensed under the MIT License.