jackblog-vue
Jackblog vue 版, 个人博客系统, 使用 vue2, vuex, vue-resource, vue-router, vee-validate, vue-toast 等.
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
📝 Minimalistic Vue-powered static site generator
The Intuitive Vue Framework.
Quasar Framework - Build high-performance VueJS user interfaces in record time
🛠️ webpack-based tooling for Vue.js Development
🗃️ Centralized State Management for Vue.js.
Quick Overview
Jackblog-vue is a full-stack blog application built using Vue.js for the frontend and Express.js for the backend. It demonstrates a modern, single-page application architecture with features like user authentication, article management, and commenting system.
Pros
- Utilizes Vue.js, providing a reactive and component-based frontend architecture
- Implements server-side rendering for improved SEO and initial load performance
- Includes a comprehensive set of features common to blog applications
- Demonstrates integration of frontend and backend technologies in a full-stack application
Cons
- The project hasn't been updated recently, potentially using outdated dependencies
- Documentation is primarily in Chinese, which may limit accessibility for non-Chinese speakers
- Lacks detailed setup instructions or contribution guidelines in the README
- May require significant effort to modernize and adapt to current best practices
Code Examples
<!-- Example of a Vue component for displaying an article -->
<template>
<div class="article">
<h1>{{ article.title }}</h1>
<p>{{ article.content }}</p>
<span>Author: {{ article.author }}</span>
</div>
</template>
<script>
export default {
props: ['article'],
}
</script>
// Example of an API call using Axios in a Vuex action
import axios from 'axios'
export const fetchArticles = ({ commit }) => {
return axios.get('/api/articles')
.then(response => {
commit('SET_ARTICLES', response.data)
})
.catch(error => {
console.error('Error fetching articles:', error)
})
}
<!-- Example of using Vuex state in a component -->
<template>
<ul>
<li v-for="article in articles" :key="article.id">
{{ article.title }}
</li>
</ul>
</template>
<script>
import { mapState } from 'vuex'
export default {
computed: {
...mapState(['articles'])
}
}
</script>
Getting Started
-
Clone the repository:
git clone https://github.com/jackhutu/jackblog-vue.git cd jackblog-vue
-
Install dependencies:
npm install
-
Set up environment variables (create a
.env
file based on.env.example
). -
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
to view the application.
Competitor Comparisons
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Pros of Vue
- Much larger and more active community with over 200k stars on GitHub
- More comprehensive documentation and learning resources
- Wider ecosystem of plugins and tools
Cons of Vue
- Steeper learning curve for beginners compared to Jackblog-vue
- Potentially overkill for simple blog projects
- Requires more setup and configuration
Code Comparison
Vue (main.js):
import { createApp } from 'vue'
import App from './App.vue'
createApp(App).mount('#app')
Jackblog-vue (main.js):
import Vue from 'vue'
import App from './App'
new Vue({
el: '#app',
render: h => h(App)
})
Summary
Vue is a full-featured framework suitable for large-scale applications, while Jackblog-vue is a specialized blog template. Vue offers more flexibility and power but may be more complex for simple projects. Jackblog-vue provides a ready-to-use blog solution with a gentler learning curve.
The code comparison shows that Vue uses the newer composition API, while Jackblog-vue uses the older options API. This reflects Vue's evolution and Jackblog-vue's focus on simplicity.
Choose Vue for complex applications or if you need a versatile framework. Opt for Jackblog-vue if you want a quick, pre-configured blog setup without the overhead of a full framework.
📝 Minimalistic Vue-powered static site generator
Pros of VuePress
- Designed specifically for creating documentation sites, with built-in features for technical writing
- Offers a default theme optimized for documentation, reducing setup time
- Supports Vue components in Markdown, allowing for dynamic and interactive content
Cons of VuePress
- Less flexible for general-purpose blogging compared to Jackblog-vue
- Steeper learning curve for users not familiar with Vue.js ecosystem
- Limited built-in features for user authentication and comments
Code Comparison
VuePress config example:
module.exports = {
title: 'My Documentation',
description: 'A VuePress site',
themeConfig: {
nav: [{ text: 'Home', link: '/' }, { text: 'Guide', link: '/guide/' }]
}
}
Jackblog-vue route example:
export default [
{ path: '/', component: Home },
{ path: '/article/:id', component: Article },
{ path: '/admin', component: Admin, meta: { requireAuth: true } }
]
VuePress focuses on documentation structure and navigation, while Jackblog-vue provides more flexibility for custom routing and authentication.
The Intuitive Vue Framework.
Pros of Nuxt
- More comprehensive framework with built-in server-side rendering and static site generation
- Larger community and ecosystem, with extensive documentation and plugins
- Regular updates and active maintenance from Vue.js core team members
Cons of Nuxt
- Steeper learning curve due to additional concepts and configuration options
- Potentially heavier bundle size for smaller applications
- More opinionated structure, which may limit flexibility for some projects
Code Comparison
Jackblog-vue (Vue.js SPA approach):
import Vue from 'vue'
import App from './App.vue'
import router from './router'
new Vue({
router,
render: h => h(App)
}).$mount('#app')
Nuxt (Server-side rendering approach):
export default {
asyncData({ params }) {
return { id: params.id }
},
head() {
return { title: `Post ${this.id}` }
}
}
Jackblog-vue is a simpler Vue.js single-page application, while Nuxt provides a more structured approach with built-in server-side rendering capabilities. Nuxt offers additional features like automatic code splitting and easier SEO optimization, but may be overkill for smaller projects. Jackblog-vue is more lightweight and straightforward, making it suitable for simpler blog applications or as a starting point for custom Vue.js projects.
Quasar Framework - Build high-performance VueJS user interfaces in record time
Pros of Quasar
- Comprehensive UI framework with a large set of pre-built components
- Cross-platform development support (web, mobile, desktop)
- Active community and regular updates
Cons of Quasar
- Steeper learning curve due to its extensive feature set
- Larger bundle size compared to minimal Vue.js setups
Code Comparison
Quasar component usage:
<template>
<q-page>
<q-btn color="primary" label="Click me" />
<q-input v-model="text" label="Enter text" />
</q-page>
</template>
Jackblog-vue component usage:
<template>
<div class="page">
<button class="btn btn-primary">Click me</button>
<input v-model="text" placeholder="Enter text" />
</div>
</template>
Quasar offers a more opinionated structure with custom components, while Jackblog-vue uses standard HTML elements with Vue.js bindings. Quasar's approach can lead to faster development and consistent styling, but may require more familiarity with the framework's specific components and conventions.
🛠️ webpack-based tooling for Vue.js Development
Pros of vue-cli
- Official Vue.js project scaffolding tool with extensive ecosystem support
- Provides a full-featured development environment out of the box
- Offers plugin-based architecture for easy customization and extension
Cons of vue-cli
- May be overkill for smaller projects or learning purposes
- Requires additional setup time compared to simpler boilerplates
- Can be overwhelming for beginners due to its extensive features
Code Comparison
vue-cli (vue create example-project):
Vue CLI v4.5.13
? Please pick a preset: Default (Vue 3) ([Vue 3] babel, eslint)
? Pick the package manager to use when installing dependencies: npm
jackblog-vue (manual setup):
git clone https://github.com/jackhutu/jackblog-vue.git
cd jackblog-vue
npm install
npm run dev
Summary
vue-cli is a powerful and flexible tool for creating Vue.js projects, offering a comprehensive development environment and extensive customization options. It's ideal for medium to large-scale applications and teams looking for a standardized setup.
jackblog-vue, on the other hand, is a simpler boilerplate focused on creating a blog application. It's more suitable for beginners or those looking to quickly set up a specific type of project without the need for extensive configuration.
The choice between the two depends on project requirements, team expertise, and desired level of customization.
🗃️ Centralized State Management for Vue.js.
Pros of Vuex
- More comprehensive state management solution for Vue.js applications
- Larger community support and regular updates
- Better documentation and extensive examples
Cons of Vuex
- Steeper learning curve for beginners
- May be overkill for smaller projects
- Requires more boilerplate code
Code Comparison
Vuex:
import { createStore } from 'vuex'
export default createStore({
state: {
count: 0
},
mutations: {
increment(state) {
state.count++
}
}
})
Jackblog-vue:
export default {
data() {
return {
count: 0
}
},
methods: {
increment() {
this.count++
}
}
}
Vuex provides a centralized store for state management, while Jackblog-vue uses Vue's built-in reactivity system for simpler state handling. Vuex offers more structure and scalability for larger applications, whereas Jackblog-vue's approach is more straightforward for smaller projects.
Vuex is maintained by the Vue.js core team and has extensive documentation, making it a reliable choice for complex applications. Jackblog-vue, being a blog project, demonstrates a simpler implementation that may be sufficient for less complex use cases.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Jackblog Vue ç
Jackblog æ¯ä½¿ç¨ Node.js + MongoDB + å
¶å®å®¢æ·ç«¯æ¡æ¶å¼åç个人å客系ç»,åå端å离,仿ç®ä¹¦æ¨¡æ¿.
æå¡ç«¯æ: express ç , koa ç
客æ·ç«¯æ: angular1.x ç , angular2.x ç , react ç , vue ç
移å¨ç«¯æ: react native ç, ionic2.0 ç
æ¤ä¸ºå®¢æ·ç«¯vueç, éè¦é åæå¡ç«¯ä½¿ç¨.
æå¡ç«¯ä»»éä¸ç§, 请é¢å å®è£ 并å¯å¨æå¡ç«¯
å¼å
$ git clone git@github.com:jackhutu/jackblog-vue.git
$ cd jackblog-vue
$ npm install
$ npm run dev
å¨æµè§å¨ä¸èªå¨æå¼ http://localhost:3000
è°è¯
- é»è®¤å¼å¯ vue-devtools chromeæµè§å¨æ©å±, ç产ç¯å¢èªå¨å ³é
ç®å½ç»æ
.
âââ README.md
âââ dist // 项ç®buildç®å½
âââ logs // ç产ç¯å¢æ¥å¿ç®å½
âââ src // ç产ç®å½
â âââ api // API 请æ±
â âââ assets // css åå¾çèµæº
â âââ components // ç»ä»¶
â âââ utils // å·¥å
·å½æ°
â âââ store // vuexç¸å
³æ件, store,action
â âââ config.js // api url, cookie domainçé
ç½®æ件
â âââ index.html // 主页html
â âââ routes.js // è·¯ç±é
ç½®
â âââ index.js // å
¥å£æ件
âââ .babelrc // babelé
ç½®
âââ .eslintrc.json // eslinté
ç½®
âââ History.md // æ´æ°æ¥å¿
âââ process.json // pm2é
ç½®æ件
âââ server.js // ç产ç¯å¢å¯å¨server
âââ webpack.config.js // Webpack é
ç½®æ件
ç产ç¯å¢æ建
$ npm run build
线ä¸å¸ç½²
$ pm2 start process.json
License
MIT
Top Related Projects
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
📝 Minimalistic Vue-powered static site generator
The Intuitive Vue Framework.
Quasar Framework - Build high-performance VueJS user interfaces in record time
🛠️ webpack-based tooling for Vue.js Development
🗃️ Centralized State Management for Vue.js.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot