How to Create a Reddit Clone Using React and Firebase

Original Source:

An inventor placing a FireBase heart into a robot creation

React is a fantastic front-end library for building user interfaces. When picking a back end to use alongside it, you can’t go far wrong with Firebase, a Backend-as-a-Service (Baas) that makes it easy to add data persistence (and much more besides) to your React app.

In this tutorial, we’ll be using Firebase along with Create React App to build an application that will function similarly to Reddit. It will allow the user to submit a new post that can then be voted on. I’ll also demonstrate how to deploy our Reddit clone to Vercel.

Once you’ve finished reading, you’ll understand how to set up Firebase, how to connect it to your React app and how to deploy the result.

An inventor placing a FireBase heart into a robot creation

Why Firebase?

One of Firebase’s strengths is that it makes it very easy for us to show real-time data to the user. Once a user votes on a link, the feedback will be instantaneous. Firebase’s Realtime Database will help us in developing this feature. Also, it will help us to understand how to bootstrap a React application with Firebase.

Why React?

React is particularly known for creating user interfaces using a component architecture. Each component can contain internal state or be passed data as props. State and props are the two most important concepts in React. These two things help us determine the state of our application at any point in time. If you’re not familiar with these terms, please head over to the React docs first.

Note: you can also use a state container like Redux or MobX, but for the sake of simplicity, we won’t be using one for this tutorial.

Here’s a live demo of what we’ll be building. The code for this application is available on GitHub.

Setting up the Project

To follow along, you’ll need to have Node and npm installed on your machine. If you haven’t, head to the Node.js download page and grab the latest version for your system (npm comes bundled with Node). Alternatively, you can consult our tutorial on installing Node using a version manager.

Let’s walk through the steps to set up our project structure and any necessary dependencies.

Bootstrapping a React App

We can create a new React application with the help of Create React App using the following command:

npx create-react-app reddit-clone

This will scaffold a new create-react-app project inside the reddit-clone directory. Our directory structure should be as follows:

Default structure of directory

Once the bootstrapping is done, we can enter the reddit-clone directory and fire up the development server:

cd reddit-clone && npm start

At this point, we can visit http://localhost:3000/ and see our application up and running.

Default page of Create React App

Structuring the App

It’s always a good practice to remove all the files that we don’t need after bootstrapping any application. There are a few files generated by Create React App that we won’t need, so we’ll remove them.

We can remove the following files:


We can also remove the following dependencies from our package.json file:


We can also remove the test script from our package.json file. This is because we won’t be writing any tests for our application. If testing a React app is something you’d like to look into, please consult our tutorial, “How to Test React Components Using Jest”.

Our src/index.js file should contain the following:

import React from “react”;
import ReactDOM from “react-dom”;
import App from “./app”;

<App />

We’ll rename our src/App.js to src/app.js. Alter it to contain the following:

import React from “react”;

function App() {
return <div>Hello world!</div>;

export default App;

Now, we can restart our development server using the following command from our root directory:

npm start

Our development server should be up and running on http://localhost:3000/ and it should look like the following:

The UI of our application after removing unnecessary files

Creating a New Firebase Project

In this section, we’ll be installing and integrating Firebase with our application.

If you don’t have a Firebase account, you can create one free account now by visiting their website. After you’re done creating a new account, log in to your account and go to the console page and click on Create a project.

Enter the name of your project (I’ll call mine reddit-clone), accept the terms and conditions, and click on the Continue button.

Step 1 of creating a Firebase project

In the next step, you should choose whether to enable Google Analytics for the project, then click on the Continue button.

Step 2 of creating a Firebase project

In step three, we should select a Google Analytics account and then click on the Create project button:

Step 3 of creating a Firebase project

After a short while, you’ll see a notice that your new project is ready. Click Continue to exit the wizard.

Creating a New App in the Firebase Project

In this section, we’ll be creating a new Firebase app from the Firebase console. We can create a Web app by selecting the web option.

Creating a new Firebase web app: Step 1

Next, we’ll need to enter the name of the project and click on the Register app button, leaving the Also set up Firebase Hosting checkbox unchecked.

Creating a new Firebase web app: Step 2

Now you’ll see all the credentials for our new Firebase web app.

Creating a new Firebase web app: Step 3

Make a note of these credentials and click Continue to console.

We can now add our app’s credentials to an environment file:

// .env


Note: it’s always a good idea to store all credentials in an environment file and add that file to .gitignore so that the credentials are never leaked into the source code.

Next, we can create a new file src/lib/firebase.js where we’ll store all our Firebase credentials:

import firebase from “firebase”;

const firebaseConfig = {
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.REACT_APP_FIREBASE_APP_ID,
measurementId: process.env.REACT_APP_FIREBASE_MEASUREMENT_ID,

const initFirebase = firebase.initializeApp(firebaseConfig);
const db = initFirebase.firestore();

export default db;

Finally, we’ll need to install the firebase package so that we can interact with our database:

npm install firebase

Continue reading
How to Create a Reddit Clone Using React and Firebase
on SitePoint.

20 Awesome Treehouses For Your Inspiration

Original Source:

Think treehouses are just backyard structures built for kids to play in? Well, think again. Constructed for different functions and in different forms, treehouses have the potential to be…

Visit for full content.

Useful Web Usability Testing Tools

Original Source:

Usability testing — also known as “user testing” — is a popular methodology for user experience researchers. It’s a critical part of the design process since it helps…

Visit for full content.

Collective #628

Original Source:

Collective 628 item image

The State of CSS Survey

The annual survey about the latest trends in CSS is now open. It’s available in many different languages.

Check it out

Collective 628 item image

This content is sponsored via Thought Leaders
Cut Your IT Bills in Half

Deploy more with Linux virtual machines, global infrastructure, and simple pricing. No surprise invoices, no lock-in, and the same price across 11 global data centers. Industry-leading price-performance. Shared, Dedicated, High Memory, and GPU instances plus S3-Compatible Object Storage, Managed Kubernetes, and more. $100 in cloud infrastructure credit.

Try Linode Free

Collective 628 item image

Faster Web App Delivery with PRPL

Learn all about PRPL, a pattern for structuring and serving web applications and Progressive Web Apps (PWAs) with an emphasis on improved app delivery and launch performance.

Read it

Collective 628 item image

CSS Background Patterns

Beautiful pure CSS background patterns that you can actually use in your projects. By MagicPattern.

Check it out

Collective 628 item image


Filmstrip is an online editor that helps you create CSS powered animations.

Check it out

Collective 628 item image

Vertex shader demo and code

A wonderful distortion vertex shader made by the great folks of Poimandres.

Check it out

Collective 628 item image

Build an Authenticated JAMstack App with Next.js, Airtable, Tailwind CSS, and Auth0

A compact version of a tutorial by James Q Quick based on a great video playlist where you’ll learn how to implement a JAMstack powered project.

Read it

Collective 628 item image

3,000 Hands 3D Shape Pack

A gigantic addition to the Shapefest 3D shapes with many different hand gestures.

Check it out

Collective 628 item image

Converting a jQuery plugin to vanilla JS: Lettering.js

Chris Ferdinandi demonstrates how to go about turning a jQuery plugin like Lettering.js into vanilla JavaScript.

Watch it

Collective 628 item image

A glowy plain text editor made by Adam Fuhrer.

Check it out

Collective 628 item image

Webpack 5 Headache

Sindre Sorhus on how Webpack no longer automatically polyfilling Node.js APIs is a huge breaking change and will inconvenience both users and package maintainers.

Read it

Collective 628 item image

Announcing Ionic Vue

Read about the release of Ionic Vue, a native Vue version of Ionic Framework that makes it easy to build apps for iOS, Android, and the web as a Progressive Web App.

Read it

Collective 628 item image

Wouter: A Minimalist Alternative to React Router

Read all about Wouter in this article by Nathan Sebhastian. Wouter is a minimalist routing library that implements only the most used functionality from React Router.

Read it

Collective 628 item image

Browse techniques, frameworks and artifacts to help young product teams move forward.

Check it out

Collective 628 item image


A super fun demo by Ryan Mulligan.

Check it out

Collective 628 item image

Tailwind CSS tutorial

A Tailwind CSS tutorial that covers the installation via a package manager, generating the configuration file, building a website and reducing the final CSS file.

Read it

Collective 628 item image

Bear gets an X-Ray w/ CSS Variables

A super cool Halloween demo powered by CSS and SVG. Made by Jhey.

Check it out

From Our Blog
Implementing WebGL Powered Scroll Animations

Learn some fun WebGL by reconstructing the beautiful scroll animations from Robin Noguier’s portfolio in this ALL YOUR HTML episode.

Watch it

The post Collective #628 appeared first on Codrops.

Inspirational Websites Roundup #19

Original Source:

Today I’d like to share another hand-picked selection of really great website designs that will definitely give you an inspirational boost for your creativity.

Big intro type is totally in and some experimental layouts are giving a nudge to conventional structures. Lines are à la mode this season, on buttons or just as decoration!

I hope this collection updates you on some current trends and gives you some fresh inspiration for your next projects.

Ville de Varennes

Project Turntable

adidas – CHILE20


Nahel Moussi

Simon Daufresne

Brews & Grooves

MUTEK Montreal




Gianluca Armenio



Celebrating 10 Years with Blind Barber

Mollydooker Wines

Discover The Bartlett Summer Show 2020

Our culture — Locomotive


Language Dept.


When we were kids

Æbele Interiors


Monsieur M

Robin Noguier

Mezcal Rosaluna

Glue Lock

Kirk Whayman


Glenn Catteeuw



Seal + Co Professional Accountants


The post Inspirational Websites Roundup #19 appeared first on Codrops.

Carácter Branding and Visual Identity

Original Source:

Carácter Branding and Visual Identity
Carácter Branding and Visual Identity


Lutton Gant, a photography studio in Valladolid (Spain), which specializes in weddings and family portraits, reached out to Azote. Studio to work on their new brand and visual identity with the goal of diversifying into a new identity that would answer photography queries for companies and professionals.

With the last boom in demand for this type of service, the objective for this new project was to better target its audience, help in the brand awareness and its new market consolidation.

Our challenge involved knowing the target audience in detail, with their expectations and needs, as well as the analysis of the specialized competition it faced.

Carácter graphic solution follows the principle of simplicity and minimalism, using a modernized timeless typeface, a monochrome palette and a flexible grid that gives prominence to their powerful work.


20+ Essential and Free Blogging Tools

Original Source:

Blogging can be quite a process. First, you may have to do some research, then put your thoughts together, and of course, add any necessary screenshots and images. Let’s not forget the…

Visit for full content.

Everyday Digital Art by Kurt Chang

Original Source:

Everyday Digital Art by Kurt Chang
Everyday Digital Art by Kurt Chang


Kurt Chang is an artist based in Los Angeles, CA, USA, he has been sharing pretty illustrations via his Behance. With this never-ending pandemic, I have noticed an increase in ‘digital art’ projects being shared. We all have on our way to deal with this ‘longer isolation’, maybe it wasn’t the full intention behind Kurt’s series but I thought it will be great to share so we can inspire each other. Looking at Kurt’s series as he calls it: ‘Daily Art’. They are amazingly illustrated, each illustration tells a daily story that is a reality or beyond his imagination. Give them a look.


Image may contain: cartoon, illustration and drawing

Image may contain: screenshot, computer and floor

Image may contain: painting, cartoon and child art

Image may contain: art and cartoon

Image may contain: red and floor

Image may contain: road, cartoon and way

Image may contain: person, painting and flower

Image may contain: footwear and cartoon


Exciting New Tools for Designers, October 2020

Original Source:

This month’s collection of new tools, resources, and freebies for designers is a smorgasbord of sorts. You’ll find everything from useful APIs to icons to tutorials to fonts.

Let’s get right into it, here’s what new for designers this month:

Tooltip Sequence

Now that your app or website is ready, you might need to help users engage with it. Tooltip Sequence is a simple JavaScript package that helps you create a series of small tooltips that will guide users through product features with a small description of what they need to know. It looks great and the best part is this tool saves you from having to create each tooltip description manually on each page and link them together.


Serenade allows you to free up your hands with voice coding technology. Use natural speech and stay productive with this tool that allows you to code without typing. It works across multiple coding languages and platforms. It’s as easy as “add function hello” and the tool knows what syntax to use.


Gazepass, which is still in beta, is a nifty API that allows for passwordless multi-factor authentication for any website or mobile app. It uses biometrics on any device or platform to make getting into apps or websites easier for users.


Filters.css is a CSS-only library to apply color filters to website images. Installation only takes three steps and includes a variety of filers, such as blur, grayscale, brightness, contrast, invert, saturate, sepia, and opacity.

Sidebar Webring

Sidebar Webring is a collection of blogs and websites that are focused on web design. The curated list is handpicked for superb content for designers and developers. But, what’s a webring? It’s a collection of linked websites in a circular structure that are organized around a theme. The term is a throwback to the early days of the web in the 1990s and 2000s.

Wicked Templates

Wicked Templates is a set of responsive HTML templates made with Bulma and Tailwind CSS that you can style and use as you wish. Use these templates to jumpstart projects. Free and paid options available.

WP Umbrella

WP Umbrella will help you keep sites running in a healthy and safe manner on WordPress. Monitor uptime and performance, PHP errors, and keep up with hundreds of websites from one dashboard.


Servicebot helps you create customer-facing embeddable billing pages that work with Stripe payments. This premium tool is quite user-friendly and works with websites or SaaS.

Custom, Accessible Checkboxes with Perfect Alignment

Create custom, accessible checkboxes with perfect alignment every time. This walkthrough shows you how to use CSS to align elements and labels. is a nifty tool that creates 3D object shadows. Use the easy on-screen controls to get just the right orientation and shape.


Urlcat is a tiny JavaScript library that helps you build URLs with dynamic parameters and without mistakes. The friendly API has no dependencies, includes TypeScript types, and is just 0.8KB minified and gzipped.


Reacher is a real-time email verification API that lets you check the validity of an address before you send the email. Reduce bounce rates in an instant. (The personal version is free.)


Swell is a most powerful headless ecommerce platform for modern brands, startups, and agencies. Create fast and flexible shopping experiences with the API and headless storefront themes. This is a premium tool but does have a free trial.

No Code Founders 2.0

No Code Founders 2.0 is a platform for discovering the latest startups built with no-code and the tools used to build them. Browse startups, tools, perks, interviews, jobs, meetups, posts, and more as part of the no-code movement. The community engages on Slack and requires an email to sign up.

How to Pick More Beautiful Colors for Your Data Visualizations

Beautiful color choices will make your data visualizations that much more impactful. This tutorial by Lisa Charlotte Rost will help you make better color choices on the way to better infographics and charts. Plus, it’s well developed, designed, and packed with useful information.


IconPark is a collection of more than 1,200 high-quality icons with an interface that allows you to customize them. It uses a single SVG source file that can be transformed into multiple themes. The library includes cross-platform components and is free to use.

Mono Icons

Mono Icons is a simple and consistent open-source icon set that uses mono spacing. The collection includes 136 icons.


BGJar is a free SVG background generator for digital projects. Pick a category and customize the result to fit your project or needs.


HitCount is almost too simple to be true. This tiny tool lets you add a hit counter to your website that’s as easy as adding an image. Copy the code and make any customizations you want. Then paste it to your design. That’s it!


Blacklight is a real-time website privacy inspector. The tool by Surya Mattu scans any website you enter in the scan bar and shows what user-tracking technologies are used on the website. This allows you to see who might be gathering data about your visit.


Alter is a customizable – and experimental – three-dimensional typeface that you can experiment with. It’s as fun to play with as use.

Autobus Omnibus

Autobus Omnibus is a simple all capitals font with new wave styling. The character set has 96 glyphs that are perfect for display use.


Deathmatch is a seasonal blackletter font that’s ideal for the upcoming Halloween holiday. The character set includes plenty of options and there’s a full version (paid) for commercial use.

Futura Now

Futura Now is a premium typeface and update to a font you may already know and love. The new version has 107 styles in a massive family.

Pumpkin Soup

Pumpkin Soup is a fun almost handwriting style typeface with a cartoonish vibe. It includes a regular and italic style and is most appropriate in limited use.


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;}

Branding 101: Choosing the Right Business Name

Original Source:

When starting a new business (or even venturing into the world of freelancing for the first time), there are some really big, important steps you have to take.

Step #1 is choosing the right business name for your brand identity.

Your business name isn’t something you can casually choose either — especially if you have lofty long-term goals for your company. It’s not as though you can’t change the name down the road, but that comes with a ton of work and will require you to rebuild pretty much everything all over again: your visual brand identity, your reputation, and your SEO…

So, it’s a good idea to spend time choosing a business name that’s going to work for you now and long into the future.

Today, we’re going to go through the process of how to name your brand. These questions will have you thinking beyond just “What name do I like the sound of?” and have you more focused on important questions like “What is my unique value proposition?”.

Let’s get started:

How to Name Your New Business

For those of you considering taking the easy way out and using a business name generator tool, let me show you why that’s a bad idea:

This is a list of business names suggested to me when I told the generator that my business is related to “design”:

Normal Design
Regional Design
Design Partner
Design Stock

Even the more unique names on the list are unusable; they have no connection to me personally or to the kind of business I plan to start.

This is why it’s so important to sort out your brand identity and make sure you pick a business name that resonates with you, and your target audience. To do this yourself, answer the following seven questions:

1. What Services Will You Provide Or Products Will You Sell?

The one thing that name generators get right is including a descriptive word related to your business. That way, it doesn’t take an actual visit to your website or a look through your portfolio to figure out what you do.

Even if you have a very niche specialty, sum up your offering in one or two words. For instance:

Web design
Digital design
Design & development
UX design
Graphic design

Unless you run your business through your own name (which I’ll talk about shortly), your business name should include a simplified version of your offering in it.

2. Who Is Your Target User Persona?

A user persona is a fictional character created using the demographics and psychology of your ideal customer or client. You can use Hubspot’s Make My Persona generator to create a card that documents these details:

Once you sort out who you serve, what makes them tick, and how it fits into the bigger picture of their business, you can better pitch your solution to them.

For instance, Joanna above is a real estate agent and owner whose primary goal is to capture leads and generate sales. You know how effective a real estate website can be for improving an agent’s visibility online and streamlining how they earn money.

So, including words in your business name that speak to that persona as well as their goals might be really useful.

Just keep in mind that web designers don’t always commit to one niche or stick with the same niche over the long run. So, you might not want to make your business name too specific to an industry (e.g. “Real Estate Design Solutions”) and more related to higher level themes and goals.

3. What Are The Names Of Your Top Competitors?

Do you know who your main competitors will be upon entering this space? If not, now’s the time to look them up.

When it comes to business names, you want to see if you can identify common threads among them. Perhaps they use puns or include location-specific descriptors. Or they just stick with the names they were born with.

While you don’t want to come off as a copycat, you can imbue your business name with a similar theme or tone if it’s proven to be successful with your shared audience. 

4. What Makes You Different?

Every business has a unique value proposition (UVP) — something that sets them apart from everyone else in the space. What’s yours?

Do you operate within a large metropolitan area where your prospective clients’ industry is booming?

Did you previously work in the industry for which you now build websites?

Are you an SEO expert who builds enterprise websites that rank?

In business, it’s good to be different — so long as it benefits your clients.

If you have a particular UVP that’s going to make you stand out, you’re going to use it everywhere to market yourself — your website, social media, sales pitches, etc. So, you might want to consider using a unique keyword from it within your business name.

5. Where Do You Envision Yourself In Five Years?

No one’s future is set in stone. However, if you’re seriously thinking about starting a new web design business, you have some ideas about where you want to go with it:

Do you like the idea of being a lifelong freelancer or digital nomad?
Would you like to operate your own design agency?
Do you have aspirations to build and sell website products, like plugins, themes, or UI kits instead?

If you expect to pivot your business at some point, be careful about choosing a business name that paints you into a corner. Keep it broader so that prospects don’t have to wonder what it is you really do.

And if you plan on scaling your business beyond yourself, using your own name might not be the best idea. You’ll want clients to associate the brand name with your agency, not with you specifically.

6. Will Your Business Name Be Easy To Remember?

At this point, you have some business names brewing. So, now we need to look at the more technical aspects of naming your brand.

Here’s what you need to do.

a. Write down no more than three to five business names you like.

For example:

Honeymooners Web Design
Charles Murphy Design & Development
FoREver Websites
SOLD Web Design Agency

b. Mash each name into one long lowercase string. Don’t include any punctuation.

For example:


c. Are any of the names difficult to read? Too long? Do any of them cause confusion and look like they mean something else?

If so, get rid of them as a matching domain name won’t work. Or, if you absolutely love them, fix the name so it’s clear, readable, and short. For instance:

charlesmurphydesignanddevelopment becomes charlesmurphydesign or just charlesmurphy.

7. Does The Name You Want Already Exist?

It’s a good idea to have a backup name in case you discover that the name you want already exists. Due to trademarking issues as well as possible confusion for your clients, you’ll want to avoid using a name that overlaps with or is the same as any other company (in or outside of web design).

Do a Google search for the business name you want to use. Check out the top 10 search results to see if there are any other matches.

You’ll also want to test out the domain name. Go to and run your business name string through it:

You have a few options if this happens:

Choose a different top-level domain (e.g. .tech, .io, .design).
Use an abbreviated version of your business name  (e.g.
Move your backup business name to the front of the line and see if it’s available.

It all depends on how attached you are to the business name you’ve chosen. Just make sure that any changes you make to it (like shortening the domain name or using an alternate TLD) doesn’t cause confusion for prospects who look you up online. You don’t want them confusing someone else’s domain name for yours if business name and domain name don’t line up.

Choosing a Business Name Is Just the First Step…

Once you’ve settled on your business name, share it with a few people you trust. They’ll let you know if you’ve totally missed the mark or if it’s something you should be excited to run with.

As soon as you’re 100% sure it’s the right name, buy the domain name and register your company. Then, it’ll be official!

Of course, this isn’t the end to branding your new business. In our next Branding 101 post, we’re going to look at the next step: How to create the visual identity for your business.

Stay tuned!


Featured image via Pexels.


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;}