A full-stack Travel Destination Log Application built from scratch. This app includes a custom RESTful API server using Node.js and Express, connected to a MySQL database with image upload support, and a user-friendly frontend interface.
- β A Node.js & Express powered REST API with full CRUD operations
- β Image upload support (multiple images per destination)
- β Endpoints to create, read, update, and delete travel logs
- β
A professional frontend UI that:
- Displays all destinations with travel date
- Shows photos with left-right preview navigation
- β Tested API endpoints manually using cURL for robust validation
- Backend: Node.js, Express, MySQL (
mysql2/promise) - Frontend: HTML, CSS, JavaScript
- Image Handling: Multer
- Testing: Jest, Supertest, Keploy
- CI/CD: GitHub Actions
- Docs: Swagger UI
- Node.js (v16+)
- MySQL server
- Docker (optional)
git clone https://github.com/anuskagithub/TravelDestinationLog.git
cd TravelDestinationLog
npm installsql
CREATE DATABASE travel_db;
USE travel_db;
CREATE TABLE destinations (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
location VARCHAR(255),
description TEXT,
date DATE,
images TEXT
);
π Backend API Server
| Method | Endpoint | Description |
|---|---|---|
| GET | /destinations |
List all destinations |
| GET | /destinations/:id |
Get a single destination by ID |
| POST | /destinations |
Add a new destination (with images) |
| PUT | /destinations/:id |
Update a destination |
| DELETE | /destinations/:id |
Delete destination by ID |
| DELETE | /destinations |
Delete all destinations |
bash
curl -X POST http://localhost:8080/api/destinations \
-F "name=Paris" \
-F "location=France" \
-F "description=City of Light" \
-F "date=2025-07-01" \
-F "images=@/path/to/photo1.jpg" \
-F "images=@/path/to/photo2.jpg"
bash
# Get all
curl http://localhost:8080/api/destinations
# Get by ID
curl http://localhost:8080/api/destinations/43
bash
curl -X PUT http://localhost:8080/api/destinations/3 \
-H "Content-Type: application/json" \
-d '{
"name": "London",
"location": "UK",
"description": "City of History",
"date": "2025-08-15"
}'
bash
# Delete by ID
curl -X DELETE http://localhost:8080/api/destinations/42
# Delete all
curl -X DELETE http://localhost:8080/api/destinations
- β Unit tests for service logic (mocked DB)
- β Integration tests for controller + DB + routes
- β API endpoint tests using Supertest
- β Edge case validation (missing fields, invalid IDs)
- β File upload & cleanup tests for images
| Metric | Percentage |
|---|---|
| Statements | 85.85% |
| Branches | 86.11% |
| Functions | 92.85% |
| Lines | 86.45% |
π Coverage is measured using jest --coverage
bash
keploy record \
-c "docker run -p 3000:3000 -e PORT=3000 --name travel-api-container --network keploy-network travel-api" \
--container-name "travel-api-container" \
--path ./keploy-test-data \
--record-timer 1m \
--build-delay 30
Make API requests (via Postman, browser, curl) during the record time.
bash
keploy test \
--path ./keploy-test-data \
--container-name travel-api-container
π .github/workflows/keploy-test.yml
yaml
name: Keploy API Testing
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
keploy-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Set up Keploy CLI
run: |
curl -sL https://dl.keploy.io/install.sh | bash
echo "$HOME/.keploy/bin" >> $GITHUB_PATH
- name: Build Docker image
run: docker build -t travel-api .
- name: Create Docker network
run: docker network create keploy-network
- name: Run container
run: |
docker run -d -p 3000:3000 --name travel-api-container \
--network keploy-network -e PORT=3000 travel-api
sleep 10
- name: Run Keploy Tests
run: |
keploy test --path ./keploy-test-data --container-name travel-api-container
bash
docker build -t travel-api .
docker run -p 3000:3000 --name travel-api-container --network keploy-network travel-api
bash
docker-compose up

