← Back to blog

Silmarillions: Your Companion to Middle-earth's History

Introduction

My primary goal in developing this application was to help readers enjoy "The Silmarillion" by J.R.R. Tolkien with ease and enthusiasm. I recognized that many readers face frustration and confusion when trying to keep track of the complex web of characters and events within the story. To address this issue, I created a user-friendly tool to alleviate these challenges.

With this application, readers now have access to a comprehensive set of features that facilitate their immersion in the captivating world of Middle-earth. Gone are the days of feeling overwhelmed or lost while diving into the epic tale. Instead, readers can fully immerse themselves in the story and appreciate its richness and depth.

Another aspect I focused on was making the language and unique terminology used in "The Silmarillion" more approachable. By incorporating a glossary and explanatory notes, readers can now easily grasp and appreciate the intricate language crafted by Tolkien. This ensures a smoother and more enjoyable reading experience, enabling readers to delve deeper into the narrative without feeling hindered by unfamiliar terms.

Additionally, to enhance the overall experience, I included an interactive map within the application. This visual representation of the geography of Middle-earth serves as a valuable resource, allowing readers to explore and better understand the various landscapes featured in the story. Through this feature, readers can form a stronger connection with the narrative and its settings, immersing themselves further into the captivating world crafted by Tolkien.

Requirement Gathering

Functional Requirements:

  • Character Database: Create a comprehensive database to track and display information about the various characters in "The Silmarillion," including their profiles, relationships, and genealogies.
  • Interactive Map: Develop an interactive map that allows users to explore the different locations and realms in Middle-earth, providing additional details and context for each place.
  • Timeline and Events: Implement a timeline feature that presents the chronological sequence of events in the book, enabling users to understand the historical progression and significant milestones.
  • Glossary and Explanations: Include a glossary with definitions and explanations for the unique terms, names, and concepts used in "The Silmarillion" to aid readers in understanding the intricate language and mythology.
  • Bookmarks and Notes: Enable users to bookmark favorite passages, take personal notes, and highlight important sections to create a personalized reading experience.

Non-Functional Requirements:

  • User-Friendly Interface: Design an intuitive and visually appealing user interface that allows easy navigation and seamless access to various features of the application.
  • Performance and Responsiveness: Ensure the application performs efficiently, providing quick response times when retrieving and displaying information to maintain a smooth and responsive user experience.
  • Compatibility: Develop the application to be compatible with multiple platforms, such as web browsers and mobile devices, to maximize accessibility and reach a wider audience.
  • Security: Implement robust security measures to protect user data and ensure privacy throughout the application, including secure user authentication and encryption of sensitive information.
  • Scalability: Build the application with the capability to handle a growing user base and accommodate future updates and enhancements without compromising performance or stability.

Constraints:

  • Content Limitations: The application will rely on the information available within "The Silmarillion" and related authorized sources, respecting the intellectual property and copyright restrictions [1].
  • Device and Platform Limitations: The application's functionality may be constrained by the capabilities and limitations of the devices and platforms it supports, requiring compatibility considerations during development.
  • Resource Constraints: The project may face constraints in terms of time, budget, and available resources, requiring efficient project management and prioritization of features and functionalities.

Existing Systems

During the requirement gathering phase, an analysis of existing systems and resources related to "The Silmarillion" was conducted to identify any available solutions or tools that could address the challenges faced by readers. However, it was found that no comprehensive application or platform specifically dedicated to aiding readers of "The Silmarillion" currently existed. While there are various websites, forums, and fan-made guides available that provide partial information and insights, none offered a cohesive and integrated solution to track characters, provide explanations, and visualize the world of Middle-earth. Therefore, the development of a new application was deemed necessary to fulfill the unmet needs of readers and enhance their experience when engaging with the complexities of "The Silmarillion."

System Architecture

Features

Character Database: Access a comprehensive character database that offers detailed information, relationships, and genealogies, allowing readers to delve deeper into the lives of the legendary figures within the Silmarillion.

Character details

Search and find characters

Extensive Glossary and Explanations: Enhance comprehension of the intricate language and mythology with a detailed glossary and explanations, ensuring readers grasp the nuances and significance of the Silmarillion's unique terms and concepts.

Interactive Maps: Explore the captivating landscapes and realms of Middle-earth through interactive maps, gaining a visual understanding of the diverse settings and their significance to the story.

Immersive Reading Experience: Immerse yourself in the world of the Silmarillion with an app that seamlessly integrates these features, providing a captivating and immersive reading experience that brings Tolkien's masterpiece to life.

Notes Feature: Introduce a note-taking feature that allows readers to jot down their thoughts, reflections, and insights as they progress through the Silmarillion. This feature enables users to create personalized annotations and easily refer back to their own observations during their reading journey.

Add new notes

Update added notes

Location Database: Expand the app to include a comprehensive location database, providing detailed information and descriptions of the various settings and realms in the Silmarillion. Users can explore the significance of each location and its role in the unfolding narrative.

Personalization Options: Personalize your reading experience by bookmarking favorite passages, taking notes, and highlighting important sections, allowing readers to create their own connections and reflections.

Timeline Visualization (in-progress): Follow the epic history of Middle-earth with a chronological timeline feature, providing a clear overview of the significant events and their chronological order.

Implementation

The implementation of the Silmarillions.com app involves a multi-tier architecture, utilizing various technologies to create a seamless and immersive reading experience.

For data extraction, a Python project using the BeautifulSoup library can be developed. This project would scrape relevant information from authorized sources, including character details, location descriptions, timelines, and glossary entries. The scraped data would then be processed and stored in a MongoDB database.

typescript
from bs4 import BeautifulSoup
import urllib.request
import requests
import json
file1 = open("characters.txt", "r")
Lines = file1.readlines()
count = 0
# Strips the newline character
for line in Lines:
name = line.strip()
print(name)
count = count+1
# setting URL destination
url = "http://www.tolkiengateway.net/wiki/" + name
# retrieving HTML payload from the website
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
info = soup.findAll("table", {"cellpadding": "4"})
// code to extract the details from htmle elemants
a_dictionary = {
"name" : name,
"Siblings" : Siblings,
"other_names" : other_names,
"position" : position,
"Location" : Location,
"Affiliation" : Affiliation,
"Spouse" : Spouse,
"Gender" : Gender,
"Eye_color" : Eye_color,
"Clothing" : Clothing,
"Notable_for" : Notable_for,
"House" : House,
"Parentage" : Parentage,
"Language" : Language,
"Death" : Death,
"Birth" : Birth,
"Height" : Height,
"Children" : Children,
"attributes":attributes,
"history":history,
}
genofile = open("Genealogy/" + name + ".txt", "w")
genofile.write(str(Genealogy))
with open("data.json", "r+", encoding='utf-8', errors='replace') as file:
data = json.load(file)
data.append(a_dictionary)
file.seek(0)
json.dump(data, file)

Sample JSON character data

json
{
"name":"Galadriel",
"Siblings":"Finrod, Angrod and Aegnor",
"other_names":"Artanis (Q, fn),Nerwen (Q, mn)Alat\u00e1riel (T, an)",
"position":null,
"Location":"Tirion, Doriath, Nargothrond",
"Affiliation":"White Council",
"Spouse":"Celeborn",
"Gender":"Female",
"Eye_color":null,
"Clothing":"White robes",
"Notable_for":null,
"House":"House of Finarfin",
"Parentage":"Finarfin and E\u00e4rwen",
"Language":"Quenya, Sindarin, Westron, and Silvan Elvish",
"Death":null,
"Birth":"Y.T. 1362[2] Tirion",
"Height":"6 feet, 4 inches (193cm)[4][note 1]",
"Children":"Celebr\u00edan (Amroth[3], earlier version)",
"attributes":"",
"history":""
},

The backend of the app can be built using Node.js, providing a robust and scalable server-side framework. The Node backend would handle the logic and data retrieval from the MongoDB database, serving the necessary information to the frontend upon request. Additionally, the backend can implement authentication and user management functionalities for personalized features such as bookmarking and note-taking.

Main server code

typescript
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const characters = require("./routes/characters.routes");
const chapters = require("./routes/chapters.routes");
const locations = require("./routes/locations.routes");
const upload = require("./routes/upload.routes");
const app = express();
app.use(cors());
var http = require("http");
var server = http.Server(app);
// Set up mongoose connection
const mongoose = require("mongoose");
let dev_db_url = "mongourl"
const mongoDB = process.env.MONGODB_URI || dev_db_url;
mongoose.connect(mongoDB);
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use("/upload", upload);
app.use("/characters", characters);
app.use("/chapters", chapters);
app.use("/locations", locations);
const PORT = process.env.PORT || 5005;
server.listen(PORT, () => {
console.log("Server is up and running on port numner " + PORT);
});

Character route

typescript
const express = require("express");
const router = express.Router();
const characters_controller = require("../controllers/characters");
router.get("/all", characters_controller.all);
router.post("/getCharacter", characters_controller.getCharacter);
router.post("/findCharacter", characters_controller.findCharacter);
router.post("/updateCharacter", characters_controller.updateCharacter);
module.exports = router;

Character controller

typescript
const Characters = require("../models/characters.model");
exports.test = function (req, res) {
res.send("Greetings from the Test controller!");
};
exports.all = function (req, res) {
Characters.find({}, function (err, result) {
if (err) {
res.send(err);
} else {
res.send(result);
}
});
};
exports.getCharacter = function (req, res) {
Characters.find({ _id: req.body.characterid }, function (err, result) {
if (err) {
res.send(err);
} else {
res.send(result);
}
});
};
exports.findCharacter = function (req, res) {
let name = req.body.name;
Characters.find(
{ name: { $regex: name, $options: "i" } },
function (err, doc) {
if (err) {
res.send(err);
} else {
res.send(doc);
}
}
);
};
exports.updateCharacter = function (req, res) {
let character = {
name: name,
Siblings: Siblings,
other_names: other_names,
position: position,
Location: Location,
Affiliation: Affiliation,
Spouse: Spouse,
Gender: Gender,
Eye_color: Eye_color,
Clothing: Clothing,
Notable_for: Notable_for,
House: House,
Parentage: Parentage,
Language: Language,
Death: Death,
Birth: Birth,
Height: Height,
Children: Children,
attributes: attributes,
history: history,
};
Characters.findOneAndUpdate(
{ _id: req.body.characterid },
character,
{ overwrite: true },
function (err) {
if (err) {
return console.log(err);
}
res.send("chapter created successfully");
}
);
};

For the frontend, a React-based application can be developed to provide a dynamic and interactive user interface. React components would render the retrieved data from the backend, presenting information such as character profiles, interactive maps, timelines, glossary entries, and user-generated notes. The frontend can be designed to offer a visually appealing and intuitive experience, ensuring smooth navigation and responsiveness across different devices.

To facilitate communication between the frontend and backend, RESTful APIs can be implemented, allowing data exchange through standardized HTTP requests. This enables seamless integration between the user interface and backend functionality.

Overall, this implementation approach leverages Python's data extraction capabilities, MongoDB's data storage and retrieval, Node.js for the backend logic, and React for the interactive frontend, creating a comprehensive and immersive Silmarillions.com app for readers to explore the rich world of "The Silmarillion."

Challenges

  • Capturing and organizing a vast array of characters, locations, and events from the Silmarillion.
  • Deciphering and explaining the complex language and mythology in a concise and accessible manner.
  • Ensuring compatibility across multiple platforms and devices.
  • Balancing the provision of sufficient information without overwhelming the reader.
  • Researching and gathering data to create a comprehensive and accurate database.
  • Designing an intuitive and user-friendly interface for seamless navigation.
  • Meeting the expectations of both dedicated fans and newcomers to the Silmarillion.

Future Work

  • Integration of multimedia elements like artwork, audio narration, or video clips for a more immersive experience.
  • Expansion of the glossary and explanatory notes to provide even more in-depth information and references.
  • Collaboration with scholars and experts to ensure accuracy and credibility of the app's content.
  • Incorporation of social features such as discussion forums and sharing options to foster a community of Silmarillion enthusiasts.
  • Regular updates and expansions of the app's content to include newly discovered materials or expanded lore.
  • Enhancement of the app's user interface and navigation for improved usability.
  • Integration of additional features such as character quizzes, interactive storytelling, or guided reading paths to cater to different reading preferences.
  • Compatibility with emerging technologies and platforms to reach a wider audience.
  • Localization and translation options to make the app accessible to readers in different languages.

References

  • TolkienGateway - Tolkien Gateway (or simply TG) is a not-for-profit collaborative wiki devoted to the works of J.R.R. Tolkien

Enjoyed this post? Read the next one ↗