https://github.com/guerreiropedr0/api-authentication
This is a Rails API template with built-in authentication using Devise and Devise JWT. It includes best practices for building APIs with Rails, such as versioning and namespacing. Use this template as a starting point for your own API projects that require user authentication and authorization.
https://github.com/guerreiropedr0/api-authentication
api authentication authorization rails
Last synced: about 2 months ago
JSON representation
This is a Rails API template with built-in authentication using Devise and Devise JWT. It includes best practices for building APIs with Rails, such as versioning and namespacing. Use this template as a starting point for your own API projects that require user authentication and authorization.
- Host: GitHub
- URL: https://github.com/guerreiropedr0/api-authentication
- Owner: guerreiropedr0
- License: mit
- Created: 2023-04-29T22:28:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T15:54:01.000Z (about 3 years ago)
- Last Synced: 2025-03-28T05:27:50.245Z (about 1 year ago)
- Topics: api, authentication, authorization, rails
- Language: Ruby
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API Authentication Template
This is a Rails API template with built-in authentication. Use it as a starting point for your own API projects.
## Getting Started
To get started with this API authentication template, follow these steps:
1. Clone the repository to your local machine:
```
git clone https://github.com/guerreiropedr0/api-authentication.git
```
2. Install the required gems:
```
bundle install
```
3. Set up the database:
```
rails db:create
rails db:migrate
```
4. Start the server:
```
rails s
```
You should now be able to access the API at http://localhost:3000.
## Features
This API authentication template includes the following features:
- User authentication and authorization with [Devise](https://github.com/heartcombo/devise)
- Token-based authentication with [Devise-JWT](https://github.com/waiting-for-dev/devise-jwt)
- CORS configuration for cross-domain requests
- Rails API best practices, including versioning and namespacing
## Usage
To use this API authentication template for your own project, you should:
1. Change the name of the Rails application in `config/application.rb`
2. Change the name of the database in `config/database.yml`
3. Customize the authentication and authorization settings in `config/initializers/devise.rb` and `app/models/ability.rb`
4. Modify the sample CRUD endpoints and add your own endpoints for your own resources
5. Deploy your API to a production server and configure your client to use the correct API endpoint
## Contributing
Contributions are welcome! If you find a bug or want to suggest a feature, please open an issue. If you want to contribute code, please fork the repository and submit a pull request.
## License
This API authentication template is licensed under the MIT License. See the `LICENSE` file for details.