How to get started with a simple Node.js back-end as a front-end JavaScript developer.

Photo by Wes Hicks on Unsplash

When you start out as a front-end developer, the back-end side of things can often seem overly complex and the learning curve can look pretty steep. A lot of back-end tutorials will be using Python or some other foreign language and you may think that you need to learn how to manage a server, write routing rules, maintain a database — the list is endless.

However, in this modern world, there is simply no need to think about or learn most of the complexities of a…


Level up your Firestore/TypeScript game with this TS 4 magic that validates dot-notation object keys.

Photo by Peter Conlan on Unsplash

Important if you want to understand the code:

This article is a continuation of my previous article on Firestore and TS

It assumed you know what I’m talking about when I write db . Here’s the code for a reminder:

// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { User } from '~/@types'
const converter = <T>() => ({
toFirestore: (data: Partial<T>) => data,
fromFirestore: (snap: FirebaseFirestore.QueryDocumentSnapshot) => snap.data() as T
})
const dataPoint = <T>(collectionPath: string) => firestore().collection(collectionPath).withConverter(converter<T>())const db = {
// list your collections here
// users: dataPoint<User>('users')
}
export { db }

TLDR;
Typesafe Firestore…


Copy any text to the clipboard in Vue 3 with the new Vue composition API.

Photo by Kelly on Unsplash

TL;DR: Use vue-clipboard3 (I maintain this package)

Today I needed to copy some text to the clipboard in my new Vue app where I’m using Vue 3 and the composition api.

I didn’t want to use a Vue directive as this seems a little messy and not so declarative, and the existing solutions either don’t work in Vue 3, don’t have good typescript support, are used as a Vue plugin binding to ‘this’ or are a hack of a Vue 2 solution.

So I set…


To statically generate your site, or use server-side rendering… That is the question. I propose a novel solution — do both from the same codebase with Nuxt.js and Google cloud 🚀

Photo by Compare Fibre on Unsplash (comparefibre.co.uk)

I’m starting a new project and, as every developer knows, that means time to refactor! The project is a modern, pay-for-use VPN service that puts the user in control and uses WireGuard under the hood. I don’t have a link to share yet, but I’ll update this article when I have something to show after Christmas. …


Boost your Firestore and TS skills with a couple of lines of clean code.

Photo by Camylla Battani on Unsplash

TLDR;
Typesafe read/write with Firestore:
GIST with comments and examples
Clean GIST

Part 2 with some kind of support for update() methods:

The Problem:

Something that’s been on my TODO for a while now has been to figure out a slick and clean way of using Firestore in a more type-safe way. I was fed up of doing:

const someData = firebaseDocumentRef.data() as SomeType

I have to import the type in each file I use it. What if I get the type wrong? More code to write etc…


Photo by Daniel Chen on Unsplash

For our most recent project we are using a mono-repo setup with Lerna and Yarn workspaces which gives us an excellent opportunity to create our own local Node packages, writing more maintainable and useable code. All of our front end apps run on Nuxt.js and I quite quickly found that I needed to install Vue plugins, and add to the Vuex store from within a module, while still keeping the context of the Nuxt app.

In this post, I will explain with code examples how to create a Nuxt module as a local Node package. This could be easily extended…


Learn how to create a shared side drawer using RadSideDrawer in NavtiveScript Vue 2

TL;DR:
Creating a sidedrawer that is shared between pages can save memory, minimize CPU usage, and give a boost to performance. Check out this repo to get your hands on the code!

Don’t make so many side drawers! Create a global, shared drawer instead ;)

Coming from the wold of web app development I initially found that native dev sucked. It felt clunky, unintuitive, non-reliable and under-documented. As well as that, you were pretty much tied to using React or Angular and missing out on the awesomeness of Vue. Ohh and signing your app and publishing to the app store was a nightmare compared to my usual npm run generate && firebase deploy

Jamie Curnow

I am a javascript developer living in beautiful Cornwall, UK. Ever curious, always learning.

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