Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/srikanthreddy919/administrative-api-app
Rails 5 API app
https://github.com/srikanthreddy919/administrative-api-app
Last synced: 13 days ago
JSON representation
Rails 5 API app
- Host: GitHub
- URL: https://github.com/srikanthreddy919/administrative-api-app
- Owner: srikanthreddy919
- Created: 2019-11-12T22:09:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T15:51:56.000Z (almost 2 years ago)
- Last Synced: 2023-03-08T09:06:55.242Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
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
```env
export DEVISE_SECRET_KEY=generate_secret_key
```
* For ` sign in ` request```http
http://localhost:3000/users/sign_in
```
> required params ` email ` and ` password `
```json
{
"user":{
"email": "[email protected]",
"password": "password"
}
}
```
* 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
```* To Create user
```http
POST http://localhost:3000/api/v1/users
```* Sample user Object for creation
```json
{
"user": {
"email": "[email protected]",
"name": "sample name",
"mobile_number": "888888822",
"password": "password",
"password_confirmation": "password",
"tags": [1]
}
}
```
* For update user
```http
PUT http://localhost:3000/api/v1/users/:id
```
* To disable the user add disabled to user object
```json
disabled: true
```
* For list of tags
```http
GET http://localhost:3000/api/v1/tags
```
* To create new tag
```http
POST http://localhost:3000/api/v1/tags
```
* sample Tag Object for creation```json
{
"tag": {"name": "employee"}
}
```* To update tag
```http
PUT http://localhost:3000/api/v1/tags/:id
```* To search users
> search with email or name
```http
GET http://localhost:3000/api/v1/users?search=query
```
* To sort users
```http
GET http://localhost:3000/api/v1/users?sorty_by=field_name&sort_order=asc
```
* To search tags
> search with name
```http
GET http://localhost:3000/api/v1/tags?search=query
```
* To sort tags
```http
GET http://localhost:3000/api/v1/tags?sort_order=asc
```