GithubHelp home page GithubHelp logo

kburakozdemir / contenta_vue_nuxt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from contentacms/contenta_vue_nuxt

0.0 1.0 0.0 3.89 MB

Start in minutes a Drupal 8 with JSON API and Vue.js : a Nuxt.js ( Vue.js SSR ) consumer for Contenta CMS

Home Page: https://contentanuxt.now.sh

License: GNU General Public License v2.0

JavaScript 4.44% Vue 8.58% CSS 86.98%

contenta_vue_nuxt's Introduction

A Drupal 8 headless starter for beginners with Nuxt.js and JSON API module or Contenta CMS

!!! LOOKING FOR A NEW MAINTAINER !!! my interests have changed and i'm not working with Contenta anymore today. Please let m know if you are interested to maintain this project :)

démo : https://contentanuxt.now.sh/

This project is a simple example to let you start quickly a SEO-friendly headless Drupal 8 with JSON API and Vue.js.

This is aimed at beginners in headless Drupal : we focused on keeping things as simple as possible and keeping a very low barrier to entry to Nuxt.js + JSON API stack: No over-engineering, no complex edges cases, no complex directory structure.

Contenta Vue Nuxt is consuming Contenta CMS example public API to build a fictive recipes site.

Why Nuxt.js and not just Vue.js ?

We believe a headless Drupal has to be SEO-friendly and fast. That's why we are using the awesome Nuxt.js : This is Vue.js with automatic Server Side Rendering and Code Splitting, so you don't have to deal yourself with all that stuff: just enjoy your SEO-friendly site built with your Vue.js components.

vue image nuxt image

( Vue drawing by https://twitter.com/hashedrock )

GETTING STARTED

REQUIREMENTS

  • Node 10.x
  • NPM >= 5

INSTALL

# install dependencies
$ npm install

# serve with hot reload at localhost:3000
$ npm run dev

To listen on another port, edit your package.json and change dev script:

  # ...
  "scripts": {
    "dev": "PORT=5000 node_modules/.bin/nuxt"
  # ...

Run units tests:

# run unit tests. test resides in test/unit directory
$ npm test

BUILD FOR PRODUCTION

# build for production
$ npm run build
# and launch production server
$ npm run start

How does it work ?

Most important parts of the code resides inside pages, components & layouts directories, this is where our Vue components resides.

  • Components are normal Vue.js single-file components.
  • Pages are special Nuxt.js components : they are triggering server side rendering and are accessible automatically via an url. For example "pages/recipes.vue" can be accessed going to "/recipes" uri. They use a special asyncData() method which is used by the server side rendering.
  • Layouts are some Vue components used as template wrappers for pages components, somehow like the page.tpl.php from Drupal.
  • lib directory contains cross-components library or business logic, this is where resides our functions and class to fetch data from Contenta CMS public API. They might be called from components asyncData() methods or Vuex store.

contenta_vue_nuxt's People

Contributors

davidjor-hpan avatar e0ipso avatar jeanfei avatar kburakozdemir avatar mogtofu33 avatar nickstees avatar penyaskito avatar yann-yinn avatar

Watchers

 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.