Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Api Security Checklist | 21,061 | 3 months ago | 12 | mit | ||||||
Checklist of the most important security countermeasures when designing, testing, and releasing your API | ||||||||||
Next Auth | 18,934 | 21 | 226 | 6 hours ago | 650 | July 25, 2023 | 303 | isc | TypeScript | |
Authentication for the Web. | ||||||||||
Awesome Go Cn | 5,896 | 7 months ago | 10 | |||||||
Go 资源大全中文版, 内容包括:Web框架、模板引擎、表单、身份认证、数据库、ORM框架、图片处理、文本处理、自然语言处理、机器学习、日志、代码分析、教程和(电子)书等。由「开源前哨」和「Go开发大全」微信团队维护。 | ||||||||||
Awesome Go Cn | 4,374 | 2 days ago | 13 | mit | ||||||
一个很棒的Go框架、库和软件的中文收录大全。:alarm_clock:脚本定期与英文文档同步,包含了各工程star数/最近更新时间,助您快速发现优质项目。Awesome Go~ | ||||||||||
Microservices Platform | 4,111 | 4 months ago | 10 | apache-2.0 | Java | |||||
基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离的企业级微服务多租户系统架构。并引入组件化的思想实现高内聚低耦合,项目代码简洁注释丰富上手容易,适合学习和企业中使用。真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案,面向互联网设计同时适合B端和C端用户,支持CI/CD多环境部署,并提供应用管理方便第三方系统接入;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等。 | ||||||||||
Authlib | 3,958 | 162 | 216 | 6 days ago | 39 | June 25, 2023 | 60 | bsd-3-clause | Python | |
The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included. | ||||||||||
Xboot | 3,695 | 4 months ago | 8 | gpl-3.0 | Java | |||||
基于Spring Boot 2.x的一站式前后端分离快速开发平台XBoot 微信小程序+Uniapp 前端:Vue+iView Admin 后端:Spring Boot 2.x/Spring Security/JWT/JPA+Mybatis-Plus/Redis/Elasticsearch/Activiti 分布式限流/同步锁/验证码/SnowFlake雪花算法ID 动态权限 数据权限 工作流 代码生成 定时任务 社交账号 短信登录 单点登录 OAuth2开放平台 客服机器人 数据大屏 暗黑模式 | ||||||||||
Cli | 3,259 | 121 | 4 days ago | 313 | July 18, 2023 | 123 | apache-2.0 | Go | ||
🧰 A zero trust swiss army knife for working with X509, OAuth, JWT, OATH OTP, etc. | ||||||||||
Oauth2 | 2,874 | 103 | 4 months ago | 17 | February 03, 2023 | 87 | mit | Go | ||
OAuth 2.0 server library for the Go programming language. | ||||||||||
Node Oidc Provider | 2,808 | 25 | 97 | 10 days ago | 329 | May 30, 2023 | 1 | mit | JavaScript | |
OpenID Certified™ OAuth 2.0 Authorization Server implementation for Node.js |
This is full stack boilerplate with React, Redux, Express, Mongoose and Passport. Skip the tedious part and get straight to developing your app.
Since Heroku is no longer free I made Docker production deployment that you can use on any Linux VPS.
Server
1:N
relationemail/password
, Facebook and Google OAuth strategies and JWT protected APIsUser
and Admin
rolesasync/await
syntax across whole app.env
file configurationClient
/constants
folderRead on on how to set up this for development. Clone the repo.
$ git clone https://github.com/nemanjam/mern-boilerplate.git
$ cd mern-boilerplate
Rename .env.example
to .env
and fill in database connection strings, Google and Facebook tokens, JWT secret and your client and server production URLs.
#db
MONGO_URI_DEV=mongodb://localhost:27017/mernboilerplate
MONGO_URI_PROD=
#google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=/auth/google/callback
#facebook
FACEBOOK_APP_ID=
FACEBOOK_SECRET=
FACEBOOK_CALLBACK_URL=/auth/facebook/callback
#jwt
JWT_SECRET_DEV=secret
JWT_SECRET_PROD=
#site urls
CLIENT_URL_DEV=https://localhost:3000
CLIENT_URL_PROD=https://mern-boilerplate-demo.herokuapp.com
SERVER_URL_DEV=https://localhost:5000
SERVER_URL_PROD=https://mern-boilerplate-demo.herokuapp.com
#img folder path
IMAGES_FOLDER_PATH=/public/images/
Facebook OAuth requires that your server runs on https
in development as well, so you need to generate certificates. Go to /server/security
folder and run this.
$ cd server/security
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf -sha256
$ cd server
$ npm install
You are good to go, server will be available on https://localhost:5000
$ npm run server
Just install the dependencies and run the dev server. App will load on https://localhost:3000
.
$ cd client
$ npm install
$ npm start
That's it as far for development setup. For production check the Deployment on Heroku
section.
This project is already all set up for deployment on Heroku, you just need to create Heroku application add heroku remote to this repo and push it to heroku
origin.
$ heroku login
$ heroku create my-own-app-name
$ git remote add heroku https://git.heroku.com/my-own-app-name.git
$ git push heroku master
$ heroku open
But before that you need MongoDB database, so go to MongoDB Atlas, create cluster, whitelist all IPs and get database URL. Set that URL in .env
file as MONGO_URI_PROD
.
MONGO_URI_PROD=mongodb+srv://<your-username-here>:<your-password-here>@cluster0-abcd.mongodb.net/test?retryWrites=true&w=majority
If you don't insert environment variables in Heroku manually via web interface or console you'll need to remove .env
file from server/.gitignore
and push it to Heroku. Never push .env
file to development repo though.
...
#.env #comment out .env file
...
In the following section you can read detailed instructions about Heroku deployment process.
Server uses Babel so that we can use the same newer JavaScript syntax like the one used on the Client. In development we are passing server/src/index.js
file to babel-node
executable along with nodemon
daemon. We run that with npm run server
script.
"server": "nodemon --exec babel-node src/index.js",
That is fine for development, we compile the source on every run but for production we want to avoid that and to compile and build code once to JavaScript version which Node.JS can execute. So we take all the code from /server/src
folder compile it and put the output into /server/build
destination folder. -d
is short for destination, and -s
flag is for sourcemaps for debugging. We make that into build-babel
script.
"build-babel": "babel -d ./build ./src -s",
We also need to delete and make build
folder on every deployment, so we do that with this simple script.
"clean": "rm -rf build && mkdir build",
Now we have everything to build our server code. We do that by calling 2 last scripts.
"build": "npm run clean && npm run build-babel",
Now we just need to call build script and run compiled file with node. Make sure Babel is in the production dependencies in the server/package.json
or you'll get "babel is not defined" error on Heroku.
"start-prod": "npm run build && node ./build/index.js",
Our server is now all set up, all we need is to call start-prod
script. Heroku infers runtime he needs to run the application by the type of dependencies file in the root folder, so for Node.JS we need another package.json
. Heroku will call start
script after building phase so we just need to pass our start-prod
script to spin up the server with the --prefix server
where server
is folder in which package.json
with that script is located.
"start": "npm run start-prod --prefix server",
Before all this happens Heroku needs to install the dependencies for both server and client, heroku-postbuild
script is meant for that. NPM_CONFIG_PRODUCTION=false
variable is there to disable production environment while dependencies are being installed. Again --prefix
flag is specifying the folder of the script being run. In this script we build our React client as well.
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix server && npm install --prefix client && npm run build --prefix client"
Before you push to production you'll need to set your URLs in client/constants
. That's it.
export const FACEBOOK_AUTH_LINK =
"https://my-own-app.herokuapp.com/auth/facebook";
export const GOOGLE_AUTH_LINK = "https://my-own-app.herokuapp.com/auth/google";
Brad Traversy Dev connector 2.0
Brad Traversy Learn The MERN Stack Youtube playlist
Thinkster react-redux-realworld-example-app
Thinkster node-express-realworld-example-app
Quinston Pimenta Deploy React with Node (Express, configured for ES6, Babel) to Heroku (without babel-node)
Kim Nguyen How to Deploy ES6 Node.js & Express back-end to Heroku