Giter VIP home page Giter VIP logo

instagram-clone-old's Introduction

INSTAGRAM CLONE

https://www.youtube.com/watch?v=dqjF3C9A-Yg&list=PL-1jnVsiYID5HpCRxhsfEuscBXWrWuB6s&index=1

Model

App Entity-Relationship Diagram

Version

  • ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
  • Rails 6.1.4

System dependencies

Configuration

Carrierwave Steps:

$ rails g uploader Image # will create app/uploaders/image_uploader.rb
$ touch config/initializers/carrierwave.rb
$ touch config/application.yml # set local environment variables used by figaro

Change to storage :fog in image_uploader.rb. Add configuration to carrierwave.rb Add environment variables in application.yml

Connect model to uploader file. In 'app/models/post.rb' add:

mount_uploader :image, ImageUploader

Use mount_uploaders for multiple file uploads and mount_uploader for single file uploads. Post model has field image that is of type string.

Create controller in app/controller/posts_controller.rb Create form/view in app/views/posts/new.html.erb

If webpacker stops responding to changes in application.scss or application.js, run this command in terminal:

$ rails webpacker:install

Database creation

$ gem install pg
$ sudo apt-get update
$ sudo apt install postgresql postgresql-contrib libpq-dev
# Create a new database role
$ sudo -u postgres createuser -s dynamic -P

Instead of dynamic use the linux username you are logged in with.

In file config/database.yml:

...
default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: dynamic
  password: your password here

development:
  <<: *default
  database: appname_development

Instead of dynamic use the linux username you are logged in with

Database initialization

$ rails db:create
$ rails db:migrate

How to run the test suite

Services (job queues, cache servers, search engines, etc.)

Deployment instructions

Run in terminal:

$ rake webpacker:install
$ sudo service postgresql start

References

instagram-clone-old's People

Contributors

overdrivemachines avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.