Git Product home page Git Product logo

ror-social-scaffold's Introduction

Scaffold for social media app with Ruby on Rails

This repository includes an application with API endpoint for posts and Comments, as well as adding a session start functionality. Its purpose is to train Microverse students in API creation.

Built With

  • Ruby v2.7.2
  • Ruby on Rails v5.2.4

Live Demo

Live Demo Link

Getting Started

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

Prerequisites

Ruby: 2.7.2 Rails: 5.2.6 Postgres: >=9.5

Setup

Instal gems with:

bundle install

Setup database with:

   rails db:setup
   rails db:migrate

Github Actions

To make sure the linters' checks using Github Actions work properly, you should follow the next steps:

  1. On your recently forked repo, enable the GitHub Actions in the Actions tab.
  2. Create the feature/branch and push.
  3. Start working on your milestone as usual.
  4. Open a PR from the feature/branch when your work is done.

Usage

Start server with:

    rails server

Open http://localhost:3000/ in your browser.

Run tests

    rspec --format documentation

Tests will be added by Microverse students. There are no tests for initial features in order to make sure that students write all tests from scratch.

API Endpoints

Use the token from the authorization response headers to sign in.

Sign up

Method: POST

Endpoint: /users

Header: { "Content-Type": "application/json", "Accept": "application/json" }

Body: {"user": {"name": "Yuvraj", "email": "[email protected]", "password": "abc123", "password_confirmation": "abc123"}}

Sign in

Method: POST

Endpoint: /users/sign_in

Header: { "Content-Type": "application/json", "Accept": "application/json" }

Body: {"user": {"email": "[email protected]", "password": "abc123"}}

Sign out

Method: DELETE

Endpoint: /users/sing_out

Header: { "Content-Type": "application/json", "Accept": "application/json", "Authorization": JWT token }

Add post

Method: POST

Endpoint: /posts

Header: { "Content-Type": "application/json", "Accept": "application/json", "Authorization": JWT token }

Body: {"content": "Hello!"}

View post

Method: GET

Endpoint: /posts

Header: { "Content-Type": "application/json", "Accept": "application/json", "Authorization": JWT token }

Add comment

Method: POST

Endpoint: /posts/:post_id/comments

Header: { "Content-Type": "application/json", "Accept": "application/json", "Authorization": JWT token }

Body: {"content": "Hi!"}

View comments

Method: GET

Endpoint: /posts/:post_id/comments

Header: { "Content-Type": "application/json", "Accept": "application/json", "Authorization": JWT token }

Authors

👤 Author Arístides José Molina Pérez

👤 Author Yuvraj Manoo

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Ariel Camus CEO Microverse: For letting us start this journey.
  • Google: For letting us find crucial information in order to create this project.

📝 License

This project is CC0-1.0 licensed.

ror-social-scaffold's People

Contributors

aristides1000 avatar ad9311 avatar nidalaa avatar yuvrajm108 avatar bolah2009 avatar dependabot[bot] avatar jamesokunlade avatar ramseynjire avatar uryelah avatar fatymahmed avatar majovanilla avatar

Stargazers

Alfredo C. avatar

Watchers

James Cloos 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.