/Blog

Primary LanguageRubyMIT LicenseMIT

๐Ÿ“— Table of Contents

๐Ÿ“– [Blog (rails app)]

[Blog] is going to be a fully functioning blog website. It will have all the classic functions and users will be able to interact with the website by adding posts, liking them, and commenting under them.

๐Ÿ›  Built With

Tech Stack

Client
Server
Database

Key Features

  • [Data is processed in models]
  • [Users can register]
  • [Users can add posts]
  • [Users can like posts and add comments]

(back to top)

๐Ÿš€ Live Demo

  • [In progress...]

(back to top)

๐Ÿ’ป Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

In order to run this project you need: ruby version 2.7.0+ rails version 7+ PostgreSQL

Setup

Clone this repository to your desired folder:

https://github.com/MattGomb/Blog.git
cd Blog

Install

Install this project with:

bundle install

Usage

This app uses postgreSQL databases for data preservation. Please provide valid credentials in a .env file and place it in the root folder.

To initialize database run:

rails db:create
rails db:migrate

To run the server, execute the following command:

rails s` or `rails server

this will start the server on http://localhost:3000/

To use the features of the app, you'll have to sign up using:

http://127.0.0.1:3000/users/sign_up

Once you sign up, you can log in from:

http://127.0.0.1:3000/users/sign_in

For API log in:

http://127.0.0.1:3000/api/v1/login

you ned to suply your email and pasword using JSON format in the body of the request as follows:

{
  "email": "your_mail@mail.com",
  "password": "yourpassword"
 }

In the response of the request you will recieve a token that you will need to copy and will have 24 hours of validity. Please provide your token in the Authorization header of subsequent requests.

To list posts for a specific user in JSON format:

http://127.0.0.1:3000/api/v1/users/:user_id/posts

To list comments for a post in JSON format:

http://127.0.0.1:3000/api/v1/users/:user_id/posts/:post_id/comments

Use this last endpoint with POST method to create comments for a post. Provide the text of the comment in JSON format as follows:

{
  "text": "your comment"
 }

Run tests

To run tests, run the following command:

rspec

Deployment

You can deploy this project using:

TBA

(back to top)

๐Ÿ‘ฅ Author

๐Ÿ‘ค Mรกtyรกs Gombos

๐Ÿ‘ค Felipe Oyarzo

(back to top)

๐Ÿ”ญ Future Features

  • [improved user interface]
  • [reference posts]

(back to top)

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

โญ๏ธ Show your support

If you like this project please consider giving it a star!

(back to top)

๐Ÿ™ Acknowledgments

We would like to thank Microverse for the opportunity.

(back to top)

๐Ÿ“ License

This project is MIT licensed.

(back to top)