Demo solution using .net core to auth and authorize users using JWT, node js api to allow client applications to create and find orders, search products and finally React Web Components and Android studio solution to consume both Apis. The solution was built using Visual Studio Code for any platform, NodeJS, MongoDB and SQL Server 2016 express.
Let me introduce this repo:
-
mongodb: contains some scripts to initialize some collectoins like users, products and orders.
-
net-core-auth: .net core api using Dapper ORM, SQL Server 2016 and Json Web Tokens (JWT) to authenticate users and validate transactions
-
net-json-web-token: windows forms application, only used to generate JWT (test app)
-
node-js-orders nodejs api to create and get orders and also with some routines to search products by ID and name. This API looks for the Access Token on header, query string or body during the requests.
-
for the next commit a. Android Studio Mobile Application showing how to auth, search products and create orders. b. NET Core MVC showing how to consume the APIs mentioned before using SPA and React Components;
-
Before start you must install a. MongoDB b. SQL Server 2016 c. .NET Core on Ubuntu
-
Import the public key sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
-
Create a list file for mongoDB echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
-
Reload local packages sudo apt-get update
-
Install mongo sudo apt-get install -y mongodb-org
-
Starting mongo sudo service mongod start
Obs: on Ubuntu 16 you can find the mongo config => "cat /etc/mongod.conf" check the log and instances => "/var/lib/mongodb" and "/var/log/mongodb"
- curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list
- sudo apt-get update
- sudo apt-get install -y mssql-server
- sudo /opt/mssql/bin/sqlservr-setup
- sudo service mssql-server start