Skip to main content

Database Schema

The application uses three PostgreSQL tables managed via Sequelize.

users

ColumnTypeNotes
idUUIDPrimary key, auto-generated
usernameSTRINGUnique
emailSTRINGUnique
passwordSTRINGbcrypt hashed
stellarPublicKeySTRINGAuto-generated on signup
stellarSecretKeySTRINGAuto-generated on signup
firstNameSTRINGOptional
lastNameSTRINGOptional
createdAtTIMESTAMPAuto-managed by Sequelize
updatedAtTIMESTAMPAuto-managed by Sequelize

transactions

ColumnTypeNotes
transactionIdUUIDPrimary key, auto-generated
stellarTransactionIdSTRINGHash returned from Stellar network
fromSTRINGSender's Stellar public key
toSTRINGReceiver's Stellar public key
assetAmountFLOATAmount of FUC transferred
assetCodeSTRINGAlways "FUC"
userIdUUIDForeign key → users.id
createdAtTIMESTAMPAuto-managed by Sequelize
updatedAtTIMESTAMPAuto-managed by Sequelize

admins

ColumnTypeNotes
idUUIDPrimary key, auto-generated
emailSTRINGUnique
passwordSTRINGbcrypt hashed
createdAtTIMESTAMPAuto-managed by Sequelize
updatedAtTIMESTAMPAuto-managed by Sequelize

Relationships

A user has many transactions. A transaction belongs to a user. This is defined in models/associations.js and enforced via the userId foreign key on the transactions table.