Business-Only App Builder
Technical

Business-Only App Builder

by Anonymous · 2026-09-02

Building an app that allows only businessmen users

5 chapters 2,303 words ~9 min read Bengali 121 reads

Read the first chapter

The whole of chapter one, free. About 2 min. Turn the pages with the arrows, your keyboard, or a swipe.

Chapter 1

বিজনেসম্যান-শুধু লগইন ও ভূমিকা

লগইনের পর ব্যবহারকারীকে শুধু পরিচয়প্রমাণকারী হিসেবে নয়, যাচাইকৃত ব্যবসায়ী হিসেবে শনাক্ত করতে হবে। এই অংশে Role Gate Framework ব্যবহার করে যাচাই, ব্যবসায়িক ভূমিকা সেট করা এবং অননুমোদিত প্রবেশ আটকে দেওয়ার অথেনটিকেশন ফ্লো দেখানো হয়েছে; ব্যবসায়ী-শুধু অ্যাপের সাইন-ইন ও সেশন তৈরির সময় এটি প্রয়োগ করুন।

ফ্লোর প্রধান এন্ডপয়েন্ট

এন্ডপয়েন্ট

পদ্ধতি

উদ্দেশ্য

/auth/login

POST

পরিচয়পত্র যাচাই ও প্রাথমিক টোকেন তৈরি

/business/verify

POST

ব্যবসার নিবন্ধন নম্বর যাচাই

/auth/role

PATCH

যাচাইকৃত ব্যবহারকারীর business ভূমিকা সেট

/auth/me

GET

বর্তমান সেশন ও ভূমিকা পড়া

Role Gate Framework -এর নিয়ম:

• বৈধ পরিচয়পত্র না থাকলে ভূমিকা সেট করা যাবে না।

• ব্যবসা যাচাই ব্যর্থ হলে প্রবেশাধিকার 403 হবে।

• শুধু সার্ভার যাচাইকৃত দাবির ভিত্তিতে business ভূমিকা টোকেনে যোগ হবে।

ইনপুট ও বিকল্পগুলোর সংজ্ঞা

Parameter

Type

Required

Description

email

string

হ্যাঁ

লগইন ইমেইল; স্বাভাবিকীকৃত ছোট হাতের অক্ষর ব্যবহার করুন

password

string

হ্যাঁ

পাসওয়ার্ড; সার্ভারে হ্যাশের সঙ্গে মিলিয়ে দেখুন

registrationNumber

string

হ্যাঁ

ব্যবসার সরকারি নিবন্ধন নম্বর

countryCode

string

হ্যাঁ

দুই অক্ষরের দেশ কোড, যেমন BD

role

string

না

ডিফল্ট pending; যাচাই সফল হলে কেবল business

accessToken

string

হ্যাঁ

লগইনের পর প্রাপ্ত বাহক টোকেন

যাচাই ও ভূমিকা সেট করার কোড

// ব্যবহারকারী লগইন করে প্রাথমিক টোকেন পায় const login = await fetch("/auth/login", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email: "owner@example.com", password: "নিরাপদ-পাসওয়ার্ড" }) });

const session = await login.json();

// ব্যবসার সরকারি নিবন্ধন নম্বর যাচাই const verification = await fetch("/business/verify", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": Bearer ${session.accessToken} }, body: JSON.stringify({ registrationNumber: "RJSC-2026-004281", countryCode: "BD" }) });

if (!verification.ok) { throw new Error("ব্যবসা যাচাই ব্যর্থ"); }

// যাচাই সফল হলে সার্ভার ভূমিকা সেট করে const roleUpdate = await fetch("/auth/role", { method: "PATCH", headers: { "Content-Type": "application/json", "Authorization": Bearer ${session.accessToken} }, body: JSON.stringify({ role: "business" }) });

const result = await roleUpdate.json(); console.log(result.user.role); // business প্রত্যাশিত প্রতিক্রিয়া কাঠামো

{ "user": { "id": "usr_8f21c", "email": "owner@example.com", "role": "business", "businessVerified": true, "verifiedAt": "2026-09-02T10:15:00Z" }, "accessToken": "eyJhbGciOiJIUzI1NiJ9...", "expiresIn": 3600 } • id: অভ্যন্তরীণ ব্যবহারকারী শনাক্তকারী।

• role: অনুমোদিত অ্যাপ ভূমিকা; যাচাইয়ের আগে pending ।

• businessVerified: ব্যবসার নথি সফলভাবে যাচাই হয়েছে কি না।

• verifiedAt: সার্ভার-নির্ধারিত যাচাইয়ের সময়।

• accessToken: পরবর্তী অনুরোধের জন্য স্বল্পমেয়াদি টোকেন।

• expiresIn: টোকেনের মেয়াদ, সেকেন্ডে।

নিরাপত্তা ও ব্যর্থতার নিয়ম

• একই ইমেইল বা আইপি থেকে প্রতি মিনিটে সর্বোচ্চ ৫টি লগইন এবং ৩টি ব্যবসা যাচাই অনুরোধ অনুমোদন করুন; অতিরিক্ত হলে 429 দিন।

• ভুল পাসওয়ার্ডে 401, অপর্যাপ্ত ব্যবসায়িক যাচাইয়ে 403, এবং অবৈধ ইনপুটে 422 ফেরত দিন।

• ক্লায়েন্টের পাঠানো role: "business" কখনও বিশ্বাস করবেন না; ভূমিকা সার্ভার-সাইড যাচাইয়ের পর সেট করুন।

• টোকেনে ব্যবসার নিবন্ধন নম্বর রাখবেন না; প্রয়োজন হলে সার্ভার-সাইড ডেটাবেস থেকে পড়ুন।

End of chapter one. 4 more chapters and about 2,303 words in the full book.

1 / 3

Swipe or use the arrows to turn the page

What's inside: 5 chapters

  1. 1. বিজনেসম্যান-শুধু লগইন ও ভূমিকা
  2. 2. /businesses CRUD: বিজনেস প্রোফাইল
  3. 3. /business-users এন্ডপয়েন্ট: সদস্য যোগ
  4. 4. বিজনেস-শুধু অ্যাকশন Webhook Events
  5. 5. 403/404 রেসপন্স ডিবাগিং গাইড

About this book

"Business-Only App Builder" is a technical book by Anonymous with 5 chapters and approximately 2,303 words. Building an app that allows only businessmen users.

This book was created using Inkfluence AI, an AI-powered book generation platform that helps authors write, design, and publish complete books. It was made with the AI Documentation Generator.

Frequently Asked Questions

What is "Business-Only App Builder" about?

Building an app that allows only businessmen users

How many chapters are in "Business-Only App Builder"?

The book contains 5 chapters and approximately 2,303 words. Topics covered include বিজনেসম্যান-শুধু লগইন ও ভূমিকা, /businesses CRUD: বিজনেস প্রোফাইল, /business-users এন্ডপয়েন্ট: সদস্য যোগ, বিজনেস-শুধু অ্যাকশন Webhook Events, and more.

Who wrote "Business-Only App Builder"?

This book was written by Anonymous and created using Inkfluence AI, an AI book generation platform that helps authors write, design, and publish books.

How can I create a similar technical book?

You can create your own technical book using Inkfluence AI. Describe your idea, choose your style, and the AI writes the full book for you. It's free to start.

Write your own technical book with AI

Describe your idea and Inkfluence writes the whole thing. Free to start.

Start writing

Created with Inkfluence AI