The detailed objective is available on the /UniAuth repository.
- Code Documentation: Compodocs
Running the project on local system is strongly recommended, even if you are not working on the backend. This is becuase to test the middlewars, client applications, or any other component, an instance of UniAuth OAuth server is required. Make sure that you have a mongodb instance running. This step might be different depending on your installation type. If you do not have mongodb database installed, refer this link
- Clone the repository to your system using
git clone https://github.com/UniAuth/uniauth-backend
- Now open the cloned repository using
cd uniauth-backend
- The project depends on numerous npm packages. Install them using
yarn install
ornpm install
- Run
yarn start:dev
ornpm run start:dev
to launch a development server. - Open localhost:5000 and ensure that the server is running.
Seems a long process? We have an open issue to create a docker image to make this short. Help us out by sending a pr.
Once you have a server running(use the above steps if not), now you'll need to create a user account and application credentials just like any other user would. The steps are:
- Open localhost:5000/account/register and fill in your details. Enter any random 9 digit word for registration number. This is added to demonstrate that custom fields can be added during registration itself.
There are some validations in the system , so kindly follow the following format :
Format for registration number : [2 digit year][3 character code][4 digit number]
Example: 19BCE2669, 19MIT0001, 20BTC0010 etc.
-
The page will ask you to please check your email for verification link. The email part is not integrated yet. So nothing to be done here. Head towards login and use the email and password you used to register right now.
-
Once logged in, you will see your dashboard. Please note that these are placeholder images only.
-
Head towards "Dev Arena" and click on "
New Application
" -
Enter the details of the application and click on "
Create Application
". Ideally the page must refresh itself, if it doesn't, then manually refresh it. (create issue for this please). -
Here you can see the details of the newly created application.
-
Now you can use the application details in middlewares and clients.
The user sees the following screen when during login
-
Backend
- Written in NodeJS
- Using NestJS
- In TypeScript
- Transpiles to JavaScript
- Auth using JWT and Cookies
-
Frontend
- Written in HTML, CSS and JS
- Using TailWindCSS
- Inside Handlebar
-
Database
- SignUp on (https://sendgrid.com/)
- LogIn to your account and create a sender identity by following the onscreen instructions.
- Verify the identity by clicking on the email sent to the email address that you used to create the sender identity.
- Once the sender identity is verified Click on "Send Your First Email"
- Choose "SMTP Relay" option.
- Create an API key by entering a text in the input field
- Once the API is generated you will be able to see the username and the passkey. The passkey is the API that you generated.
- Copy paste the username and passkey in "user" and "pass" fields under "auth" property of "nodemailer_config" in the "default.yml" file inside the "Config" folder which is in the root directory.
- Save the changes.
- Link to the tutorial : (https://www.youtube.com/watch?v=wViybWxSAAQ&ab_channel=NickBisignano) - Follow ony till the api key is generated.