GithubHelp home page GithubHelp logo

web-apps-with-vue's Introduction

FriendsHq

This is an Vue.js 2+ application. It attempts to demonstrate creating a simple web application using Vue.js.

The constructs that we see being employed in this demo are:

  • Creating Vue.js components
  • Creating component hierarchies
  • props and custom events
  • Smart vs. Dumb components
  • Ajax using axios
  • Routes, routing, and the router-view
  • Forms using Vue.js
  • Using the best practices for naming and project layout
  • Unit/integration/e2e testing

This project also leverages Vuetify for styling.

Prerequisites

  • Download and install node per this
    • This will install npm as well
  • As an alternative to npm you can use yarn. If you choose to do so, you can find installation instructions here
  • Vue CLI - You will find instructions here

Optional (but highly recommended)

Getting started

First git-clone or download this repository (Though it's preferred you clone)

Then open a terminal, cd to the directory where you cloned this repository.

Make sure node/npm (or yarn if you have it installed) are in your path!

npm install # or `yarn install`

Running the app

Open two terminals. In both cd to the directory where you cloned this repository.

In the first one, run

npm run server # or `yarn run server`

You should see something to the effect of

$ json-server --watch server/api/db.json

  \{^_^}/ hi!

  Loading server/api/db.json
  Done

  Resources
  http://localhost:3000/friends

  Home
  http://localhost:3000

  Type s + enter at any time to create a snapshot of the database
  Watching...

In the second terminal run

npm serve # or `yarn serve`

Once the console is settled, visit http://localhost:8080/ and you should see a http://localhost:8080/ with a "Hello" message.

You are all set!

Running the tests

Replace npm with yarn if that is what you are using

Lints and fixes files

npm run lint

Run your end-to-end tests

npm run test:e2e

Run your unit tests

npm run test:unit

Every once in a while it seems that Jest gets in a weird state, leading to errors that look like so:

 FAIL  tests/unit/Example.spec.js
  โ— Test suite failed to run

    /Users/raju/Documents/presentations/2019/A-Vue-Perspective/friends-hq/tests/unit/Example.spec.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import "core-js/modules/es6.array.iterator";
                                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    SyntaxError: Unexpected string

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)

At this point, try clearing the Jest cache like so:

./node_modules/jest/bin/jest.js --clearCache

And then run test:unit again.

Navigating the source code

The best way to peruse the changes in this codebase is to follow the commit history. Each commit has been deliberately designed to highlight one particular aspect in our exploration of Vue.js.

Credits

This project is inspired by Monica.

web-apps-with-vue's People

Contributors

looselytyped avatar

Watchers

Vinicius Ianni avatar

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.