Skip to content

Achintha-Dev/silver-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Silver Path

Local Tourist Day-Visit Planner and Information System

Academic Project | Faculty of Information Technology (BIT) | University of Moratuwa Student: Achintha Bandara | Registration No: E2320235


πŸ“Œ Overview

Silver Path is a full-stack MERN (MongoDB, Express, React, Node.js) web application built to promote local tourism in the Rideegama region, Sri Lanka.

It provides a centralized platform for discovering and managing tourist destinations within a 25 km radius. Users can explore locations, view detailed information, and plan efficient one-day visits.


🎯 Objectives

  • Centralized Information: Provide reliable and up-to-date tourist data
  • Interactive Map β€” Leaflet.js map with category markers and 25 km radius overlay
  • Efficient Planning: Enable users to explore destinations within a 25 km radius
  • Real Road Routing β€” OSRM integration for actual driving directions
  • Itinerary Support: Assist in one-day visit planning
  • Content Management: Allow admins to manage destinations securely

πŸ—οΈ System Architecture

The application follows MVC (Model-View-Controller) architecture:

  • Frontend: React.js SPA with Tailwind CSS
  • Backend: Node.js + Express.js REST API
  • Database: MongoDB Atlas
  • Authentication: JWT-based admin authentication
  • Media: Cloudinary for image storage

πŸ”„ System Flow

User/Admin β†’ React Frontend (Vite) β†’ Express.js REST API β†’ MongoDB Atlas ←→ Cloudinary (images) ←→ OSRM (road routing)


βš™οΈ Core Features

🧭 User Features

  • Browse and explore tourist destinations
  • Search and filter by category
  • View detailed information including description, facilities, and travel tips
  • Interactive map using Leaflet
  • One-day visit planning

πŸ” Admin Features

  • Secret URL key protection (hidden admin login page)
  • Secure login using JWT authentication
  • Add, update, and delete destinations with full CRUD
  • Upload and manage destination images

⚑ Technical Highlights

  • Geospatial validation within a 25 km radius
  • Responsive design for mobile and desktop
  • Dynamic data fetching and filtering

🧰 Tech Stack

Layer Technology
Frontend React 18, React Router DOM, Tailwind CSS, DaisyUI
UI Libraries React Icons, React Hot Toast, SweetAlert2
Maps Leaflet.js, React-Leaflet, OpenStreetMap, OSRM
Backend Node.js v18+, Express.js
Database MongoDB Atlas, Mongoose ODM
Authentication JWT (24h expiry), bcrypt.js (cost factor 10)
Media Storage Cloudinary, Multer, multer-storage-cloudinary
Security express-rate-limit, Admin access key middleware
Build Tool Vite

πŸš€ Installation and Setup

πŸ”§ Prerequisites

  • Node.js v18 or higher
  • MongoDB Atlas account
  • Cloudinary account

πŸ“ 1. Clone Repository

git clone https://github.com/Achintha-Dev/silver-path.git
cd SilverPath

πŸ” 2. Environment Variables

Create a .env file inside the /server directory:

PORT=5000
MONGO_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_jwt_secret_key
ADMIN_ACCESS_KEY=your_admin_secret_key
NODE_ENV=development
CLIENT_URL=http://localhost:5173

CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

You can use .env.example as a template.

▢️ 3. Run Backend

cd server
npm install
npm run dev

Server runs on: http://localhost:5000

▢️ 4. Seed Admin Account (First time only)

cd server
node src/config/seedAdmin.js

This creates the default admin account.

▢️ 5. Run Frontend

cd client
npm install
npm run dev

Frontend runs on: http://localhost:5173


πŸ”‘ Access Information

Tourist Interface

Admin Panel

⚠️ The admin login page is intentionally hidden. Visiting /admin/login without the correct ?key= parameter redirects to the home page for security.


πŸ“‚ Project Structure

silver-path/
β”œβ”€β”€ client/                   # React frontend (Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/           # Static assets (video background)
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/             # Admin components (Layout, GlassySelect)
β”‚   β”‚   β”‚   └── user/              # Tourist components
β”‚   β”‚   β”‚       β”œβ”€β”€ destinations/  # Destination list components
β”‚   β”‚   β”‚       β”œβ”€β”€ map/           # Map components
β”‚   β”‚   β”‚       └── planner/       # Planner + tab components
β”‚   β”‚   β”œβ”€β”€ hooks/            # Custom hooks (usePlannerStorage, useUserLocation)
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/        # Admin pages
β”‚   β”‚   β”‚   └── user/         # Tourist pages
β”‚   β”‚   └── utils/            # API client, distance calculations
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”‚
β”œβ”€β”€ server/                   # Express.js backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/           # DB connection, Cloudinary config, seedAdmin
β”‚   β”‚   β”œβ”€β”€ controllers/      # Route handlers
β”‚   β”‚   β”œβ”€β”€ middleware/       # Auth, admin access, rate limiter
β”‚   β”‚   β”œβ”€β”€ models/           # Mongoose schemas (Destination, Admin)
β”‚   β”‚   └── routes/           # API routes
β”‚   β”œβ”€β”€ server.js             # Entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ screenshots/              # Project screenshots
β”œβ”€β”€ README.md
└── .env.example

πŸ—ΊοΈ API Endpoints

Public Routes

Method Endpoint Description
GET /api/destinations Get all destinations (with filters)
GET /api/destinations/:id Get single destination
GET /api/destinations/:id/rating Get destination rating
POST /api/destinations/:id/rate Rate a destination
GET /api/auth/verify-access Verify admin secret key
POST /api/auth/login Admin login

Protected Routes (Admin)

Method Endpoint Description
POST /api/destinations Create destination
PUT /api/destinations/:id Update destination
DELETE /api/destinations/:id Delete destination
POST /api/destinations/:id/images Add images
POST /api/destinations/:id/images/delete Delete single image
GET /api/auth/me Get current admin
POST /api/auth/logout Logout

πŸ§ͺ Testing

Functional testing was performed using Postman for API endpoints and manual browser testing across Chrome, Firefox, Edge, and Safari.

Test coverage includes:

  • All CRUD operations for destinations
  • Image upload and deletion (Cloudinary sync)
  • Admin authentication and JWT validation
  • Secret key protection and rate limiting
  • Category and distance filtering
  • Visit planner route optimization
  • Star rating system
  • Responsive layout on mobile devices

πŸ“Έ Screenshots

Home Page

Home Page1 Home Page2 Home Page3 Home Page Mobile View

Destinations Page

Destinations Page1 Destinations Page2 Destinations Page Mobile View

Map View

Map View1 Map Page Mobile View

Plan Visit Page

Plan Visit Page

Admin Login Page

Admin Dashboard

Admin Dashboard

Admin Dashboard Admin Dashboard Mobile View

Admin Add Destination

Admin Add Destination Admin Add Destination Mobile View

Admin Edit Destination

Admin Dashboard


Author

Field Details
Name Achintha Bandara
Registration No E2320235
GitHub https://github.com/Achintha-Dev
Degree Program Bachelor of Information Technology (BIT)
University University of Moratuwa, Sri Lanka
Module ITE2953 - Programming Group Project 25S1

Live Demo

-- coming soon.


Badges

React Node.js Express MongoDB TailwindCSS Cloudinary Leaflet License

About

MERN app to plan day trips and explore tourist spots within 25 km of Rideegama, Sri Lanka.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages