Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e674ff9
added auth.js+User.js+userRoutes.js and setup MongoDB+.env
SaraEnderborg Feb 18, 2026
6ad1c63
Removed username auth, use email login, and verify MongoDB connection
SaraEnderborg Feb 19, 2026
81e1887
Configure frontend env variable and ignore build output
SaraEnderborg Feb 19, 2026
6fe85f6
Add Netlify config for Vite frontend
SaraEnderborg Feb 19, 2026
6a73974
"Add Netlify config for Vite frontend"
SaraEnderborg Feb 19, 2026
dd1ad4a
feat(auth): add FormField and login and signup forms
SaraEnderborg Feb 20, 2026
a36ef63
add project skeleton with router, zustand store, and react query
SaraEnderborg Feb 20, 2026
ca0bbd3
added Layer and Event Schemas
SaraEnderborg Feb 25, 2026
cc2c5a8
feat: add layer seeding, event schema, and auth store
SaraEnderborg Feb 25, 2026
0eb485b
refactor: move to feature-based backend architecture (layers, db, int…
SaraEnderborg Feb 25, 2026
6e2ced4
feat: add Wikidata import pipeline for war and medicine layers
SaraEnderborg Feb 26, 2026
c178049
medicine query debugged
SaraEnderborg Feb 27, 2026
7120502
feat: add frontend timeline with layer comparison
SaraEnderborg Feb 27, 2026
3c5248b
feat(timeline): add pixel-based clustering with explode interaction
SaraEnderborg Feb 27, 2026
a4ddac5
feat(timeline): add pixel-based clustering with explode interaction
SaraEnderborg Feb 27, 2026
41e4a12
feat(medicine): split import into 6 category-specific Wikidata queries
SaraEnderborg Mar 2, 2026
c57df40
feat(war): split import to 5 category-specific Wikidata queries
SaraEnderborg Mar 2, 2026
10c9d02
fix(medicine): dedupe imported events by wikidataQid
SaraEnderborg Mar 2, 2026
7bc1fd9
"chore(import): continue medicine import when a category fails"
SaraEnderborg Mar 2, 2026
f929e3c
refactor(import): unify query structure and stabilize import jobs
SaraEnderborg Mar 4, 2026
e5c8077
feat: add responsive sidebar navigation and improve timeline positioning
SaraEnderborg Mar 4, 2026
9662a29
Improve timeline responsiveness, accessibility, and add project README
SaraEnderborg Mar 4, 2026
a05264a
feat: refactor timeline controls and improve timeline layout
SaraEnderborg Mar 4, 2026
213a34f
feat(timeline): implement saved timelines
SaraEnderborg Mar 5, 2026
ee72024
feat(ui): add sidebar timeline controls and improve layout
SaraEnderborg Mar 5, 2026
f633371
feat(timeline): add visual zoom and synchronized year axis scrolling
SaraEnderborg Mar 5, 2026
420a7ac
feat(auth): add login and register pages with forms
SaraEnderborg Mar 5, 2026
65c1ad3
feat: add Technology & Inventions timeline layer
SaraEnderborg Mar 6, 2026
24f9354
fix: improve timeline scroll sync and UI styling
SaraEnderborg Mar 6, 2026
dcebce8
Improve accessibility, sidebar drawer behavior, and year axis label p…
SaraEnderborg Mar 6, 2026
7f5f8f2
Improve accessibility: increase event dot touch targets and fix timel…
SaraEnderborg Mar 6, 2026
08c5a02
deleted svgs.
SaraEnderborg Mar 8, 2026
bc3775b
feat(ui): add Chronos timeline favicon
SaraEnderborg Mar 8, 2026
9890c45
refactor: rename wikidata mappers folder to utils and update import p…
SaraEnderborg Mar 8, 2026
2864b85
"feat: add event cluster modal - improves UX when events overlap
SaraEnderborg Mar 8, 2026
7bb5dd3
"fix: increase event number font size for better accessibility
SaraEnderborg Mar 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
.env.production.local

build
frontend/dist

npm-debug.log*
yarn-debug.log*
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"postman.settings.dotenv-detection-notification-visibility": false
}
356 changes: 349 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,355 @@
# Final Project
# Chronos — Visual History Timeline

Replace this readme with your own information about your project.
A full-stack interactive history analysis tool that allows users to explore and compare historical events across multiple timelines.

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
Tech stack:
React • Node.js • Express • MongoDB • React Query • Zustand

## The problem
# Chronos — Visual History Timeline

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
Chronos is a visual history analysis tool that allows users to explore and compare historical events across multiple domains using interactive timelines.

## View it live
The application makes it possible to place different historical processes on parallel timelines (for example war, medicine, or political change) in order to explore patterns, overlaps, and historical context.

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
The project was built as a full-stack application using React, Node.js, Express, and MongoDB.

---

# Features

- Interactive timeline visualization
- Multiple timeline layers that can be compared
- Category filtering for each layer
- Event clustering when events occur close in time
- Event detail panel
- User authentication (signup/login)
- Data imported automatically from Wikidata
- Responsive design (mobile → desktop)
- Accessible interface with keyboard navigation

Example comparison:

War timeline vs Medicine timeline

This makes it easier to explore relationships between historical developments across domains.

---

# Tech Stack

## Frontend

- React
- React Router
- React Query
- Zustand (global state)
- Vite

## Backend

- Node.js
- Express

## Database

- MongoDB
- Mongoose

## External Data

- Wikidata SPARQL API

---

# Architecture Overview

The project follows a **feature-based architecture**.

Instead of organizing files only by type, code is grouped by functionality.

Example:

frontend/src/features/

layers → fetching layer data
timeline → timeline UI and visualization

This structure improves scalability and maintainability.

---

# Project Structure

## Backend

backend/

api/layers
integrations/wikidata
jobs/import
models
routes
middleware

Important files:

server.js → Express server
Event.js → timeline event model
Layer.js → timeline layer model
User.js → authentication model

---

## Frontend

frontend/src/

api/ → HTTP client and query keys
app/ → router + React Query client
features/ → feature-based modules
components/ → shared components
layouts/ → layout system
pages/ → main application pages
stores/ → Zustand global state

Example feature module:

features/timeline/

TimelinePage.jsx
TimelineRow.jsx
EventDot.jsx
YearAxis.jsx
EventPanel.jsx

---

# Data Model

## Layer

Represents a domain timeline.

Example:

War & Organized Violence
Medicine & Disease

Fields:

name
slug
categories
rangeStart
rangeEnd

---

## Event

Represents a historical event.

Fields:

layerId
title
summary
startDate
endDate
category
tags
location
sources
externalIds.wikidataQid
lastSyncedAt

---

# API Endpoints

GET /api/layers

Returns available timeline layers.

GET /api/layers/:id/events

Returns events for a specific layer.

Optional query parameters:

category
from
to

Example:

/api/layers/war/events?category=civil_war

---

# Wikidata Import System

Historical events are imported from Wikidata using SPARQL queries.

Each domain has its own import job.

Example jobs:

war.job.js
medicine.job.js

Import pipeline:

SPARQL query
→ map results
→ deduplicate by Wikidata QID
→ upsert into MongoDB

Example command:

node jobs/import/war.job.js --dry-run

Dry run allows testing the import without writing to the database.

---

# Timeline System

Events are rendered as dots on a horizontal timeline.

The position is calculated using a helper function:

dateToPercent()

This converts event dates into positions on the timeline.

Events close in time are automatically grouped into clusters.

Clicking a cluster expands it to reveal individual events.

---

# Authentication

User authentication is implemented with:

- email + password
- protected routes
- JWT authentication
- Zustand auth state

Authenticated users can access the main application area.

---

# Responsive Design

The application is designed mobile-first and works on screens between:

320px → 1600px

Mobile improvements include:

- wrapped layer selector
- touch-friendly event dots
- flexible timeline layout

---

# Accessibility

Accessibility improvements include:

- semantic HTML elements
- keyboard-accessible timeline events
- focus states
- ARIA labels
- reduced motion support

The goal is to achieve a Lighthouse accessibility score of 100.

---

# Running the Project Locally

## 1. Clone repository

git clone https://github.com/your-username/chronos

---

## 2. Backend setup

cd backend

npm install

Create a .env file:

MONGO_URI=your-mongodb-uri
JWT_SECRET=your-secret

Run server:

npm run dev

---

## 3. Frontend setup

cd frontend

npm install

Run development server:

npm run dev

The frontend will typically run on:

http://localhost:5173

---

# Demo Walkthrough

1. Register a user account
2. Log in to the application
3. Select one or two timeline layers
4. Filter by category
5. Click events to open the detail panel
6. Expand clusters to inspect individual events
7. Compare historical patterns across domains

---

# Future Improvements

Possible future improvements include:

- timeline zoom and custom year ranges
- smoother timeline animations
- improved clustering algorithm
- additional timeline layers
- saved timeline comparisons
- user annotations

---

# Learning Goals

This project was built to explore:

- full-stack application architecture
- data visualization with React
- working with external data APIs
- designing scalable frontend structure
- building accessible interfaces

---

# Author

Sara Enderborg

Chronos combines historical analysis with interactive data visualization to explore patterns across time.
10 changes: 5 additions & 5 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Backend part of Final Project
# Backend

This project includes the packages and babel setup for an express server, and is just meant to make things a little simpler to get up and running with.
Node.js + Express API for the Chronos timeline application.

## Getting Started
Run locally:

1. Install the required dependencies using `npm install`.
2. Start the development server using `npm run dev`.
npm install
npm run dev
Loading