Giter Club home page Giter Club logo

Softweng project

This project was developed for the Softweng MSE master at HES-SO. It's a small blog made with Vuepress automatically built with github actions on push.

You can check it out here!

Technologies

The purpose of the project was to familiarize with frontend framework technologies like Vue/React or other. I chose to go on using Vuepress to build the blog. As such, we use:

  • Vuejs
  • Vuex
  • Vuepress

As main technologies.

Building

In order to play with this:

  1. Clone this repository and cd in it
  2. Run npm install to install all dependencies as well as npm i -g vuepress to load the vuepress builder
  3. Run npm run dev to start the blog locally on your machine

Running in docker

If you want to run this small site in docker, do the following:

  1. Run docker build --tag vpovesco:1.0 . to build an image from the given dockerfile
  2. Run docker run -p 8080:8080 -d vpovesco:1.0 to run it on port 8080

It internally uses live-server which is not the best choice to expose a website, but it works for a proof-of-concept.

Running tests

A small test suite was developed to check the behavior of the Vuex store, you can run it with npm test. It's built using Jest and babel-jest for transpilation.

Something cool about this blog

Every visitor can have his own set of favorite article. When on an article simply click the heart button which will add it to vuex and automatically persist it to local storage using vuex-persist, a plugin for Vuex.

Difficulties encountered

Vuepress is quite tough to get started with. Theming is complex and extending an existing theme is more complex than it seems. Loading external libraries like Vuex is also troublesome and doesn't follow the standard registration flow. But all in all it was a nice experiment.

Making vuex persist work with SSR

Vuepress couldn't build the project because we're using window.localStorage in the store to persist it automatically. In order for everything to work, after a bit of digging, I ended up with the following solution:

if (typeof process === 'undefined') {
    // We're in browser!
}

This also allows us to run jest tests without problems.

Guillaume's Projects

Guillaume doesnโ€™t have any public repositories yet.

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.