1. Setting up the Environment

Are you ready for your next app? We're going to whiz right through and teach you how to build a more complete app than before!

Together, we're going to build a clone of Instagram, which is now a billion dollar company. But you too, can make an app that is just like it!

Setting up your project

You can refer this lesson for more details about creating new project.

First, let's open up our terminal and create our prrject.

For every new Rails application, we have to create our initial database. In the terminal enter the following commands:

rails new ideator --database=mysql --css tailwind --javascript esbuild
cd instapost
bin/setup

Package.json

Update the package.json file and add the lines below:

"scripts": {
  "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets",
  "build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/tailwind.css --minify"
}

Now let's fire up our rails server by entering this command in the terminal window.

bin/dev

Let's visit localhost:3000. You should see a nice welcome page from Ruby on Rails.

image.png

Awesome! We're all set!

Lesson list