|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Nhost||6,437||9||12 hours ago||91||September 20, 2022||161||mit||TypeScript|
|The Open Source Firebase Alternative with GraphQL.|
|Logto||5,445||11 hours ago||66||other||TypeScript|
|🧑🚀 Logto is a cost-effective open-source alternative to Auth0. It offers a seamless developer experience and is well-suited for individuals and growing companies.|
|Flask Base||2,838||2 months ago||1||mit||Python|
|A simple Flask boilerplate app with SQLAlchemy, Redis, User Authentication, and more.|
|Nango||2,383||3||2 days ago||10||August 19, 2022||25||other||TypeScript|
|Get OAuth tokens for APIs - fast & secure.|
|Go Base||1,016||2||a year ago||1||March 08, 2021||mit||Go|
|Go RESTful API Boilerplate with JWT Authentication backed by PostgreSQL|
|💥 A sophisticated GraphQL with Apollo, Express and PostgreSQL boilerplate project.|
|Canduma||751||2 months ago||19||mit||Rust|
|A Rust Boilerplate server with GraphQL API, Diesel, PostgreSQL, session authentication and JWT|
|Nextjs Prisma Boilerplate||318||3 months ago||2||mit||TypeScript|
|Full stack boilerplate with Next.js, Prisma, Tailwind, TypeScript, Docker, Postgres, documentation, frontend and backend unit and integration tests with Jest, Cypress end-to-end tests, Github Actions CI/CD workflows, and production deployment with Traefik and Docker.|
|❤️ Node.js REST API boilerplate|
|Express REST API with JWT Authentication and support for sqlite, mysql, and postgresql|
Easily extendible RESTful API boilerplate aiming to follow idiomatic go and best practice.
The goal of this boiler is to have a solid and structured foundation to build upon on.
Any feedback and pull requests are welcome and highly appreciated. Feel free to open issues just for comments and discussions.
The following feature set is a minimal selection of typical Web API requirements:
go run main.go
go run main.go migrate
go run main.go serve
Or just use the provided docker-compose file. After first start attach to the server container and run
./main migrate to populate the database.
For passwordless login following routes are available:
|/auth/login||POST||the email you want to login with (see below)|
|/auth/token||POST||token||the token you received via email (or printed to stdout if smtp not set)|
|/auth/refresh||POST||Authorization: "Bearer refresh_token"||refresh JWTs|
|/auth/logout||POST||Authorizaiton: "Bearer refresh_token"||logout from this device|
Besides /auth/_ the API provides two main routes /api/_ and /admin/*, as an example to separate application and administration context. The latter requires to be logged in as administrator by providing the respective JWT in Authorization Header.
Check routes.md for a generated overview of the provided API routes.
The server is configured to serve a Progressive Web App (PWA) client from ./public folder (this repo only serves an example index.html, see below for a demo PWA client to put here). In this case enabling CORS is not required, because the client is served from the same host as the api.
If you want to access the api from a client that is serverd from a different host, including e.g. a development live reloading server with below demo client, you must enable CORS on the server first by setting environment variable ENABLE_CORS=true on the server to allow api connections from clients serverd by other hosts.
For demonstration of the login and account management features this API serves a demo Vue.js PWA. The client's source code can be found here. Build and put it into the api's ./public folder, or use the live development server (requires CORS enabled).
Outgoing emails containing the login token will be print to stdout if no valid email smtp settings are provided by environment variables (see table below). If EMAIL_SMTP_HOST is set but the host can not be reached the application will exit immediately at start.
Use one of the following bootstrapped users for login:
A deployed version can also be found on Heroku
By default viper will look at $HOME/.go-base.yaml for a config file. Setting your config as Environment Variables is recommended as by 12-Factor App.
|PORT||string||localhost:3000||http address (accepts also port number only for heroku compability)|
|LOG_TEXTLOGGING||bool||false||defaults to json logging|
|DB_NETWORK||string||tcp||database 'tcp' or 'unix' connection|
|DB_ADDR||string||localhost:5432||database tcp address or unix socket|
|DB_USER||string||postgres||database user name|
|DB_PASSWORD||string||postgres||database user password|
|DB_DATABASE||string||postgres||database shema name|
|AUTH_LOGIN_URL||string||http://localhost:3000/login||client login url as sent in login token email|
|AUTH_LOGIN_TOKEN_LENGTH||int||8||length of login token|
|AUTH_LOGIN_TOKEN_EXPIRY||time.Duration||11m||login token expiry|
|AUTH_JWT_SECRET||string||random||jwt sign and verify key - value "random" creates random 32 char secret at startup (and automatically invalidates existing tokens on app restarts, so during dev you might want to set a fixed value here)|
|AUTH_JWT_EXPIRY||time.Duration||15m||jwt access token expiry|
|AUTH_JWT_REFRESH_EXPIRY||time.Duration||1h||jwt refresh token expiry|
|EMAIL_SMTP_HOST||string||email smtp host (if set and connection can't be established then app exits)|
|EMAIL_SMTP_PORT||int||email smtp port|
|EMAIL_SMTP_USER||string||email smtp username|
|EMAIL_SMTP_PASSWORD||string||email smtp password|
|EMAIL_FROM_ADDRESS||string||from address used in sending emails|
|EMAIL_FROM_NAME||string||from name used in sending emails|
|ENABLE_CORS||bool||false||enable CORS requests|
Package auth/pwdless contains example api tests using a mocked database.