Skip to content

Latest commit

 

History

History
75 lines (50 loc) · 2.32 KB

README.md

File metadata and controls

75 lines (50 loc) · 2.32 KB

Javascript NodeJS express mysql Sequelize

YardBot API

Overview

YardBot is a telegram bot and part of YardRaffles project. This is an API backend solution - a core of the YardRaffles project.

Rare clothing items, particularly sneakers, are frequently sold in limited quantities, making their purchase challenging. To address this, major brands and their retailers conduct raffles granting the "right to purchase" these exclusive fashion pieces, simultaneously boosting their social media following.

This project focuses on such raffles. Its primary objective is to facilitate genuine enthusiasts, rather than resellers, in acquiring these items through luck, without the intent of profit-making.

Structure

App

  • controllers - calling services and handling errors
  • middleware - auth middleware for protected routes
  • migrations - data structure migrations used to initialize the db
  • models - data models declared with Sequelize
  • routes - api endpoints
  • services - performing data querying and mutation using Sequelize
  • validation - validating request data with express-validator

Database

DB dump can be found here

API

  • API documentation can be found here
  • API schema can be found here

Getting started

Install dependencies

npm install

Run migrations

npx sequelize-cli db:migrate

or import database.sql straight

Set env variables

Example:

DB_HOST="127.0.0.1"
DB_USER="root"
DB_PASSWORD=""
DB_NAME="yardraffles"
PORT=3000
AUTH_SECRET="123"

Run app

yarn dev