Authomatek is a Swift package for Vapor that provides pre-configured authentication for relational databases. It automates the process of creating all the necessary routes, controllers, and models, allowing you to quickly and easily set up authentication for your Vapor application.
With Authomatek, you can get up and running with secure user authentication in no time. Additionally, Authomatek supports JSON Web Tokens (JWT) for secure user authentication and authorization.
Features
User registration
User login (with JWT)
User logout
User JWT refresh
License
AuthoConnectable is released under the MIT license. See LICENSE for details.
AuthoConnectable Template
A template to create a new Vapor project with ease of Authomatek and ConnectableKit packages!
Features
ServerConfiguration
for the APIConnectableKit
configurationsConnectableErrorMiddleware
andConnectableCORSMiddleware
are pre-configuredFileMiddleware
for public directory.leaf
if you did choose to use Leaf as the template engineAuthomatek
configurationsRouteConfig
for the versioningAuthoConnectable
controller to useConnectable
protocol for theAuthoController
PostgreSQL
,MySQL
(Because I tested it with these two only 😬)Create
,Login
,Update
andList
(UserModel and UserStatus added byAuthomatek
)WEBRouter
for the web routes if you did choose to use Leaf as the template engineAPIRouter
for all routesProfileRouter
(Authentication routes added byAuthomatek
)ProfileRouter
for the GET all,GET
by:profileID
,POST
,PUT
andPUT
routesPOST
,PUT
andDELETE
is protected byAuthoMiddleware
Constant
s andEndpoint
sConstant
for theServer
andDatabase
relatedEndpoint
for the route and versioning relatedInstallation
- Using Vapor CLI
The process is the same with the default template with minimum adjustments for
Authomatek
package. Just follow the steps and you are good to go!because fluent is a must for
Authomatek
package.It will ask you to choose the database type, choose one of the following (Because I tested it with these two only 😬):
PostgreSQL
MySQL
It will ask you to use Leaf as the template engine.
Environment Variables
SERVER_HOST
localhost
SERVER_PORT
8080
DATABASE_HOST
localhost
DATABASE_PORT
5432
for PostgreSQL,3306
for MySQLDATABASE_USERNAME
vapor_username
DATABASE_PASSWORD
vapor_password
DATABASE_NAME
vapor_database
SECRET_KEY_FILE_PATH
ACCESS_EXPIRATION_DATE_INTERVAL
3600
REFRESH_EXPIRATION_DATE_INTERVAL
604800
Routes
User.DTO.Register
User.DTO.Login
Connector.DTO
Connector.DTO
Profile.List.DTO
Profile.DTO
Profile.DTO
Profile.DTO
Connector.DTO
Abort(.notFound, reason: "Not Found)
withConnector.DTO
Abort(.notFound, reason: "Not Found)
withConnector.DTO
Abort(.notFound, reason: "Not Found)
withConnector.DTO
Abort(.notFound, reason: "Not Found)
withConnector.DTO
Abort(.notFound, reason: "Not Found)
withConnector.DTO
That’s it!
From now on, you can start developing your project with the
AuthoConnectable
template.If you have any questions, feel free to ask me.
If you find any bugs, please open an issue.
If you want to contribute, feel free to open a pull request.
If you like this template, please give it a star ⭐️
Check out my other packages:
📦 ConnectableKit
ConnectableKit is a Swift package for the Vapor framework that simplifies the response DTOs and JSON structures for API projects.
Features
📦 Authomatek
Authomatek is a Swift package for Vapor that provides pre-configured authentication for relational databases. It automates the process of creating all the necessary routes, controllers, and models, allowing you to quickly and easily set up authentication for your Vapor application.
With Authomatek, you can get up and running with secure user authentication in no time. Additionally, Authomatek supports JSON Web Tokens (JWT) for secure user authentication and authorization.
Features
License
AuthoConnectable is released under the MIT license. See LICENSE for details.