- Comment tree app is a simple commenting app. In which a comment can have many
responses/replies, making it a tree of comments, that's why it is named asComment Tree - The concept of
self-referential classesis used, to implement thisComment Tree - For the
AuthorizationandAuthentication,deviseis used - A
Usercan applyCRUDoperation on theComments - For
Userimage,active storageis used - For test cases,
rspecis used
- A user can signin/signup
- ... to be added here ...
Visit CONTRIBUTING.md for contribution to this project.
Visit LEARN.md for learning self-referential associations and how it works in Ruby on Rails.
- Made sure you've started the server using:
rails s - Access the playground on link:
http://localhost:3000/graphiql - To get help about quering data using GQL in comment tree app, follow GRAPHQL.md
ruby 2.4.1- Bundled with:
2.3.7
In this project, I've used the AWS S3 Bucket for storing the user images. If you want the same functionality then you need to create your own S3 Bucket and add the required/relevant keys OR you can just set the storage to local. It is important to set this up for your local machine, otherwise you might face errors while sign_up or other places.
-
- Go to
config/environments/development.rbfile and for the line:config.active_storage.service = :amazon_devreplace:amazon_devwith:local. - Like it will be:
config.active_storage.service = :local - Restart the server and it will work on local storage
- Go to
-
-
Make sure to create your own bucket on S3 or you can follow this Link for guidance on creating your S3 Bucket and connect it to the App.
-
Create your credentials file using:
EDITOR="code --wait" bin/rails credentials:edit -
Add the credentials:
aws: access_key_id: "XXXX" secret_access_key: "XXXX" region: "us-east-1" dev: bucket: "BUCKET-NAME-DEV" prod: bucket: "BUCKET-NAME-PROD" -
Go to
config/environments/development.rbfile and for the line:config.active_storage.service = :localreplace:localwith:amazon_dev. -
Like it will be:
config.active_storage.service = :amazon_dev -
Restart the server and it will work
-
To setup the database for this project follow the steps below:
rails db:createrails db:migrate
If you ran into issues, follow:
rails db:droprails db:createrails db:migrate
To populate the database with some data use:
rails db:seed
- To start the server use:
rails s. - You can see the application running on:
http://localhost:3000/
- For the test cases
rspecis used. - To run the test cases, run the command:
rspec - To run the test cases for a specific file, run the command:
rspec file_path
- To be added
- To be added
- To be added
- To be added
- To be added