Build a Simple API Service with Express and GraphQL

Original Source: https://www.sitepoint.com/build-a-simple-api-service-with-express-and-graphql/

This article was originally published on the Okta developer blog. Thank you for supporting the partners who make SitePoint possible.

GraphQL has become an immensely popular alternative to REST APIs. The flexibility you get from using GraphQL makes it easier for developers to get any information they need for an app, and just the information they need for that portion of the app. That gives you the feel of a very customized API and can help cut down on bandwidth.

In this tutorial, I’ll show you how to write a custom GraphQL API using Node and Express. I’ll also show you how to secure parts of the API while making other parts open to the public.

Create the GraphQL API with Express

To create the API, start by creating a new folder and creating a package.json file to manage your dependencies. You’ll also need to install a few dependencies to get GraphQL with Express up and running:

mkdir graphql-express
cd graphql-express
npm init -y
npm install express@2.8.4 express-graphql@0.6.12 graphql@14.0.2 graphql-tag@2.9.2 cors@2.8.4

Now create a file named index.js. This will be your main entry point:

const express = require(‘express’)
const cors = require(‘cors’)
const graphqlHTTP = require(‘express-graphql’)
const gql = require(‘graphql-tag’)
const { buildASTSchema } = require(‘graphql’)

const app = express()
app.use(cors())

const schema = buildASTSchema(gql`
type Query {
hello: String
}
`)

const rootValue = {
hello: () => ‘Hello, world’
}

app.use(‘/graphql’, graphqlHTTP({ schema, rootValue }))

const port = process.env.PORT || 4000
app.listen(port)
console.log(`Running a GraphQL API server at localhost:${port}/graphql`)

This is about as simple as a GraphQL server gets. All this does is return “Hello, world” when you query “hello”, but it’s a start. To take it for a test spin, run node ., then in another tab open your browser to the GraphQL Playground. Once there, enter http://localhost:4000/graphql to access your GraphQL server.

graphql playground - enter endpoint url

The GraphQL Playground will help explore your schema and test out queries. It even automatically creates some documentation for you.

graphql playground - hello world schema

Try querying for hello using the following query:

query {
hello
}

hello world

Improve Your GraphQL Developer Experience

Here are a couple quick tips to help make your development experience a little better:

1. Install a linter to help catch bugs in your editor. This will help keep your styling consistent and catch any easily-avoidable bugs.

To install StandardJS, type npm install –save-dev standard@12.0.1. Most editors will be able to show you warnings and errors as you type.

You can also edit the scripts object of your package.json so that you can run the linter at any time with npm test:

“scripts”: {
“test”: “standard”
},

2. Automatically restart the server when you make changes.

Install nodemon with npm install –save-dev nodemon@1.18.4.

Add another script to package.json, so you can run the server with npm start. Combined with the above, your scripts object should look like this:

“scripts”: {
“test”: “standard”,
“start”: “nodemon .”
},

Go ahead and close the server you had run with node . and now type npm start to restart the development server. From now on, any changes you make will automatically restart the server.

Create the GraphQL Queries

To get something a little more useful, let’s make a post editor. GraphQL is strongly typed, allowing you to create a type for each object and connect them. A common scenario might be to have a post with some text, that was written by a person. Update your schema to include these types. You can also update your Query type to utilize these new types.

type Query {
posts: [Post]
post(id: ID): Post
authors: [Person]
author(id: ID): Person
}

type Post {
id: ID
author: Person
body: String
}

type Person {
id: ID
posts: [Post]
firstName: String
lastName: String
}

Even though the resolvers aren’t set up, you can already go back to GraphQL Playground and refresh the schema by clicking the circular arrow icon next to the localhost URL.

url and refresh button

The schema explorer is really useful for figuring out how to create your query. Click the green SCHEMA button to check out your new schema.

full query schema

You’ll need some way to store the data. To keep it simple, use JavaScript’s Map object for in-memory storage. You can also create some classes that will help connect the data from one object to another.

const PEOPLE = new Map()
const POSTS = new Map()

class Post {
constructor (data) { Object.assign(this, data) }
get author () {
return PEOPLE.get(this.authorId)
}
}

class Person {
constructor (data) { Object.assign(this, data) }
get posts () {
return […POSTS.values()].filter(post => post.authorId === this.id)
}
}

Now if you have an instance of a Person, you can find all of their posts by simply asking for person.posts. Since GraphQL lets you only ask for the data you want, the posts getter will never get called unless you ask for it, which could speed up the query if that’s an expensive operation.

You’ll also need to update your resolvers (the functions in rootValue) in order to accommodate these new types.

const rootValue = {
posts: () => POSTS.values(),
post: ({ id }) => POSTS.get(id),
authors: () => PEOPLE.values(),
author: ({ id }) => PEOPLE.get(id)
}

This is great, but there’s no data yet. For now, stub in some fake data. You can add this function and the call to it right after the assignment to rootValue.

const initializeData = () => {
const fakePeople = [
{ id: ‘1’, firstName: ‘John’, lastName: ‘Doe’ },
{ id: ‘2’, firstName: ‘Jane’, lastName: ‘Doe’ }
]

fakePeople.forEach(person => PEOPLE.set(person.id, new Person(person)))

const fakePosts = [
{ id: ‘1’, authorId: ‘1’, body: ‘Hello world’ },
{ id: ‘2’, authorId: ‘2’, body: ‘Hi, planet!’ }
]

fakePosts.forEach(post => POSTS.set(post.id, new Post(post)))
}

initializeData()

Now that you have your queries all set up and some data stubbed in, go back to GraphQL Playground and play around a bit. Try getting all the posts, or get all the authors and posts associated with each one.

query all posts

Or get weird and get a single post by id, then the author for that post, and all of that author’s posts (including the one you just queried).

get weird

Add User Authentication to Your Express + GraphQL API

One simple way to add authentication to your project is with Okta. Okta is a cloud service that allows developers to create, edit, and securely store user accounts and user account data, and connect them with one or multiple applications. If you don’t already have one, sign up for a forever-free developer account.

You’re going to need to save some information to use in the app. Create a new file named .env. In it, enter in your organization URL.

HOST_URL=http://localhost:4000
OKTA_ORG_URL=https://{yourOktaOrgUrl}

You will also need a random string to use as an App Secret for sessions. You can generate this with the following command:

echo “APP_SECRET=`openssl rand -base64 32`” >> .env

Next, log in to your developer console, navigate to Applications, then click Add Application. Select Web, then click Next.

create new application settings

The page you come to after creating an application has some more information you need to save to your .env file. Copy in the client ID and client secret.

OKTA_CLIENT_ID={yourClientId}
OKTA_CLIENT_SECRET={yourClientSecret}

The last piece of information you need from Okta is an API token. In your developer console, navigate to API -> Tokens, then click on Create Token. You can have many tokens, so just give this one a name that reminds you what it’s for, like “GraphQL Express”. You’ll be given a token that you can only see right now. If you lose the token, you’ll have to create another one. Add this to .env also.

OKTA_TOKEN={yourOktaAPIToken}

Create a new file named okta.js. This is where you’ll create some utility functions, as well as get the app initialized for Okta. When authenticated through Okta, your app will authenticate through an access token using JWT. You can use this to determine who a user is. To avoid dealing directly with authentication in your app, a user would sign in on Okta’s servers, then send you a JWT that you can verify.

okta.js

const session = require(‘express-session’)

const OktaJwtVerifier = require(‘@okta/jwt-verifier’)
const verifier = new OktaJwtVerifier({
clientId: process.env.OKTA_CLIENT_ID,
issuer: `${process.env.OKTA_ORG_URL}/oauth2/default`
})

const { Client } = require(‘@okta/okta-sdk-nodejs’)
const client = new Client({
orgUrl: process.env.OKTA_ORG_URL,
token: process.env.OKTA_TOKEN
})

const { ExpressOIDC } = require(‘@okta/oidc-middleware’)
const oidc = new ExpressOIDC({
issuer: `${process.env.OKTA_ORG_URL}/oauth2/default`,
client_id: process.env.OKTA_CLIENT_ID,
client_secret: process.env.OKTA_CLIENT_SECRET,
redirect_uri: `${process.env.HOST_URL}/authorization-code/callback`,
scope: ‘openid profile’
})

const initializeApp = (app) => {
app.use(session({
secret: process.env.APP_SECRET,
resave: true,
saveUninitialized: false
}))
app.use(oidc.router)
app.use(‘/access-token’, oidc.ensureAuthenticated(), async (req, res, next) => {
res.send(req.userContext.tokens.access_token)
})
}

module.exports = { client, verifier, initializeApp }

The initializeApp function adds some middleware to allow you to log in with Okta. Whenever you go to the http://localhost:4000/access-token, it will first check that you’re logged in. If you aren’t, it will first send you to Okta’s servers to authenticate. Once authentication is successful, it returns you to the /access-token route and will print out your current access token, which will be valid for about an hour.

The client that you’re exporting allows you to run some administrative calls on your server. You’ll be using it later to get more information about a user based on their ID.

the verifier is what you use to verify that a JWT is valid, and it gives you some basic information about a user, like their user ID and email address.

Now, in index.js, you’ll need to import this file and call the initializeApp function. You also need to use a tool called dotenv that will read your .env file and add the variables to process.env. At the very top of the file, add the following line:

require(‘dotenv’).config({ path: ‘.env’ })

Just after the app.use(cors()) line, add the following:

const okta = require(‘./okta’)
okta.initializeApp(app)

To make this all work, you’ll also need to install a few new dependencies:

npm i @okta/jwt-verifier@0.0.12 @okta/oidc-middleware@1.0.0 @okta/oidc-sdk-nodejs@1.2.0 dotenv@6.0.0 express-session@1.15.6

You should now be able to go to http://localhost:4000/access-token to log in and get an access token. If you were just at your developer console, you’ll probably find you’re already logged in. You can log out of your developer console to ensure the flow works properly.

Create GraphQL Mutations

Now it’s time to use real data. There may be some real John and Jane Does out there, but chances are they don’t have an account on your application yet. Next, I’ll show you how to add some mutations that will use your current user to create, edit, or delete a post.

To generate IDs for a post, you can use uuid. Install it with npm install uuid@3.3.2, then add it to index.js with:

const uuid = require(‘uuid/v4’)

That should go near the top of the file, next to the other require statements.

While still in index.js, add the following types to your schema:

The post Build a Simple API Service with Express and GraphQL appeared first on SitePoint.

The best full-frame cameras in 2018

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/vKrBzW2PyXA/best-full-frame-cameras

Full-frame cameras have a lot to offer the creative photographer, and they come in a wide range of shapes and sizes. To help you figure out which is the right model for you, we've rounded up our pick of the best full-frame cameras in a range of different categories. If you're not sure it's a full-frame camera you want, we also have a guide to the best camera for creatives.

So what exactly is a full-frame camera, and why would you want one? Full-frame cameras can deliver a tighter depth of field than models with a crop sensor, which can be a major bonus in portraiture and still life photography. 

The fact that the image sensor has a physically larger surface area can be a key advantage in other ways as well. Manufacturers can cram extra megapixels onto the sensor, increasing the potential for capturing ultra-fine detail and texture. Alternatively, they can stick to a more modest megapixel count and increase the size of the actual photosites, which equate to pixels in the resulting image. Bigger photosites enable the camera to capture more light, which can result in less image noise when shooting at high ISO (sensitivity) settings.

Many photographers still prefer conventional DLSRs, with their reflex mirrors and optical viewfinders. However, there's a growing range of mirrorless 'compact system cameras' on the market, with Sony offering a number of full-frame bodies and companion lenses in its lineup. 

Let's check out the best full-frame cameras on the market to suit your budget and specific requirements.

With the notable exceptions of the 5DS and 5DS R, Canon's highly regarded EOS 5D series of cameras have never set the world alight in terms of megapixel count. True to form, the latest Mk IV weighs in with a 30.4MP image sensor, which turns out to be a very good compromise. It enables the camera to capture fine detail extremely well, while also maintaining very clean image quality at high ISO settings, along with a fairly fast 7fps maximum drive rate. The autofocus systems are excellent, with a 61-point phase-detection module for shooting stills through the viewfinder, and Dual Pixel AF for live view and movie capture, the latter of which is available at 4K UHD.

Sony's latest flagship mirrorless camera packs a full-frame sensor and dual memory card slots into a typically small and lightweight package. The sensor itself might look unimpressive, with a 24.2 megapixel count, but it's a stacked CMOS device with onboard processing and memory. 

Advantages include low-noise image quality at very high ISO settings, and blistering continuous drive speeds of up to 20fps, complete with autofocus tracking. An electronic shutter is also on hand, to enable shutter speeds of up to 1/32000th of a second, so you can freeze even the fastest action. The electronic viewfinder is absolutely outstanding and the rear touchscreen is nice and clear, although it only has a tilt facility and lacks full articulation.

For outright resolving power, the 45.4MP Nikon D850 clearly wins out against the 30.4MP Canon 5D Mk IV. And despite having 50 per cent more megapixels, it matches the Canon for maximum drive rate, at 7fps. The rear screen is also ultra-high-res, and very easy on the eye. As a pro-grade Nikon, it has a substantially different control layout to consumer-grade cameras like the D750. It's more like a scaled-down Nikon D5, without the built-in vertical grip. As such, it's reasonably small and lightweight for a pro-grade DSLR. 

The only real downside is that, for shooting under low lighting conditions at high ISO settings, image noise can be rather noticeable, especially compared with the likes of the Canon 5D Mk IV and the super-smooth Nikon D750.

This is our pick for the best full-frame budget camera on the market. It took six years for the Mark II edition of Canon's 'enthusiast' level full-frame DSLR to topple the original 6D from its throne. It's been well worth the wait, as the main autofocus system gets a mighty upgrade from 11 AF points with only a single cross-type point, to 45 AF points, all of which are cross-type for greater accuracy. 

The sensor-based autofocus system for live view and movie capture gets an even bigger upgrade, with a dual pixel AF sensor that makes focusing massively faster. The maximum drive rate is 2fps faster at 6.5fps, and the new model features 5-axis stabilisation for movie capture. However, this isn't available for shooting stills, and movies themselves are limited to 1080p rather than 4K. Even so, the excellent fully articulated touchscreen will benefit those shooting movies as well as live view stills.

What you see is what you get with this camera. The immensely detailed and super-sharp electronic viewfinder has crystal clarity, reflected in the ultra-high definition stills that are captured by the 42.4MP image sensor. 4K UHD movie capture is just as much of a treat, as the A9 delivers wonderfully sharp and detailed results, helped along by its 5-axis image stabiliser. Overall 4K movie quality beats that of any regular DSLR currently on the market, and you can boost resolution to 5K in 'Super 35mm' mode. Advanced functions to suit serious videographers include a clean HDMI output, zebra display, time code and slow/quick motion, to name but a few.

Costing two-thirds of the price of the A7R III and little more than half the price of the A9, the A7 III is the most 'sensible' option for those hunting for the best full-frame camera for travel. There's no shortage of advanced features, including a back-illuminated image sensor that enables very clean high-ISO images (more so than in the A7R III), a fabulously fast and reliable hybrid autofocus system, speedy 10fps continuous stills shooting, and 4K video capture. 

With its small, lightweight build, it's eminently suitable for travel photography and, while the A9 and A7R III are also very travel-friendly, the A7 III edges ahead in terms of battery life, with up to 610 or 710 shots per charge, using the viewfinder or rear screen respectively. If you're going to be hitting the beach or engaging in adventurous activities on your travels, it's also nice not to be packing quite such an expensive camera.

If you're after the best full-frame camera for sports or wildlife photography, look no further than the Canon EOS-1D X Mark II. Many pros love this DSLR simply for its handling characteristics. With a built-in vertical grip that fully duplicates all the important shooting controls, it feels equally natural to use in portrait or landscape orientation.

The camera really comes into its own for action sports and wildlife photography where, for a DSLR at least, it delivers a super-fast continuous drive rate of 14fps, and as much as 16fps in live view mode. The 61-point autofocus system makes a spectacularly good job of keeping tabs on fast or erratically moving objects, with plentiful tracking options to choose from. The shooting speed is helped by the modest megapixel count of 20.2MP, but this also ensures relatively noise-free image quality when you need to shoot at very high ISO speeds, for example when freezing the wildlife action at twilight, or for indoor sports.

Inspired by classic yesteryear Nikon 35mm stills cameras, the Df will appeal to photographers of a certain age or inclination. It has a plethora of hands-on, dedicated dials up on top, for adjusting shooting parameters like ISO, shutter speed and exposure compensation, as well as the usual shooting buttons and dials on the front and back. Based on the same image sensor and processor as the flagship D4 (which has now been superseded by the D5), the Df is also starting to look a bit retro in terms of its 16.2 megapixel count. An upside is that high-ISO images are fairly noise-free. A major downside for many modern photographers is that Nikon has taken the 'retro' theme to the extreme by stripping out any video capture facility from the camera.

With a similar price tag to the Canon 6D Mark II, the older Nikon D750 almost matches it for megapixel count, with a 24.3MP sensor. The D750 is equally able to capture fine detail and texture but draws slightly ahead in minimising image noise at very high ISO settings. It's far better than the Nikon D850 in this respect, making the D750 a better proposition for shooting indoors or under very low lighting without resorting to flash. This can be a particular plus point for wedding photographers and others needing to shoot indoor events. Another upside for capturing important, unrepeatable events is that, unlike the Canon 6D Mark II, the D750 has dual memory card slots, so you can create instant backups of every shot you take, on separate cards.

With a keen eye for detail, the K-1 Mark II has a 36MP image sensor with no anti-alias filter, and can deploy its 5-axis sensor-shift image stabiliser in a variety of ways. For starters, it can reduce camera-shake in handheld shooting with up to 5-stop efficiency. There are also tripod and handheld modes for shifting pixels between successive shots, to enhance the capture of ultra-fine detail. 

For shooting the night sky, there's a more intriguing 'Astrotracer' mode. This employs the camera's internal GPS module and electronic compass for astrophotography. The latitudinal position on the globe, plus its direction and horizontal/vertical tilt are all measured automatically. Calculations are performed and the image stabiliser shifts the sensor throughout the exposure. This effectively tracks the movement of the moon, stars and other celestial bodies, so that they don't blur or appear to streak through the night sky.


Software Inevitably Changes – WordPress is No Exception

Original Source: http://feedproxy.google.com/~r/1stwebdesigner/~3/dlgaEx9F8qI/

For those of us who work on the web, the tools we use are incredibly important. We tend to get attached to them. Some of us even go out of our way to promote a particularly good one.

Over the past 15 years, WordPress has been a tool that perhaps benefitted from this loyalty like no other. A small community of diehard supporters has turned into a massive one. There’s a marketplace for themes and plugins. There are numerous users who volunteer their time in capacities official and unofficial. Today, the WordPress community is a force to be reckoned with.

As WordPress has grown into the CMS of choice for so many, so has the criticism of its continued evolution. And with the new Gutenberg editor, things have reached a fever pitch.

This raises a few important questions. How much weight should critics carry? And, what should we reasonably expect from WordPress in terms of new features? Let’s dive in and see if we can find some answers.

The Sky is Falling…Or Not

The coming rollout of Gutenberg in WordPress 5.0 has garnered a lot of opinions. Since the first steps towards its creation, there has been a mixture of excitement and dread within the community.

Then, as Gutenberg was released as a beta plugin, the stuff really started hitting the fan. While we won’t go over every criticism, suffice it to say that some users expressed concerns of sites breaking due to theme or plugin incompatibilities and a buggy UI. Then there were those who had philosophical objections to parts of, or even the very existence of the project.

There are indeed a number of legitimate concerns. But there has also been an element of what I’ll respectfully describe as fear of the unknown. It too has a place in the conversation. But so often it seems to shout over everything else without adding anything productive.

However, that fear of the unknown should fade over time. As users become more accustomed to a change, it stands to reason that they won’t have nearly as much anxiety.

Personally, this has been my own experience with Gutenberg. The more I use it and the more bug fixes that get released, the more comfortable I am. Not to say that there still aren’t plenty of areas for improvement. But at least I’m starting to see a light at the end of the tunnel.

Still, it seems like there is a lot of emotion out there. We’re seeing a number of 1-star reviews and some developers have even begun to develop their own forks of WordPress. Fair or not, people are attached to the old way of doing things.

Scrabble letters spelling "FEAR"

Change is Natural

What tends to get lost amongst all the hype is that, if software hangs around long enough, it’s going to change over time. WordPress just happens to be at a point where its wide usage is calling more attention to these changes.

Operating systems, for example, are famous for annoying a subset of users with UI and feature changes (I’m looking at you, Microsoft). Not everyone likes to change the way they work, even if the end result really is an improved product. There is something to be said for comfort and predictability. When that’s disrupted, users cringe.

WordPress is reported to power over 30% of the web. So, it makes sense that a major change such as Gutenberg would cause some unrest. That number covers a whole lot of preferences, use cases and opinions.

The trick for any software developer is that they have to balance the greater need of maintaining a viable product with keeping existing users happy. There are no easy answers, and WordPress certainly isn’t immune from having to make these difficult decisions.

Person balanced on railroad tracks

You Can’t Always Get What You Want

That leads us to Gutenberg. There was, whether we agree with it or not, a determination that the Classic Editor was becoming outdated. Eventually, it was decided that a new editor was the best way to address the issue.

Knowing that you can’t please everyone, the preferred course of action is to create the best product you can. Take care to ensure that it works on as many existing websites as possible. Take constructive criticism seriously and make compromises where you can.

WordPress has even taken this a step further. Instead of forcing Gutenberg on everyone, they have also provided an alternative path. The Classic Editor plugin keeps the familiar content editing experience and will be supported for the foreseeable future.

While that may not be the perfect solution to some, it is a way forward for those who don’t want to (or unable to) change.

Even with that compromise, there will be some users who refuse to come along for the ride. While that’s certainly not what WordPress wants, it is part of the price you pay for implementing major change. You might say that it’s a philosophy of knowing that you’ll lose some users now, with the hopes of making greater gains in the future.

Gutenberg WordPress editor

Gutenberg is Part of a Constant Evolution

I am very much a creature of habit when it comes to how I work. For me, change means that I have to take precious time out of my day to relearn how a tool works. It disrupts my routine. The whole experience is generally not something I would voluntarily seek out.

But I’ve also come to the point of realizing that change is inevitable. And it often pushes things in the right direction. If it didn’t, I’d still be writing HTML by hand and using tables for layout.

What’s interesting about the Classic Editor is that, in an industry that changes so quickly, it has managed to stick around for a very long time. Sure, it’s undergone incremental improvements. But the basic experience has been the same. It’s always familiar and comfortable – even if it occasionally is a pain to work with.

Still, things move forward. Web design is a field that constantly challenges us to adapt to what’s new. For better or worse, Gutenberg is just one more change. We can expect that there will be more to come.


Multibox Menu

Original Source: http://feedproxy.google.com/~r/tympanus/~3/Cc8M9UBRXKU/

Today we’d like to share a simple fullscreen menu with you. The menu layout is powered by CSS Grid and we make its boxes appear with a reveal animation. The animations are made using TweenMax.

MultiboxMenu

The demo is kindly sponsored by Milanote: your new creative hub. If you would like to sponsor one of our demos, find out more here.

Attention: Note that we use modern CSS properties that might not be supported in older browsers.

For the main page we have a simple layout with a little motion effect on the background image.

MultiboxMenu01

When clicking on the menu icon in the top right corner, the menu opens.

MultiboxMenu02

The menu boxes reveal following an order that we define on each element.

MultiboxMenu

We hope you like this little menu and find it useful!

References and Credits

Images from Unsplash.com
TweenMax by Greensock
Map made with Fantasy Map Generator
imagesLoaded by Dave DeSandro

Multibox Menu was written by Mary Lou and published on Codrops.

11 Must-Have Apps for Web Designers

Original Source: https://www.webdesignerdepot.com/2018/10/11-must-have-apps-for-web-designers/

One of the perks of freelancing is that you can work from pretty much anywhere. However, the pressures of staying connected to work may leave you stuck behind a computer all day anyway.

While there’s something to be said for the levels of productivity and output you achieve from a dedicated workspace, there’s no reason you can’t keep the momentum going while you’re out and about.

The following list of tools and mobile apps will help you run your web design business—and tackle various tasks associated with it—even when you’re on the go.

11 Best Tools and Mobile Apps for the Web Designer on the Go

Let’s say you’re on vacation and feel inspired in the moment. Do you mentally bookmark what you saw or heard in the hopes you can put it into practice when you’re back at work?

Or let’s say you’re at the doctor’s office, stuck in the waiting room with nothing to do and a looming deadline. Do you allow yourself to get stressed with each lost minute of work?

Or perhaps you prefer having multiple devices from which you can work. Having a smart device that complements your desktop activities would really come in handy then, right?

If you’re going to do this—take advantage of the ability to work from anywhere you want as a web designer—then your smart devices need to be equipped with the right kinds of tools.

Here are the 11 best tools and mobile apps you should have installed on your device right now:

1. HoursTracker

HoursTracker is a free time-tracking app.

For some of you, this will come in handy if you bill design clients on a per-hour basis. For others, you can simply use this as a way to keep yourself accountable. If your goal is to work a certain number of hours in a day, a time tracker will keep you committed to it.

2. LastPass

LastPass is a password management tool that’s great at saving you time repeatedly logging into the same websites and apps.

Every time you enter a new password into your mobile device, LastPass will give you the option to securely store those credentials. What’s particularly nice about this app is that it also works for desktop, so you can use the same account across both platforms.

3. Asana

Asana is another one of those productivity apps that works well across all your devices.

So, let’s say you’ve gotten into the habit of managing all client details, project tasks, and timelines in your Asana desktop app. With a quick installation of the mobile app, you can take all that pertinent business information everywhere you go.

4. Evernote

Have you ever found yourself out somewhere and wished you had a pen and paper to take down something you just thought of? Evernote is a secure way to store these notes, audio recordings, uploaded files, and screenshots all in one place.

If you’ve previously relied on your mobile device’s various note, photo, and storage apps to store this kind of information, you’ll find Evernote incredibly helpful in consolidating all your web design-related content into one location.

5. Google

Google Apps are a must-have for anyone wanting to quickly and securely communicate with team members, partners, and clients. Your access to Google Apps extends beyond Gmail, too.

This will enable you to continue creating documents, storing files in shared locations, and communicating with others no matter where you are.

6. Adobe Scan

Adobe has a fantastic set of mobile applications web designers should be taking advantage of. The first is Adobe Scan.

With this app, you can copy and convert any image into a PDF. This would be great for storing receipts from work-related travel. You could use this to scan hand-drawn wireframes or sketches. You could even use this to capture a prospective client’s business card on the fly, so you have a digital copy of their contact information for later.

7. Adobe Fill & Sign

When you’re outside of the office, that doesn’t mean all business dealings have to stop.

If you’re ready to get that next client project off the ground, Adobe Fill & Sign allows you to upload formal contracts and sign them, all from your mobile device.

8. Adobe Capture CC

Adobe Capture CC is perhaps my favorite mobile app for web designers.

As you can see, there are a number of things you can do with photos you’ve taken or uploaded to the app:

Two of the more interesting features, are Type and Colors. With Type, the app will zero in on any text that exists within the chosen photo. It will then display what it believes to be the matching typeface.

If you see really cool signage, flyers, bumper stickers, or anything else that catches your eye, you can use this mobile app to quickly decipher it for you. The Colors feature is another really neat one for web designers. When an image is uploaded to the tool, it will automatically select a complementary color palette.

This is not only great for using real-world settings as inspiration in your work, but it’s great for quickly generating color palettes.

9. Canva

With Canva, you can create all sorts of marketing and social media collateral.

Canva isn’t necessarily a tool you’ll be using for website design work. However, if you handle other marketing and design tasks for clients, this would be helpful to have on you at all times.

10. InVision

InVision may be a tool you already use to enhance your web design workflows.

With this mobile app, you can build prototypes and sketches and share them with your team and clients. It’s not only a great design tool, but it’s especially helpful when it comes to more effectively communicating and collaborating.

11. Dribbble

Dribbble’s mobile app is another tool every web designer should keep on hand.

Even though you’re out of the office, you can still look to a site like Dribbble for quick inspiration or for easy access to templates.

Wrap-Up

In summary, when you load up your mobile device with tools and apps for business, they should help you:

Communicate in real-time (or, at the very least, more quickly).
Provide high-quality work to clients even when you’re out of the office.
Maintain consistency between the work you do at home and the work you do on the road.
Stay productive even when you’re not surrounded by a distraction-free workspace.

If you’re hoping to make the most out of freelancing life (and digital nomadery), set yourself up with these must-have mobile apps for greater productivity and success.

Add Realistic Chalk and Sketch Lettering Effects with Sketch’it – only $5!

Source

p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}

Creating Flexible Layouts with Flexbox

Original Source: https://www.sitepoint.com/creating-flexible-layouts-with-flexbox/

The following introduction to Flexbox is an extract from Tiffany’s upcoming book, CSS Master, 2nd Edition, which will be available shortly.

Before CSS Grid came along, there was Flexbox (which is officially known as the CSS Flexible Box Layout Module). Flexbox was designed to manage layout in one direction—a row (flex-direction: row or row-reverse) or a column (flex-direction: column or column-reverse). That’s in contrast to Grid, which accounts for rows and columns.

A basic flexible box layout is simple to create: add display: flex or display: inline-flex to the containing element. These values for display will trigger a flex formatting context for that containing element’s children. As with Grid, both flex and inline-flex are inside display modes. We set these values on the container, which behaves like a block-level or inline-level box, respectively. The children of that container are then arranged according to the rules of flex layout.

Note: Older versions of Blink-based browsers such as Chrome (≤ 28), and WebKit-based browsers like Safari (≤ 8), require a vendor prefix. If your project still supports those browsers, you’ll need to use display: -webkit-flex or display: -webkit-inline-flex. Older versions of Firefox (≤ 21) also require a prefix. Use -moz-flex and -moz-inline-flex to support those browsers.

By adding display: flex or display: inline-flex to a containing element, its immediate children become flex items, as shown in the image below. Flex items may be element children or non-empty text nodes. For instance, the markup below generates three flex item boxes that each behave according to the rules of flex layout:

<div style=”display: flex”>
<span>This text is contained by a SPAN element.</span>
<b>This text is contained by a B element.</b>
This text node is still a flex item.
</div>

If no other properties are set, each flex item will have the same height as its tallest element (as determined by content). It will also stack horizontally (or vertically when the document has a vertical writing mode) without wrapping, and with no space between the edges of each box. Flex items may overflow the container.

A list with display: flex applied to the ul containing elementA list with display: flex applied to the ul containing element

This may not seem like such a big deal, but it simplifies the code necessary for a range of user interface patterns. Let’s look at a couple of examples.

A New Media Object Component

Take the following media object code:

<div class=”media__object”>
<img src=”video-thumb1.jpg”>
<div class=”media__object__text”>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>

Before Flexbox, we might have paired the preceding markup with the following CSS:

.media__object img {
float: left;
height: auto;
width: 150px;
}
.media__object__text {
padding-left: 170px;
}
/* Let’s use the clearfix hack! */
.media__object::after{
content: ‘ ‘;
display: block;
clear: both;
}

This layout works, but it has one major drawback: it requires us to constrain the width of our images so that we know how much padding to use. That limits our ability to use this same component in multiple contexts. You may want an image 150px wide when this component is used for a “Related Stories” widget, and one that’s only 75px wide for comments.

Let’s try this using Flexbox. Here’s our updated CSS:

.media__object {
display: flex;
}
.media_object img {
margin-right: 20px;
}

That’s a lot less CSS. An added bonus is that we don’t have to worry about how wide or tall our image is. Nor do we have to concern ourselves with clearing floats. Whether the image is 200px wide or 20px wide, .media__object__text will abut the margin box of our img element.

The post Creating Flexible Layouts with Flexbox appeared first on SitePoint.

How To Build A News Application With Angular 6 And Material Design

Original Source: https://www.smashingmagazine.com/2018/10/news-application-with-angular-and-material-design/

How To Build A News Application With Angular 6 And Material Design

How To Build A News Application With Angular 6 And Material Design

Rachid Sakara

2018-10-03T12:00:26+02:00
2018-10-03T10:16:38+00:00

Are you looking to combine Google’s material design with Angular applications? Well, look no further!

In this tutorial, we’re going to build a news application using two of the most powerful and popular resources out there, Angular 6 and material design. You’ll learn how to incorporate Google’s material design components into Angular application templates to change and style your application in a professional way. The tutorial also serves as a reminder of how to make HTTP requests to bring live news articles to an application using the News API.

Before we get started building the app, let’s quickly review the resources we’re going to use, Angular and material design, and see why we’ve paired them to build this application?

A news application with Angular 6 and Material Design

A news application with Angular 6 and Material Design. (Large preview)

What Is Angular?

Angular — according to the official documentation — is described as follows:

“Angular is a platform that makes it easy to build applications with the web. Angular combines declarative templates, dependency injection, end-to-end tooling, and integrated best practices to solve development challenges. Angular empowers developers to build applications that live on the web, mobile, or the desktop.”

In short, it’s the most powerful JavaScript framework for building highly interactive and dynamic web applications.

“As mentioned, Angular is powerful, but also popular, which is why companies such as Upwork, Freelancer, Udemy, YouTube, Paypal, Nike, Google, Telegram, Weather, iStockphoto, AWS, Crunchbase are using it.”

Front-end is messy and complicated these days. That’s why we publish articles, printed books and webinars with useful techniques to improve your work. Even better: Smashing Membership with a growing selection of front-end & UX goodies. So you get your work done, better and faster.

Explore Smashing Membership ↬

Smashing Cat, just preparing to do some magic stuff.

What Is Google’s Material Design?

Material design is a design language introduced by Google in the summer of 2014 for Android’s new OS. Although its initial focus was touch-based mobile apps, now its functionality has been extended to reach the web design world.

It’s an adaptable system of guidelines, components, and tools that support the best practices of user interface design. It’s also backed by open-source code and supported by a large community of designers and developers who are collaborating together to build beautiful products.

Why Angular And Google’s Material Design Specifically?

It’s a matter of choice. No JavaScript framework is better than another. It’s all about what your project needs. The same goes for programming languages.

Now, I’m not going to outline the benefits and features of Angular. Instead, I’m going to share with you why I’ve picked Angular specifically to build a news application.

As is always the case with any news application, communicating with back-end services over the HTTP protocol is a crucial part. This is where the newer Angular HttpClient module, which is an improved version of the old Http, can help us easily interact with the service API.

The model-view-viewmodel (MVVM) of Angular will be handy when it comes to binding the remote data that will be stored in objects into our application template, where the component plays the part of the controller/viewmodel and where the template represents the view. This is what we call the Angular template language.

The two-way binding system, which means that any changes in the application’s state will be automatically reflected into the view, and vice versa. You’ll notice that when selecting the news resources from the side menu, that will change the state of our news article.

What I like most about Angular is the SPA technology. Loading only the part of the page that needs to be changed will definitely help our application load and perform more quickly and smoothly.

Of course, there are many other benefits and features of Angular, which you can look up with a quick online search.

What About The Visual Aspect?

We’ve chosen material design because its language is a suitable fit for Angular, and it’s easy to implement.

It’s also a very popular visual language; it’s responsive, and most Google apps are built with it. We want our app to look as much like a Google app as possible.

As an introduction, that’s all we need. It’s time to look at the project overview and then jump into the build process.

Project Overview
Prerequisites
Setting Up An Angular Project
Installing Dependencies
Acquiring Free API Key
Working On Components
Defining Material Default Style
Define A Template
Conclusion

Project Overview

“Getting the latest live news articles from a range of sources, including BBC News, CNN, TechCrunch, Huffington Post and more, along with different categories, like technology, sports, business, science and entertainment.”

This is how your application will look when you finish it:

A news application overview

Project overview. (Large preview)

That should get you excited, shouldn’t it? Let’s start by building the app.

Prerequisites

This is what you’re going to need in order to follow along with this tutorial:

Node.js and npm installed on your machine;
Angular CLI installed on your machine;
A basic understanding of Angular.

Once that stuff is out of the way, we can proceed.

Setting up the Angular Project

In this section, we’re going to use the Angular command line interface (CLI) to generate a new Angular project. To do so, head over to the CLI and run this:

ng new news-app

Next, point your command line to the project’s root folder by running the following:

cd news-app

Installing Dependencies

To set up our dependencies, we’re going to install, with just one command, all of the dependencies necessary for this tutorial. Don’t worry, I’ll explain this in a second:

npm install –save @angular/material @angular/animations @angular/cdk

We have three packages being installed with this command.

@angular/material

This is the official material design package for the Angular framework.

@angular/animations

Installing the Angular animation package separately from the Angular core library is necessary. Certain material components need access to the animation libraries, which is why we’re installing it here.

@angular/cdk

The CDK part stands for “component dev kit”, which provides us with high-quality predefined behaviors for your components, since modern web development is all about components.

It is recommended to include the Angular CDK any time you want to link Google’s material design to an Angular application.

To find out more about Angular CDK, check out this article.

Let’s run our app to see that everything works just fine. You can start a development server by running the following command:

ng serve

Now, if you visit http://localhost:4200/ in a browser, you should see the following page:

Welcome to news app

Running the Angular project on development server. (Large preview)

Now, in your code editor, navigate to the file /src/app/app.module.ts, and add the following packages that we’ve just installed:

… Other imports …
import { BrowserAnimationsModule } from ‘@angular/platform-browser/animations’;
import { MatButtonModule, MatCardModule, MatMenuModule, MatToolbarModule, MatIconModule, MatSidenavModule, MatListModule } from ‘@angular/material’;

It is important to understand what’s going on here. First, we’re importing the animations package to animate our application a bit.

The next import is what’s unique to Angular material. Before, we just included a single material module. Now, we have to import each material component that we intend to use.

As you can see, we’ve added seven different modules here for material buttons, cards, menus, lists toolbars, side navigation, and icons.

After adding those packages to your app.module.ts file, make sure that your file matches the following:

import { BrowserModule } from ‘@angular/platform-browser’;
import { NgModule } from ‘@angular/core’;
import { HttpClientModule } from ‘@angular/common/http’;
import { NewsApiService } from ‘./news-api.service’;

import { BrowserAnimationsModule } from ‘@angular/platform-browser/animations’;
import { MatButtonModule, MatCardModule, MatMenuModule, MatToolbarModule, MatIconModule, MatSidenavModule, MatListModule } from ‘@angular/material’;

import { AppComponent } from ‘./app.component’;

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
MatButtonModule,
MatMenuModule,
MatCardModule,
MatToolbarModule,
MatIconModule,
MatSidenavModule,
MatListModule,
],
providers: [NewsApiService],
bootstrap: [AppComponent]
})
export class AppModule { }

Note: The statement import { HttpClientModule } from @angular/common/http in the file above wasn’t generated automatically, but rather added manually. So, make sure you do that, too. And don’t worry about the NewsApiService service provider because we’re going to take care of that later on.

You might be wondering, though, how did I know the names of the modules to import? The official Angular material documentation gives you the exact code needed to import each module.

If you click on any of the components in the left menu and then click on the “API” tab, it provides you with the exact import line that you need to use.

API reference for Angular Material Components

API reference for Angular Material Component. (Large preview)

In terms of setup, that’s all we need to do before we actually begin using and integrating material components in our templates.

You just have to remember to import each unique component that you plan to use.

Acquiring Free API Key

We’re going to use the News API to feed us some news headlines as JSON data, which we’ll implement in the application template.

What is the News API service?

The News API is a simple HTTP REST API for searching and retrieving live articles from all over the web.

Now that you know what the News API is, the next step is to get a free API Key, which will help us make some call requests to the server and grab the news articles.

You can sign up for just 30 seconds. You’ll only need to provide your first name, email address, and password. That’s all.

After signing up, you’ll find the API key already generated for you in the dashboard. Just save it in a text file somewhere on your desktop; because we’ll use it in the next chapter.

Working On The Components

To start working on the components, you need to create a service provider to manage the interaction with the News API service.

Creating The Service Provider

Enter this command to generate a new service provider:

ng generate service NewsApi

After that, go to the generated /src/app/news-api.service.ts file, and add the following code to it:

import { Injectable } from ‘@angular/core’;
import { HttpClient } from ‘@angular/common/http’;

@Injectable({
providedIn: ‘root’
})
export class NewsApiService {

api_key = ‘PUT_YOUR_API_KEY_HERE’;

constructor(private http:HttpClient) { }
initSources(){
return this.http.get(‘https://newsapi.org/v2/sources?language=en&apiKey=’+this.api_key);
}
initArticles(){
return this.http.get(‘https://newsapi.org/v2/top-headlines?sources=techcrunch&apiKey=’+this.api_key);
}
getArticlesByID(source: String){
return this.http.get(‘https://newsapi.org/v2/top-headlines?sources=’+source+’&apiKey=’+this.api_key);
}
}

It’s time to use our API Key. Just paste it where it says, “Put_YOUR_API_KEY_HERE”.

We’ve imported HttpClient, which will be responsible for making API calls to our endpoints and fetching news headlines for us.

Now, for the initSources function, we simply prepare our left-side menu with some news resources. After that, we’ve created another function, initArticles which retrieves the first articles from TechCrunch once the application gets started.

As for the last function, getArticlesByID, it’s going to simply bring some articles for the passing parameter.

The Main Component

The service provider is done. Let’s move to the /src/app/app.component.ts file and add this code:

import { Component } from ‘@angular/core’;
import { NewsApiService } from ‘./news-api.service’;

@Component({
selector: ‘app-root’,
templateUrl: ‘./app.component.html’,
styleUrls: [‘./app.component.css’]
})
export class AppComponent {

mArticles:Array;
mSources:Array;

constructor(private newsapi:NewsApiService){}

ngOnInit() {
//load articles
this.newsapi.initArticles().subscribe(data => this.mArticles = data[‘articles’]);
//load news resources
this.newsapi.initSources().subscribe(data=> this.mSources = data[‘sources’]);
}

searchArticles(source){
this.newsapi.getArticlesByID(source).subscribe(data => this.mArticles = data[‘articles’]);
}
}

We’re defining two properties here: mArticles, for holding news articles, and mSources, for holding news resources. Both are defined as an array.

In the constructor, we’re simply creating a NewsAPIService instance.

Next, we’re using that instance on the ngOnInit() function to initialize our two properties.

For the searchArticles function, it will be triggered whenever the user selects a specific resource from the left-side menu. Then we’re passing this parameter to the getArticlesByID service provider function to retrieves articles for it.

Defining Material’s Default Style

In our /src/styles.css file, which is generated by the Angular CLI, let’s add the following:

@import ‘~@angular/material/prebuilt-themes/indigo-pink.css’;
body {
padding: 2em 23em;
background:lightgray;
}

Based on your preference, you can change indigo-pink.css to:

deeppurple-amber.css
indigo-pink.css
pink-bluegrey.css
purple-green.css

I’m also adding some CSS to the body tag, only to demonstrate this layout. This helps it look more like an app, even on desktop.

Let’s also add two lines to our /src/index.html file just before the closing head tag:

<link href=”https://fonts.googleapis.com/icon?family=Material+Icons” rel=”stylesheet”>
<link rel=”stylesheet” href=”https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic”>

The first line imports the material design icon font, and the second one is the Roboto font, which is used by the material design team.

Defining A Template

Let’s start off by adding the following template in the /src/app/app.component.html file:

<mat-toolbar color=”primary”>
<button mat-button (click)=”sidenav.open ()” ><mat-icon>menu</mat-icon></button>
<span>News Headlines</span>
<span class=”example-spacer”></span>
<button mat-button [matMenuTriggerFor]=”appMenu”><mat-icon>settings</mat-icon></button>
</mat-toolbar>
<mat-menu #appMenu=”matMenu”>
<button mat-menu-item> Settings </button>
<button mat-menu-item> Help </button>
</mat-menu>
<mat-sidenav-container class=”example-container”>

<mat-sidenav #sidenav class=”example-sidenav”>
<mat-list class=”list-nav”>
<mat-list-item class=”list-item” *ngFor=”let source of mSources” (click)=”searchArticles(source.id);sidenav.close();”>

<div mat-card-avatar [ngStyle]=”{‘background-image’: ‘url(../assets/images/’+ source.id +’.png)’}” class=”example-header-image”></div>

<span class=”source-name”> {{source.name}}</span>

</mat-list-item>
</mat-list>
</mat-sidenav>
<mat-card class=”example-card” *ngFor=”let article of mArticles”>
<mat-card-header>
<div mat-card-avatar [ngStyle]=”{‘background-image’: ‘url(../assets/images/’+ article.source.id +’.png)’}” class=”example-header-image”></div>
<mat-card-title class=”title”>{{article.title}}</mat-card-title>
<mat-card-subtitle>{{article.source.name}}</mat-card-subtitle>
</mat-card-header>
<img mat-card-image class=”img-article” src={{article.urlToImage}} alt=””>
<mat-card-content>
<p>
{{article.description}}
</p>
</mat-card-content>
<mat-card-actions class=”action-buttons”>
<button mat-button color=”primary”><mat-icon>thumb_up_alt</mat-icon> 12 Likes</button>
<button mat-button color=”primary”><mat-icon>comment</mat-icon> Comments</button>
<button mat-button color=”primary”><mat-icon>share</mat-icon> Share</button>
<a mat-button color=”primary” href={{article.url}} target=”_blank” ><mat-icon>visibility</mat-icon> More</a>
</mat-card-actions>
</mat-card>
</mat-sidenav-container>

So, what have we done here?

First, we define a toolbar with a left-side menu, along with the application’s main title and the settings’ right menu.

Next, we’re using *ngFor for both sources and articles, and in doing so, our left-side menu will hold the news resources, and the main contents will hold the news articles.

One thing to notice is that on the click event of our list items, we’ve added two functions because that event executes any JavaScript code. The first function is searchArticles, which we’ve already explain, and the second one is sidenav.close() which will automatically close our left-side menu once the user has selected a resource.

Styling Our Component

The last thing to do with the components is to visit the /src/app.component.css file and paste the following code in it:

.example-spacer {
flex: 1 1 auto;
}

.example-card{
margin-top: 4px;
}

.example-header-image {
background-size: cover;
}

.title{
font-weight: bold;
}

.img-article{
height: 350px;
}

.action-buttons{
text-align: center;
}

.example-container {
width: 100%;
height: auto;
border: 1px solid rgba(111, 111, 111, 0.50);
}

.example-sidenav-content {
display: flex;
height: 75%;
align-items: center;
justify-content: center;
}

.example-sidenav {
padding: 20px;
}

.source-name {
margin-left:5px;
}

.list-item:hover{
cursor: pointer;
background-color: #3f51b5;
color: white;
}

Set Up Images For News Resources

Move to the /src/assets directory, and create a new folder named images. Then, download these images either from a Google Drive link or the GitHub repository.

They are the logos of our news resources. Once you download them, copy and paste all of the image files into the images folder that you just created.

Once everything is complete, run this:

ng serve

Now, your app should look like the screenshot below. Pretty awesome, huh!

the news application final product

Launching the app after everything is complete. (Large preview)

Note that when the news snippets are loaded on the main page, a “More” button (as you can see in the picture above) takes the user to read the whole story.

Conclusion

There you have it! I hope this tutorial was useful and that you’ve enjoyed building this application. If so, feel free to leave your feedback and comments below. In the meantime, the Angular Material documentation is pretty cool. It provides you with an overview of each component, an API and an example.

The entire source code of this app is available on GitHub. You can also check out this website, which already implements the service API used in this tutorial.

Smashing Editorial
(ra, al, yk, il)

AWS, Azure & Google Cloud Backup Solutions Compared

Original Source: https://www.sitepoint.com/aws-azure-google-cloud-backup-solutions-compared/

Cloud backup is a form of cloud storage where data is stored and then retrieved from different distributed and interconnected cloud-based resources. Cloud-based backup solutions allow businesses and enterprises as well as individuals to safely store their data on the internet via a storage service provider.

This cloud-based storage solution can be used instead of storing data locally on a physical disk like a hard drive. Cloud backup also allows users to access the provider's services remotely via a secure client login application. This can be used to back up files either from the user's computer or data center onto the online storage server by way of a secure and encrypted connection.

In this article, we're going to dig deep into various characteristics of cloud pricing. We'll primarily focus on the top three cloud platforms – Google, Azure and AWS. We'll have a look at some of the factors like their features and capabilities, pricing, support and documentation etc.

Features and Capabilities

All the cloud vendors offer a large array of features and backup solutions. Let's have a look at what the top three offer.

Microsoft Azure

Microsoft Azure backup can be used to backup, protect as well as restore your data in the Microsoft Cloud. It replaces any existing on-premise, local or off-site backup solution by deploying a cloud-based reliable and secure solution.

Microsoft Azure has a number of different components that can be downloaded and deployed either on the appropriate server or computer or in the cloud. Irrespective of what you want to protect, all backup components provide users with the ability to back up data to a Recovery Services vault provided by Azure.

Some of Microsoft Azure's key features include:

Automatic Storage Management
Unlimited Scaling
Multiple Storage Options
Unlimited Data Transfer
Data Encryption
Application-Consistent Backup, and
Long-Term Retention

Amazon Web Services S3

Amazon S3 or Simple Storage Service was designed keeping developers in mind and with the aim to help them build cloud computing tools.

Among the different cloud storage services available, only few can compare with the number of data center regions globally as Amazon S3 – 14. This is because AWS S3 shares the same infrastructure being used by Amazon's shopping platform.

Given the global presence of its data center regions, AWS S3 allows users to select a region near them or a region close to where most of their web traffic originates. The benefit here is that it enables quicker transfers to and from the cloud.

Some of AWS S3's key features include:

Durability and Availability
Flexibility and Scalability
Cost Effectiveness
Security
Compliance
Flexible Data Transfer
Largest Partner Ecosystem, and
Additional Backup and Restore Resources

Google Cloud Storage

Google Cloud Storage is an enterprise-focused public cloud storage platform where users can store large unstructured data sets. Organizations can purchase storage for either primary or infrequently required data.

As a service within the Google Cloud Platform, Google Cloud Storage allows unified object storage for live as well as archived data. Objects that have been stored here are grouped into buckets or containers within the cloud and can be individually assigned to different storage classes.

Users can access their data via a web browser or a command line interface. Similar to AWS S3, Google Cloud Storage also gives users the option to select the geographical location where they prefer their data stored.

Some of Google Cloud Storage's key features include:

Single API across storage classes
High availability across all storage classes
Ability to scale to exabytes of data
Time to first byte measured in milliseconds
Strongly consistent listing, and
Designed for 99.99% durability

Which one should you choose?

AWS is the most popular choice for cloud backup solutions. It provides temporary storage which is allocated when an instance is started and is destroyed when the instance is terminated. It also provides Block Storage which is equivalent to hard disks, i.e., you have the choice to either attach it to any instance or keep it separate.

Additionally, AWS also provides object storage as part of its S3 Service as well as archiving services with Glacier.

Service Provider
Temporary Storage
Block Storage
Object Storage

Amazon S3
Yes
EBS
S3

Microsoft Azure
Temporary Storage – D Drive
Page Blobs
Block Blobs and Files

Google Cloud Storage
Yes
Persistent Disks
Google Cloud Storage

Cloud Pricing

Each of the three services offers outstanding scalability and use the monthly cost-per-GB model. This makes comparisons between the three extremely easy. There are a certain amount of variations among the services mainly coming from the complexity of the different storage classes involved and how storing data in one class vs. another can impact rates. Here is a little more detail on the pricing front for each of the three service providers.

Microsoft Azure

Microsoft Azure's storage rates are based on the amount of storage you need, your geographical location, how frequently you need to access the stored data and the kind of data redundancy you choose. Though sophisticated, Azure's pricing model allows users to control costs when appropriately managed.

The table below illustrates the prices for blob storage for a data center located in the Eastern United States –

LRS – Cool
LRS – Hot
GRS – Cool
GRS – Hot

First 50 TB per month
$0.0152
$0.0208
$0.0334
$0.0458

Next 450 TB per month
$0.0152
$0.0200
$0.0334
$0.0440

Over 500 TB per month
$0.0152
$0.0192
$0.0334
$0.0422

*LRS – Local Redundant Storage. LRS allows for multiple and synchronous copies of your data to be stored in a single data center.

**GRS – Geographically Redundant Storage. GRS is used to store a second synchronized set of your data in a different data center hundreds of miles away from the first. The benefit is that GRS provides an additional layer of redundancy enabling quicker access times for users in a different geographical location.

If you want to cut down pricing, there are third-party vendors for the Azure platform that offers low priced backup solutions that are optimized for a category of users. Nimble, HPE and NetApp are popular in that regard.

Amazon S3

Amazon S3 provides a lot of the similar flexibility for scaling storage as Azure. Users are charged for storage used with no upfront costs or termination fees.

The most substantial difference between Amazon S3 and Microsoft Azure lies in the fact that, unlike Azure, Amazon S3 does not have multi-regional storage. However, S3 does provide a middle tier class between standard and archival storage. This is known as 'Standard-Infrequent Access.'

The table below illustrates the prices for storage in the Eastern United States (North Virginia) region:

Tier
Standard per gigabyte
Standard – infrequent access per gigabyte

First 50 TB / month
$0.023
$0.0125

Next 450 TB / month
$0.022
$0.0125

Over 500 TB / month
$0.021
$0.0125

Note: Costs may differ slightly by region, either intra-country or inter-country. However, intra-country cost differences usually amount to within a few cents.

The third-party AWS backup solutions offer low-priced storage volumes that you can deploy in a region of your choice. You can also set up VPC network for all your AWS resources. Some of the popular vendors for AWS backup include CyberDuck, CloudBerry and N2WS.

Google Cloud

With Google Cloud, users get the benefit of a nice mix of the different storage class options that Microsoft Azure and Amazon S3 offer. This makes Google Cloud fairly more scalable than the other two. The combination provided by Google includes multi-regional as well as regional options, a mid-range option known as 'nearline' and an archival option similar to Glacier, known as 'coldline'.

Here's a look at the costs that Google Cloud Storage charges:

Multi-regional per GB
Regional per GB
Nearline per GB
Coldline per GB

General pricing
$0.026
$0.020
$0.010
$0.007

Tokyo pricing
N/A
$0.023
$0.016
$0.010

An important aspect to keep in mind here is that Google Cloud Storage takes an approach similar to Microsoft Azure and Amazon S3 in that it does away with the option of variable pricing by region as well as tier based pricing per total GB stored.

The post AWS, Azure & Google Cloud Backup Solutions Compared appeared first on SitePoint.

macOS Mojave’s Stacks: Everything You Need to Know

Original Source: https://www.hongkiat.com/blog/macos-mojave-stacks-everything-you-need-to-know/

This post explains how to use macOS Mojave’s Stacks feature to its fullest to achieve clutter-free desktop.

The post macOS Mojave’s Stacks: Everything You Need to Know appeared first on…

Visit hongkiat.com for full content.

Learn How to Draw for Only $39

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/NHDDvrHY-j4/learn-how-to-draw-for-only-dollar39

You don't have to enrol in an expensive art institution in order to become an artist. Now, you can learn how to draw online using The Fundamentals of Drawing Bundle.

You'll learn how to create dynamic superheroes that are worthy of comic books; you'll master the art of figure, portrait, and animal drawing through step-by-step training, and you can learn at your own pace. There's also time to practise shading in order to truly bring your artwork to life.

Get The Fundamentals of Drawing Bundle for just $39 – that's 94 per cent off the regular price, and much cheaper than art school.

Related articles:

How to draw: the best drawing tutorialsHow to draw a faceHow to begin a figure drawing