You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+32-15
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,18 @@
7
7
⚠️ The contracts are currently deployed on the testnet, it is important to use it and not to use the mainnet.
8
8
### 🐳 With Docker (recommanded)
9
9
1. Add your [Starton API Key](https://app.starton.io/en/projects)`API_KEY` in the [.env](.env) file of the project
10
-
2. Make sure Docker is working with `docker run hello-world`
11
-
3. Build and start the app with `docker compose up`
10
+
2. Setup MongoDB vars `MONGODB_URI` and `DB_NAME` in the [.env](.env) file of the project
11
+
3. Make sure Docker is working with `docker run hello-world`
12
+
4. Build and start the app with `docker compose up`
12
13
### 🫳🏼 By hand
13
14
It is recommanded to use [NVM](https://github.com/nvm-sh/nvm) to have the correct node version.
14
15
1. Export your Starton API Key with `export API_KEY=xx_xxx_xxxxxxx-xxxx-xxxx-xxxxxxxxxx`, replacing *xxxxx* with your key
15
-
2. Install the correct version of node with `nvm install 18`
16
-
3. Use the correct version of node with `nvm use`
17
-
4. Install dependencies with `npm install`
18
-
5. Build the app with `npm run build`
19
-
6. Start the app with `npm start`
16
+
2. Export your MongoDB vars with `export MONGODB_URI=xxx && export DB_NAME=xxx`, replacing *xxx* with your vars
17
+
3. Install the correct version of node with `nvm install 18`
18
+
4. Use the correct version of node with `nvm use`
19
+
5. Install dependencies with `npm install`
20
+
6. Build the app with `npm run build`
21
+
7. Start the app with `npm start`
20
22
21
23
You can now access to the app at [http://localhost:3000](http://localhost:3000) or [http://localhost:80](http://localhost:80)
22
24
#### See the deployed project on [licenka.space](https://licenka.space) !
@@ -39,17 +41,22 @@ The objective of our platform is to make it easy to create a license by defining
39
41
40
42
One of the challenges is to allow companies to use our solution very easily, so we were inspired by Starton in order to offer public API routes allowing companies to very simply buy, and check if a user has a license without Web3 knowledge.
41
43
42
-
The technologies we used are [Next.js](https://nextjs.org/) for the front and the API, [Vercel](https://vercel.com/) for the deploy, [Docker](https://vercel.com/), [Web3.js](https://github.com/web3/web3.js), **Starton API**, **BNB Chain** and we support **Ledger**.
44
+
The technologies we used are [Next.js](https://nextjs.org/) for the front and the API, [Vercel](https://vercel.com/) for the deploy, [Docker](https://www.docker.com/), [MongoDB](https://www.mongodb.com/), [Web3.js](https://github.com/web3/web3.js), **Starton API**, **BNB Chain** and we support **Ledger**.
43
45
44
46
Our main technical challenge was to be able to buy licenses easily, because it is necessary to approve the transfer of funds beforehand to be able to make the payment, and companies should not need to use Web3 technologies. Thus, we decided to create a page inspired by Paypal, on which the payment is made and which redirects the user to the chosen address once the license has been acquired.
Another problem we had to deal with was the fact that we could easily authenticate a user with metamaskto verify that he had a license. However, it should be possible on top of that to be able to call the Web2 API without having to authenticate, and without verification everyone could enter the wallet of someone who owns the license. For this, users can set a password to use the Web2 version.
52
+
Another problem we had to deal with was the fact that we could easily authenticate a user with metamask, on a Web2 app, to verify that he had a license. However we have developed a "oauth" flow (describe below). After oauth flow the client will receive a signed_nonce, which is use to call our Web2 API to authenticate the user and permit to client to know if the user has the license. This process avoids to the Web2 version for companies that do not wish to use Metamask auth.
51
53
52
-
Thus, our solution can work both with the simplicity of authentication in Web3, and both with the Web2 version for companies that do not wish to use Metamask auth.
Thus, our solution can work both with the implementation of their own authentication flow for Web3 client, and both with the Web2 version for companies that do not wish to use Metamask auth.
53
60
54
61
## 📄 Facility
55
62
#### See the deployed project on [licenka.space](https://licenka.space) !2
@@ -58,7 +65,8 @@ Here are the steps to install and test our project :
58
65
1. Use `git clone git@github.com:MaximePremont/Licenka.git`
59
66
2. Use `cd Licenka`
60
67
3. Add your [Starton API Key](https://app.starton.io/en/projects)`API_KEY` in the [.env](.env) file of the project
61
-
4. Setup and start like described [here](#how-to-setup-your-project), recommanded : `docker compose up`
68
+
4. Setup MongoDB vars `MONGODB_URI` and `DB_NAME` in the [.env](.env) file of the project
69
+
5. Setup and start like described [here](#how-to-setup-your-project), recommanded : `docker compose up`
62
70
63
71
You can now access to the app at [http://localhost:3000](http://localhost:3000)
64
72
## 👋 Team and comments
@@ -85,7 +93,8 @@ To use our system, you must first create a license in order to obtain the licens
85
93
Our solution is deployed and working with 3 parts :
86
94
1. A main page ([https://licenka.space](https://licenka.space)) to show the project
87
95
2. A license creation page ([https://licenka.space/create](https://licenka.space/create)), to create a new license with our wallet
88
-
3. A license buy page ([https://licenka.space/approve](https://licenka.space/approuve)), which allow the user to buy a license with his wallet, and redirect to the company page after that.
96
+
3. A license buy page ([https://licenka.space/approve](https://licenka.space/approve)), which allow the user to buy a license with his wallet, and redirect to the company page after that.
97
+
4. A oauth page ([https://licenka.space/oauth?redirect_uri=https://demo.licenka.space/auth&licence_id=7](https://licenka.space/oauth?redirect_uri=https://demo.licenka.space/auth&licence_id=7))
89
98
90
99
⚠️ To work with the purchase page, the company must indicate the license to be purchased and the page to redirects to something like this : *https://licenka.space/approve/?license=XX&redirect=https://xxxxxx.xx*
91
100
@@ -107,9 +116,15 @@ As explained, our API can be used in 2 different ways: Web2 or Web3 :
107
116
Query:
108
117
userAddress
109
118
licenseId
110
-
userPassword
119
+
signedNonce
111
120
200:
112
121
license: bool
122
+
- Get a nonce of user, with this nonce signed we can authenticate user `https://www.licenka.space/api/wallet/nonce`
123
+
```
124
+
Query:
125
+
walletAddress
126
+
200:
127
+
nonce: string
113
128
- **`Web3 Licenka`**: Here are the functions which can be called by users (Owner functions and internal functions are not displayed)
@@ -180,7 +195,7 @@ As explained, our API can be used in 2 different ways: Web2 or Web3 :
180
195
## ☀️ Business model & Growth
181
196
The objective of our project is to propose a reliable and very inexpensive alternative. Thus, we will earn money by taking **3 %** when purchasing a license with our system.
182
197
183
-
Our possible project has a very big potential to grow, indeed we have already been able to imagine an even more advanced system which would make it possible to propose an **OAuth** in order to validate that the licenses are possessed by the users for example.
198
+
Our possible project has a very big potential to grow, indeed we have already been able to imagine an even more advanced system which would make it possible to propose an client and/or an user dashboard to they can manage their purchased or selled licenses.
184
199
#### 🚀 After some improvements, our project will be ready to be deployed on the mainnet !
185
200
186
201
## 📤 Project Submission
@@ -198,7 +213,9 @@ Our possible project has a very big potential to grow, indeed we have already be
0 commit comments