This project demonstrates a simple application using Node.js, NeDB, React.js with TypeScript, and the OpenRouteService API. The application allows users to add, delete, and organize destinations, and calculates the distance and travel time between points using the OpenRouteService API.
The project is divided into two main parts:
- Backend: Node.js server with NeDB for data storage.
- Frontend: React.js application with TypeScript.
-
Navigate to the Backend Directory
cd backend
-
Install Dependencies
npm install
-
Start the Server
For development:
npx nodemon
The server will run on
http://localhost:5000
.
-
Navigate to the Frontend Directory
cd frontend
-
Install Dependencies
npm install
-
Start the React Application
npm start
The React app will run on
http://localhost:3000
.
The project includes a free OpenRouteService API key with usage limits. If you exceed the free plan's limits or need additional features, you can obtain your own API key by creating an account at OpenRouteService. To use your own API key, set it in the backend configuration file (e.g., .env
).
OPENROUTESERVICE_API_KEY=your_api_key_here
-
Start the Backend Server
Open a terminal, navigate to the
backend
directory, and run:npx nodemon
This starts the server in development mode, watching for changes.
-
Start the Frontend Application
Open another terminal, navigate to the
frontend
directory, and run:npm start
This will start the React development server.
-
Access the Application
Open your web browser and navigate to
http://localhost:3000
to view the application.