Compare commits

..

4 Commits

Author SHA1 Message Date
baed9e901c Add home page content WIP 2022-08-10 00:20:31 +03:00
5aa7655839 Small style improvement on promote and demote buttons 2022-08-10 00:20:31 +03:00
430fe8d924 Customize app information, fix navigation accessibility bug and icon 2022-08-10 00:20:31 +03:00
0a2aa7ecce Switch to single-page vanilla React app, add PWA support
Story time

Too much time was spent trying to get Next.js to build the app
as a PWA. Maybe I've been trying to do this at an unlucky time
when something somewhere in the dependency stack leading up to
next-pwa is only temporarily broken.

At this point enough hours have been spent thorough the project
getting this or that and that to play nice with Next.js, and the
benefits to this project were at best questionable.

When next-pwa didn't deliver a PWA experience with the promised
"zero configuration" setup, and even failed to do so with a lot
of fiddling around and following several issue discussions in
its repo I thought back at all the other nuisances stemming from
trying to get Next.js to play nice in the app's context and
decided it was time for it to go.

Writing this frankenstein of a commit that forces the project
from its Next.js structure into more-or-less the structure of a
vanilla create-react-app project felt like a breeze compared to
any more time spent reading github issues lingering unanswered
or bumping into Stack Overflow threads from a time when none
of the answers are right any longer. Some top answers in Stack
Overflow don't even look like they were ever right.

I don't like the big component switch that I wrote to replace
the seemingly elegant app routing from Next.js. The new app
routing I wrote is a kludge designed to minimize the amount of
code fixes I'd need to do when it came to navigation, but I am
glad to no longer parse numbers out of URLs, put dynamic() calls
in nearly every page, use wrapper Link and Image components so
Next.js can do some magic and a few other problems that right
now I forget. I also appreciate the smaller bundle.

This isn't some content publishing app, full of meaningful URLs
to be shared over the net with other users. There's really only
the skeleton of the app with a few very simple views to navigate
to and then there's the local data generated by the user that the
app just hosts locally.
2022-08-10 00:20:31 +03:00
3 changed files with 26 additions and 45 deletions

10
TODO Normal file
View File

@ -0,0 +1,10 @@
1) Criar app com create-react-app
2) Remover lixo next-js
3) Substituir roteamento por estados
4) Garantir carregamento de service worker: https://web.dev/service-workers-registration/
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/service-worker.js');
});
}

View File

@ -73,12 +73,8 @@ i {
text-decoration: underline;
}
.link:visited {
color: purple;
}
.link:hover {
color: darkblue;
color: lightblue;
}
/* Page */

View File

@ -3,14 +3,14 @@ export function HomeView() {
<div className="page-with-padding content-text scroll">
<h1 className="text-title margin-title">Flash Card App</h1>
<p className="text-details margin-paragraph">
A handy tool for vocabulary practice through repetition. Go to{" "}
A handy tool for helping build vocabulary. Go to{" "}
<i>settings -&gt; create card</i> to start adding words for practicing.
Once you have a few go to practice and start from your daily words.
</p>
<h2 className="text-title margin-title">Privacy</h2>
<p className="text-details margin-paragraph">
The app requests data from Wiktionary when you create study cards. Their
privacy policy can be found{" "}
HTTPS requests are made to Wiktionary during the card creation process.
Their privacy policy can be found{" "}
<a
className="link"
target="_blank"
@ -19,23 +19,21 @@ export function HomeView() {
>
on this link
</a>
. Apart from the initial page load, this should be the only time any
data transfer happens during the usage of the app.
.
</p>
<p className="text-details margin-paragraph">
Once you save a card, it is stored on your own device and never
transmitted anywhere else.
The cards that you save are locally stored and never transmitted
anywhere else.
</p>
<h2 className="text-title margin-title">Licensing</h2>
<h2 className="text-title margin-title">Licenses</h2>
<p className="text-details margin-paragraph">
Human-readable summary:{" "}
Human-readable summary: You are free to use the app for any purposes.
You are free to modify and redistribute the app{" "}
<strong>
You are free to use the app for any purposes. You are free to modify
and redistribute the app as long as you grant your users access to the
source-code, content and assets you modify and redistribute under the
same terms listed below.{" "}
</strong>{" "}
As long as you follow those rules, you don't need to contact the
as long as you grant your users access to reused or modified
source-code, content and assets under the same terms listed below
</strong>
. As long as you follow those rules, you don't need to contact the
author(s) about it.
</p>
<p className="text-details margin-paragraph">
@ -66,6 +64,7 @@ export function HomeView() {
</a>
.
</p>
<p className="text-details margin-paragraph">
The rest of the application and its assets are licensed under the{" "}
<a
@ -78,18 +77,6 @@ export function HomeView() {
</a>
.
</p>
<p className="text-details margin-paragraph">
The official source code repository for this application can be found at{" "}
<a
className="link"
target="_blank"
rel="noreferrer"
href="https://git.studycardtool.org/tcoh/app"
>
git.studycardtool.org/tcoh/app
</a>
.
</p>
<h2 className="text-title margin-title">Support the app</h2>
<p className="text-details margin-paragraph">
This app would not exist if it was not for Wiktionary and the Wikimedia
@ -105,19 +92,7 @@ export function HomeView() {
. This app or its author is in no way affiliated with the Wikimedia
Foundation, it just makes use of its data.
</p>
<h2 className="text-title margin-title">Contributing</h2>
<p className="text-details margin-paragraph">
The main thing on the roadmap is improved language support for
vocabulary practice. The app still needs bugfixes, code and style
cleanup and potentially rethinking of some existing features.
Contributions introducing a need for smarter backend functionality than
a static file server are in principle unwelcome in this project.
</p>
<p className="text-details margin-paragraph">
There are a few pending tasks in server configuration and testing, but
once those are done local gitea registrations for contributors should
open and potentially federated accounts as well.
</p>
<p className="text-details margin-paragraph">TODO contact info</p>
</div>
);
}