Giter VIP home page Giter VIP logo

wiki-reader's People

Contributors

cephalonscientia avatar

Stargazers

 avatar

Watchers

 avatar

wiki-reader's Issues

I18n and L10n

Support internationalization of this app through i18next or other i18n libraries. Might need to do some tinkering because the library is in JS not TS. For localization, may integrate Phrase into the development stack.

Implement basic theme switcher

Implement a theme switcher button that follows the user's scroll bar. Take advantage of TailwindCSS's dark variant when designing this feature (https://tailwindcss.com/docs/dark-mode).

  • Should first respect the user's system preferences
  • If user decides to switch theme, remember this setting for future browser sessions and every time user visits the site
    • May have to use cookies or Web Storage API
    • If users can be uniquely identified and want a consistent experience across multiple platforms, we may have to add an authentication system that stores user preferences in a database
  • Transition between themes should not be instant, apply an ease timing function (non-linear) so user's eyes can adjust
  • Button should not interfere with the readability of article content (add a sidebar or toolbar?)
  • Button should be available regardless of where the user is on the page

Hook up MongoDB connection

Eventually, we would not solely depend on MediaWiki's Action API to fetch article content from wikis. There are three main reasons for doing so:

  • So the app does not get blocked because of too many API requests
  • Performance benefits for storing data on the edge
  • To create a historical archive of article content

To achieve this, a database connection needs to be established to store cached versions of article content to be sent to the client. MongoDB is the preferred NoSQL database system to store document data like API calls that return a JSON response. For security reasons, the database connection string and other secrets should be stored in an environment file that will be ignored by Git.

Explore containerization

Research whether or not app containerization is appropriate for this project. Some benefits of containerizations are:

  • Project portability regardless of cloud platform or operating system
  • Quicker CI/CD turnaround
  • High scalability
  • Decoupling application from host system for better security
    It may be done through Docker and Kubernetes.

Set up continuous integration and deployment

Eventually, the web app will be hosted and deployed onto the cloud so there needs to be CI/CD process set up to build, test, and deploy the app. Likely would use GitHub Actions to facilitate CD but still debating on what cloud service to use (stuck between AWS and GCP). Unsure if containerization is appropriate for this project.

See https://v3.nuxtjs.org/docs/deployment/presets/ for deployment options. Nuxt.js projects can be deployed on serverless platforms, relying on edge computing to serve users. GitHub Pages may be a good start for app deployment as a static page https://nuxtjs.org/deployments/github-pages.

Implement environment variables

Web app should be able to choose which MediaWiki-based wiki to fetch article content from. We do not want to hard-code wiki endpoints within the business logic and views for flexibility. For now, on project build, the wiki chosen will be set in stone. If you want to change the wiki then you have to update the config and rebuild the app.

The following endpoints from the wiki's Special:Version page (e.g. https://en.wikipedia.org/wiki/Special:Version) must be stored as environment variables to enable this functionality:

  • WIKI_ENDPOINT - Wiki endpoint (e.g. https://en.wikipedia.org)
  • ARTICLE_PATH - Article path (e.g. /wiki/)
  • ACTION_API - API path (e.g. /w/api.php)
  • WIKI_NAME - Wiki name (e.g. English Wikipedia)
  • WIKI_SKIN - Wiki skin path (e.g. /wiki/MediaWiki:Common.css)

Environment variables should be stored in a new .env file at the root project directory that should be added to .gitignore.

See the following on implementing environment variables:

Define a build script

Describe the solution you'd like
Write a shell script that builds project from src to lib folder, taking into account Tailwind CSS and transpiling TypeScript to JS. Running the command npm start should also build lib/stylesheets/output.css based on src/stylesheets/input.css.

Implement basic app functionality

The main feature of this app is to fetch article content from MediaWiki-based wikis through MediaWiki's API. Clients should be able to search an article name (case insensitive) and have the article content be rendered on the webpage. There will be no server-side caching of these article contents for MVP release.

The end goal is to create a wiki reader boilerplate app that can be customized for branding needs.

Support TypeScript workflow

Configure project to use TypeScript in place of JS for static typing and stricter programming discipline. See https://typescript.nuxtjs.org/guide/introduction

Includes all Vue components, tests, and nuxt.config.js.

Linter should also be configured to scan and lint .ts files.


Since Webpack does not compile nuxt.config.js, any environment runtime variables defined in the config will not be initialized and hence cannot be used by TS scripts at runtime.

TS2339: Property '$config' does not exist on type '{ components: { Header: {}; Navbar: {}; Article: {}; Footer: {}; }; mounted(): void; }'.

To solve this issue, TypeScript runtime wrapper needs to be installed (https://typescript.nuxtjs.org/guide/runtime/) to register ts-node before Webpack compiles any TS files to JS.

npm install @nuxt/typescript-runtime --save

Hook up middleware to communicate with MediaWiki's Action API

Whenever the user submits a request with the name of an article (case insensitive), an API wrapper should be called to communicate with MediaWiki's Action API and return the article contents (if available) back to the user. If no article name matches what the user inputted, then just return a simple "No article found" message back to the user.

Eventually, we can extend this functionality to allow for web caching of article content to lower the number of direct API requests.

See https://socket.io/docs/v4/ and https://nuxt-socket-io.netlify.app/ for a possible tool that can help with developing this middleware.

Hook up TailwindCSS

Install TailwindCSS and add a new folder called styles to store CSS files. Issue is completed if TailwindCSS classes can be used in views. Blocked by issue #2 since Tailwind directives need to be resolved and compiled when app is being built.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.