Thursday 27 August 2020

What are my options for a crossword puzzle project I'm working on?

I'm working on a small application so that me and my family can do crossword puzzles together as we're now all living far apart. I need help thinking through some decisions. I built a web scraper to get crossword data in the format:{ across: [ { clue: "xxx" length: 5 cell#: 3 } ... ] down: {...} } But I'm not sure how I'm going to build this out. Some things I want for the application:1) I don't want any log-in username/password stuff. I just want my family to be able to go to the website, and their first time on it'll ask for their first name. Every time after it'll just remember their name. I do want some kind of database to map user/name to a recorded answer. Everyone playing can see the answers that other players recorded with each person getting their own color to differentiate.2) What's the best way to store the crossword data? I have a few different thoughts in my head. Should I store that entire object above , and just recreate the crossword puzzle with people's responses? Where would I even store an object like that? Can it go into a SQL database? Is it possible to pre-render the HTML page of just the crossword puzzle since the DOM elements will always be the same but just fill it in with user's answers? If so, what's the best way of storing a pre-rendered html page?3) It's a pretty simple application. My backend is nodejs but not sure what's my best frontend option. I'm used to working the SPA frameworks like angular, react, etc. But would something like this make more sense to use a templating engine and just serving all the HTML/JS/CSS files from the backend?Here's currently what I'm thinking: User goes to www.example.com for the first time. Backend will receive request, see no cookie has been set, and delivers the page asking user for firstname. User enters firstname and submits. Request comes to backend, backend will get the cached HTML page of just the latest crossword and clues, query the database for any response to the latest crossword and layer that on top of the cached HTML page. An express-session will be created for the user and the associated name will be attached to it, possible also stored in DB? Cookie will be attached to server response.Does that all make sense?

Submitted August 27, 2020 at 02:29PM by ididntwin

No comments:

Post a Comment