This is a basic API backend scaffold that can be used to quickly bootstrap your next app. The code of the project is intended to be modified by a developer. The sole purpose of this project is to reduce the time spent on creating the boilerplate code.
This project already contains the database, filestore and cache connectors. Also, a few endpoints were implemented to demonstrate the best practices.
https://github.com/gin-gonic/gin
https://github.com/gin-gonic/examples
The database is implemented via Adapter
interface.
Adapter
acts as the controller layer and is used to control the operations on database.
Amazon AWS DynamoDB is the only implemented adapter that connects to a real database.
See dynamodb.go
Alternatively, for local tests you can use the filesystem adapter. See local.go
Primary index id
Secondary index email
(name email-index
)
Basic in-memory cache with expiration is implemented.
https://github.com/akyoto/cache
The Amazon AWS S3 is implemented. See s3.go
Alternatively, for local tests you can use the filesystem adapter. See local.go
Google OAuth 2.0 is conveniently implemented. Use Google Console to configure OAuth2.0 credentials.