Giter VIP home page Giter VIP logo

star_wars_api's Introduction

Star Wars API

Ruby on Rails API that allows the user to get information from Star Wars through an authenticated user.

Getting Started

Requirements

  • ruby 3.1.2

Installation

With Docker (recommended)

  • If it's the first time running the project, execute: sh ./docker/initialize.sh
  • Then only start the container when needed with: docker compose up

Standalone

Running

With Docker (recommended)

  • docker compose up

Standalone

  • To run the web server, run: rails s
  • To run the mail server, run the following on another tab: mailhog

API Documentation

API documentation can be found on the following Postman workspace link

About the code

This is a Ruby on Rails API mode application that uses Devise as authentication and Fast JSON API + Oj for structuring and serializing of the API responses.

Mails are served through MailHog package and UI can be accessed by going to http://localhost:8025 with or without Docker.

Authentication

Authentication endpoints can be used to sign up, log in and log out from the API.

  • It all starts with signing up using the POST /signup endpoint, which returns the user details
  • Authenticating into the API its possible by using the POST /login endpoint, which returns the Bearer token on the response's Header (after a successful login)
  • Logging out its done by the DELETE /logout endpoint, which safely deletes the user session on the API

Resetting password

By using the Reset Password (POST /password) endpoint, a reset_password_token is returned and also sent via a link to the User's email. This token allows the user to reset his password via the Create Password (PUT /password) endpoint

star_wars_api's People

Contributors

hepu avatar

Watchers

 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.