Sign inSign up

jaeger767/hyperforms-api

By jaeger767

•Updated about 8 years ago

Hyperforms' Rails backend API.

Image
0

264

jaeger767/hyperforms-api repository overview

⁠README

This project is a basic Rails api, using Ruby 2.4.3 and Rails 5.2.0. It requires Redis to be installed⁠.

My intention with it is to use it for my next projects, but feel free to clone / fork it for your own purpose, I don't care.

To make everything work, please do the following:

  1. git clone https://github.com/Drillan767/base-rails-api.git
  2. cd base-rails-api
  3. Create a file named config/application.yml.
  4. In the file, add a new key named JWT_SESSION_SECRET.
  5. Set it equal to a rake secret command output.
  6. Add a new key on a new line named 'CORS_ORIGIN'
  7. Set it equal to your front-end project's URL (ex: 'http://localhost:8080⁠')
  8. Run the API server with rails s.

The config/application.yml file should look like so:

JWT_SESSION_SECRET: 'f70e76cbc96d56341c168bb945a1626...'
CORS_ORIGIN: 'http://localhost:8080'

These keys correspond to 2 values contained in respectively config/initializers/jwt_sessions.rb and config/initializers/cors.rb.

For more info, please read Figaro's documentation⁠.

A bash file doing all this should come quickly...

⁠Gems included in this project:

  • Bcrypt (3.1.12)
  • Rspec (3.7.1)
  • Jwt_sessions (2.2.0)
  • Rack-cors (3.1.12)
  • Figaro (1.1.1)

For more informations, please check the project's Gemfile.

⁠Model included in this project:

User. Basically, you can clone this project then create a new "front-end" project with react-create-app or vue-cli or ng, then link your front-end this API, and prepare views for a signup/login form -- it will work.

For any other model, you're free to create whatever you want.

⁠Special thanks to:

This post⁠ made by Yulia Oletskaya⁠, from which I got my source code.

Tag summary

Content type

Image

Digest

Size

419.3 MB

Last updated

about 8 years ago

docker pull jaeger767/hyperforms-api