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
ServerConfigurationfor the APIConnectableKitconfigurationsConnectableErrorMiddlewareandConnectableCORSMiddlewareare pre-configuredFileMiddlewarefor public directory.leafif you did choose to use Leaf as the template engineAuthomatekconfigurationsRouteConfigfor the versioningAuthoConnectablecontroller to useConnectableprotocol for theAuthoControllerPostgreSQL,MySQL(Because I tested it with these two only 😬)Create,Login,UpdateandList(UserModel and UserStatus added byAuthomatek)WEBRouterfor the web routes if you did choose to use Leaf as the template engineAPIRouterfor all routesProfileRouter(Authentication routes added byAuthomatek)ProfileRouterfor the GET all,GETby:profileID,POST,PUTandPUTroutesPOST,PUTandDELETEis protected byAuthoMiddlewareConstants andEndpointsConstantfor theServerandDatabaserelatedEndpointfor the route and versioning relatedInstallation
- Using Vapor CLI
The process is the same with the default template with minimum adjustments for
Authomatekpackage. Just follow the steps and you are good to go!because fluent is a must for
Authomatekpackage.It will ask you to choose the database type, choose one of the following (Because I tested it with these two only 😬):
PostgreSQLMySQLIt will ask you to use Leaf as the template engine.
Environment Variables
SERVER_HOSTlocalhostSERVER_PORT8080DATABASE_HOSTlocalhostDATABASE_PORT5432for PostgreSQL,3306for MySQLDATABASE_USERNAMEvapor_usernameDATABASE_PASSWORDvapor_passwordDATABASE_NAMEvapor_databaseSECRET_KEY_FILE_PATHACCESS_EXPIRATION_DATE_INTERVAL3600REFRESH_EXPIRATION_DATE_INTERVAL604800Routes
User.DTO.RegisterUser.DTO.LoginConnector.DTOConnector.DTOProfile.List.DTOProfile.DTOProfile.DTOProfile.DTOConnector.DTOAbort(.notFound, reason: "Not Found)withConnector.DTOAbort(.notFound, reason: "Not Found)withConnector.DTOAbort(.notFound, reason: "Not Found)withConnector.DTOAbort(.notFound, reason: "Not Found)withConnector.DTOAbort(.notFound, reason: "Not Found)withConnector.DTOThat’s it!
From now on, you can start developing your project with the
AuthoConnectabletemplate.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.