- Clone the repository.
git clone https://github.com/poppymint016/cryptocurrency
- Install the required dependencies using
npm install
- Install bcrypt & Import data seed using
npm install bcrypt
node seed.js
- Start the development server using
npm start
- userID
- username
- password
- WalletID
- userID (Foreign Key references User table)
- balance
- name (e.g., BTC, ETH, XRP, DOGE)
- currentPrice
- userID (Foreign Key references User table)
- receiverID (Foreign Key references User table)
- cryptoID (Foreign Key references Cryptocurrency table)
- transactionType (Buy/Sell/Transfer)
- amount
- timestamp
เงื่อนไข ผู้ใช้จะต้องทำการสร้างบัญชีก่อนและทำการเข้าสู่ระบบเพื่อรับค่า token จากนั้นเติมเงินเข้าสู่ wallet เพื่อทำการซื้อ ขาย และแลกเปลี่ยน
- User Registration
- Method Post /api/register
- ลงทะเบียนเข้าสู่ระบบ
- User Login
- Method Post /api/login
- เข้าสู่ระบบ
เมื่อต้องการฝากเงินจะต้องกรอก Headers: x-access-token และกรอก token จาก register หรือ login ก่อนเทส API
- Deposit wallet
- Method Post /api/createWallet
- เพิ่มเงิน wallet สำหรับซื้อ ขาย แลกเปลี่ยนคริปโต
- Balance Wallet
- Method GET /api/getUserWallet
- เช็คยอดเงินคงเหลือใน wallet
สำหรับสร้างคริปโตไว้เพื่อให้ user ซื้อขาย หรือสำหรับการเพิ่มข้อมูลลงในฐานข้อมูล
- Add Cryptocurrency
- Method POST /api/createCrypto
- สร้างข้อมูลคริปโต
- GET Cryptocurrency
- Method GET /api/getCrypto
- ดูข้อมูลคริปโตทั้งหมด
- UPDATE Cryptocurrency
- Method PUT /api/updateCrypto
- อัปเดตข้อมูลคริปโต
- DELETE Cryptocurrency
- Method DELETE /api/deleteCrypto/:cryptoId
- ลบข้อมูลคริปโต
การซื้อ ขาย และแลกเปลี่ยนจะต้องกรอก Headers: x-access-token และกรอก token จาก register หรือ login ก่อนเทส API
- Buy Cryptocurrency
- Method POST /api/buyCrypto
- ซื้อคริปโต
- Sell Cryptocurrency
- Method POST /api/sellCrypto
- ขายคริปโต
- Transfer Cryptocurrency
- Method POST /api/transferCrypto
- แลกเปลี่ยนคริปโต
- Transaction Cryptocurrency
- Method GET /api/getUserTransaction
- ประวัติการทำรายการทั้งหมด