https://github.com/apaciuk/rails-7-api-mini-starter
Rails 7 API Starter with user Devise-Api Auth and just enough essential configuration options. - Leaving other options open to individual preference, with UUID's/RSpec. Template Repo
https://github.com/apaciuk/rails-7-api-mini-starter
api api-rest devise-api devise-api-authenticatable
Last synced: 9 months ago
JSON representation
Rails 7 API Starter with user Devise-Api Auth and just enough essential configuration options. - Leaving other options open to individual preference, with UUID's/RSpec. Template Repo
- Host: GitHub
- URL: https://github.com/apaciuk/rails-7-api-mini-starter
- Owner: apaciuk
- Created: 2023-02-14T15:22:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-15T18:19:37.000Z (over 3 years ago)
- Last Synced: 2025-06-01T22:06:52.228Z (about 1 year ago)
- Topics: api, api-rest, devise-api, devise-api-authenticatable
- Language: Ruby
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rails-7-api-starter
##### Rails 7 API Starter with the latest Devise-Api Auth preconfigured with just enough essential configuration options, with UUId's/RSpec and a basic ApplicationService, as api/v1
- Leaving all other options open to individual preference, ie Pundit, Knock, Bullet, and and other extras required.
##### Devise primary User model
Typical basic User model set up [https://github.com/nejdetkadir/devise-api] [https://github.com/heartcombo/devise] and add any other options needed.
###### RSpec/Services
- Configured with RSpec and generators, FactoryBot, CORs and base ApplicationService
* Ruby version
3.1.2
Deployment instructions, setup
- rails db:create
- rails db:migrate
* Server
- rails s -p 3000 (or other)
- Build API!
###### Check user auth/routes
- User routes
new_user_session GET /api/v1/users/sign_in(.:format) devise/sessions#new
user_session POST /api/v1/users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /api/v1/users/sign_out(.:format) devise/sessions#destroy
new_user_password GET /api/v1/users/password/new(.:format) devise/passwords#new
edit_user_password GET /api/v1/users/password/edit(.:format) devise/passwords#edit
user_password PATCH /api/v1/users/password(.:format) devise/passwords#update
PUT /api/v1/users/password(.:format) devise/passwords#update
POST /api/v1/users/password(.:format) devise/passwords#create
cancel_user_registration GET /api/v1/users/cancel(.:format) devise/registrations#cancel
new_user_registration GET /api/v1/users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /api/v1/users/edit(.:format) devise/registrations#edit
user_registration PATCH /api/v1/users(.:format) devise/registrations#update
PUT /api/v1/users(.:format) devise/registrations#update
DELETE /api/v1/users(.:format) devise/registrations#destroy
POST /api/v1/users(.:format) devise/registrations#create
- User Registration - to localhost:3000/api/v1/users/
(Postman/Rest client as raw JSON)
{
"user":
{
"email": "useremail.com",
"password": "userpassword&65"
}
}
- User Sign/Log in - to localhost:3000/api/v1/users/sign_in
{
"email": "useremail.com",
"password": "userpassword&65"
"password_confirmation": "userpassword&65"
}
- Pages routes
pages_home GET /api/v1/pages/home(.:format) pages#home
pages_restricted GET /api/v1/pages/restricted(.:format) pages#restricted
- Todo fix user sign-out