docker-aws-install

Docker is an open platform for developing, shipping, and running applications.

# aws cli (cli command)


Why choose Next.js?

#play_next_js

React.js is the most favorite Library. Next.js is a React framework, created by Zeit

Next.js pick for SEO purpose (Server Side Rendering )

# Key points

  • Server side rendering (SSR)
  • SPA (Single page application)
  • Auto routing
  • SEO friendly
  • Image optimization
  • Best performance
  • Friendly Community

Notification is a short and informational message that notifies a user.

php artisan make:notification OrderComplete

implements ShouldQueue and trait Queueable

Now call the notification inside your controller or others file.

use App\Notifications\OrderComplete;Notification::route('mail', 'hiremostafa@gmail.com')
->notify(
(new OrderComplete())->delay(now()>addMinutes(1))
);

~ Setup queue environment (Queue)


#code4mk #laravel

# Queue: Queue is a FIFO (first in first out). Queue task waiting to complete the previous task.

Laravel Queue: Laravel queue system increase performance of request and reduce the loading time.

Basically queue is a time-consuming task but run background on the server.

# Job

Job is a specific task for a specific queue.


laravel testing, #code4mk , #testing

Laravel built with testing in mind. Laravel support PHPUnit testing.

# 1. Configure xml file

NB: bash cli

# command with  bash cli
./vendor/bin/phpunit --configuration /path/to/laravel_project/phpunit.xml

# 2. Make a Test

php artisan make:test AppTest --unit


courtesy : image from andersontech
  • Event is a specific task.
  • Listener listen a event then trigger one or many actions.
  • Actions<- Listener <- listen (event)
# generate from kernel
php artisan event:generate
# manually create
php artisan make:listener ListenerName
php artisan make:event EventName

event

  • EventName class.


#custom_route_nuxt #nuxtjs #nuxt #code4mk

# pages

pages automaticaly generate router that this amazing. but a big project pages system is so boring. because can’t standard folder system for project specific feature.

if you are familiar with vue router and vue dev this content for you. if you don’t like this content , you can skip this post.

# why not use pages directory

~ if want to this is type router

127.0.0.1:3000/admin/balance

127.0.0.1:3000/admin/withdraw

~ and want this is type directory

pages/
finance/
balance.vue
withdraw.vue

It is not possible, beacuse nuxt generate route automatically.

127.0.0.1:3000/finance/balance and 127.0.0.1:3000/finance/withdraw

# solve

create a…


code4mk

#nuxtjs #nuxt #code4mk #vue

#maintenance Mode

Sometimes you need to your site on maintenance mode. you can easily setup maintenance mode in nuxt app.

# Maintenance page

create a maintenance page as page\maintenance.vue

<template lang="html"><div class="content">
<div class="maintenance">
<h1> Maintenance Mode </h1>
<h1>Nuxt.js
@code4mk</h1>
</div>
</div>
</template>
<script>
export default {
mounted: function () {
console.log(this.$route.path)
}
}
</script>
<style lang="css" scoped >
body, html {
height: 100%;
width: 100%;
font-family: 'Open Sans Condensed', sans-serif;
font-size: 1em;
}
.maintenance h1 {
font-size: 190%;
color: #fff;
text-shadow: -2px 2px 3px rgba(0,0,0,0.5);
color: #d6336c;
text-align: center;
}
.maintenance …


#nuxt #nuxtjs #i18n #code4mk.

# vue-i18n

vue-i18n is best intertionalization plugin for vue project.

# how add vue-i18n inside nuxt

Nuxt.js link up package by plugin system. create a plugin then add that inside nuxt.config.js

# create plugin

~ plugins/i18n.js

import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)export default ({ app, store}) => {
app.i18n = new VueI18n({
locale: 'en',
fallbackLocale: 'en',
silentTranslationWarn: true,
messages: {
'bn': {
'menu':{
'home': 'হোম',
'blog': 'ব্লগ',
'contact': 'যোগাযোগ'
},
},
'en': {
"menu": {
'home': 'home',
'blog': 'blog',
'contact': 'contact'
},
},
},
}
})
//app.i18n.locale = 'bn' app.i18n.path =…


editorjs

#editorjs #vue_editorjs #editorjs_vue #code4mk

editor.js

Editor.js is a next-generation block-based editor, and it’s open source. editor.js returns a JSON output. editor.js built by codex-team.

core block plugins are header paragraph image embed list table and so on. plugin organization

# Implement editorjs with vuejs pos

npm install @editorjs/editorjs
npm install @editorjs/header
npm install @editorjs/paragraph
npm install @editorjs/list
  • you can install your desired block from editorjs.

# vue file

# codesandbox

# official

Mostafa Kamal

Code Artist | Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store