Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

104 Commits

Repository files navigation

subscribe-to-backend

backend: Elijah Cobb

frontend:Trevor Sears

Security Practices

User Passwords

User passwords are salted and stored after going through a hashing iterator 1000 times. They are hashed using the sha256 hashing algorithm. At no time will a user's password ever be stored in plain text. The only time the server ever returns the user's password is during the sign up process when it encrypts the user's password with a shared private secret to provide a stateless environment for account registration while verifying the new user's email account. However the password is already salted and it is encrypted using the aes-256-cbc encryption standard.

Permissions

All user interactions are done using a token. The token is an identifier for a session object that is retained in a state based environment by the server. On most endpoints, you are required to specify a token. Simply follow the bearer style.

For the header Authorization simply provide a value of Bearer X where X is the token provided to you by the server.

Object Structures

User

KeyTypeOptionalDescription
firstNamestringXThe user's first name.
lastNamestringXThe user's last name.
emailstring-The user's email address.
phonestringXThe user's phone number.
genderUserGenderXThe user's gender.
birthdaystringXThe user's birthday with format mmddyyyy.
idstring-The user's identifier.
updatedAtnumber-The number of milliseconds after 1970 the user was last updated.
createdAtnumber-The number of milliseconds after 1970 the user was created.

UserGender

IndexDescription
0male
1female
2other

Business

KeyTypeOptionalDescription
namestring-The business's name.
latnumber-The business's latitude.
lngnumber-The business's longitude.
idstring-The business's identifier.
updatedAtnumber-The number of milliseconds after 1970 the business was last updated.
createdAtnumber-The number of milliseconds after 1970 the business was created.

Product

KeyTypeOptionalDescription
namestring-The product's name.
descriptionstring-The product's description.
businessIdstring-The id of the business the product belongs to.
idstring-The product's identifier.
updatedAtnumber-The number of milliseconds after 1970 the product was last updated.
createdAtnumber-The number of milliseconds after 1970 the product was created.

Program

KeyTypeOptionalDescription
productIdstring-The id of the product the program is for.
businessIdstring-The id of the business the program belongs to.
pricenumber-The price of the program every month in pennies.
allowancenumber-The amount of times the subscription can be used per month.
successorIdstringXThe id of the successor to this program if there is one.
closedboolean-Whether or not the program is allowing any new subscriptions.
updatedAtnumber-The number of milliseconds after 1970 the program was last updated.
createdAtnumber-The number of milliseconds after 1970 the program was created.

Subscription

KeyTypeOptionalDescription
userIdstring-The id of the user that uses the subscription.
businessIdstring-The if of the business that provides the subscription.
programIdstring-The id of the program the subscription if for.
autoRenewboolean-Whether the subscription should auto-renew at the end of the month.
idstring-The product's identifier.
updatedAtnumber-The number of milliseconds after 1970 the product was last updated.
createdAtnumber-The number of milliseconds after 1970 the product was created.

About

The NodeJS backend for Subscribeto.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages