https://github.com/srikanthreddy919/users-management
Admin login with users CRUD
https://github.com/srikanthreddy919/users-management
rails-application ruby ruby-on-rails
Last synced: 2 months ago
JSON representation
Admin login with users CRUD
- Host: GitHub
- URL: https://github.com/srikanthreddy919/users-management
- Owner: srikanthreddy919
- Created: 2021-03-17T19:00:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T02:11:40.000Z (over 5 years ago)
- Last Synced: 2025-05-07T19:16:49.358Z (about 1 year ago)
- Topics: rails-application, ruby, ruby-on-rails
- Language: Ruby
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
This README would normally document whatever steps are necessary to get the
application up and running.
Things you may want to cover:
- Ruby version
```ruby
ruby >= 2.6.3
```
- Bundle install
```
bundle install
```
- Create database & Migrate
```ruby
rake db:create db:migrate db:seed
```
- export env variables
- To generate secret key
```ruby
bundle exec rake secret
```
```env
export DEVISE_SECRET_KEY=generated_secret_key
```
- For `sign in` request
```http
POST http://localhost:3000/admins/sign_in
```
> required params `username` and `password`
```json
{
"admin": {
"username": "admin@example.com",
"password": "password"
}
}
```
- For `sign out` admin
```http
DELETE http://localhost:3000/admins/sign_out
```
- after successfull signin request, copy the token from Authorization header and send along with all the requests
> as ` Bearer your_token`
- For list of users
```http
GET http://localhost:3000/api/v1/users
```
- For get a specific user
```http
GET http://localhost:3000/api/v1/users/:id
```
- To Create user
```http
POST http://localhost:3000/api/v1/users
```
- Sample user Object for creation
```json
{
"user": {
"email": "sample@example.com",
"name": "sample name",
"phone": "888888822",
"status": "active"
}
}
```
- For update user
```http
PUT/PATCH http://localhost:3000/api/v1/users/:id
```
- Payload
```json
{
"user": {
"email": "sample@example.com",
"name": "sample name",
"phone": "888888844",
"status": "active"
}
}
```
- For delete user
```http
DELETE http://localhost:3000/api/v1/users/:id
```