Travel Assistant API

A smart travel backend built with Node.js + Express that combines geolocation, weather forecasts, and facility information to help users plan trips based on their selected city and state.

Test API Endpoints

Click the buttons below to see example responses from each route.

πŸš€ Features
  • πŸ” Geolocation Search: Get latitude & longitude of a city using Open-Meteo's free geocoding API.
  • 🌦 Weather Forecast: Fetch 5-day daily max/min temperature forecasts using Open-Meteo’s weather API.
  • πŸ₯ Nearby Facilities & Landmarks: Uses OpenStreetMap Nominatim API to get nearby points of interest.
  • πŸ›‘οΈ Security & Rate Limiting: Prevents abuse with express-rate-limit and CORS configuration.
  • πŸ“¦ Organized API Structure: Express.js server with routes for /location-info, trip preferences, and static view.
View API Documentation

User Authentication & Profile API

Method Endpoint Protected? Description Body/Headers
POST /user/register No Register a new user
{
  "username": "yourname",
  "email": "your@email.com",
  "password": "yourpassword"
}
                            
POST /user/login No Login and receive JWT tokens
{
  "email": "your@email.com",
  "password": "yourpassword"
}
                            
GET /user/profile Yes Get the authenticated user's profile Headers:
Authorization: Bearer <access_token>
                            
POST /user/logout Yes Logout user (client should delete token) Headers:
Authorization: Bearer <access_token>
                            
POST /user/refresh-token No Get a new access token using a refresh token
{
  "refreshToken": "<refresh_token>"
}
                            

Note: All protected routes require a valid JWT access token in the Authorization header.