The backend of Wizkid mobile App
This project demonstrates the Wizkid POC (Provides a hosted API that powers the UI with seeded data).
Database
: PostgreSQLLanguage
: Javascript/ES6^Unit Test
: Mocha, Chai, SinonFramework / Environment
: Node.js && Expressversion control
: Git/Github
- Ensure you have all the below listed stacks on your machine
- From you terminal run
git https://github.com/CyberFuzzion/api_template_repo.git
- After cloning run
cd api_template_repo
to navigate to cloned directory - run
npm install
to install all the devDevpendencies. See "devDependencies" section in package.json file for list of all packages that will be installed - Add environment variables in
.env
file, seeenv-sample
file for example. - run
npm run migrate
to run database migrations - run
npm run seed
to seed the database with prepared "transactions" seeds - run
npm test
ornpm t
to run test
npm run start:dev
: To run development modenpm run build
: To run buildnpm start
: To run production modenpm test
: To run test- See the scripts section of package.json file for all available configured scripts.
Postgres and Sequelise ORM Script.
npm run migrate
: to run models migration to databasenpm run undo-migrate
: to undo models migration to databasenpm run seed
: to run seednpm run undo-seed
: to undo seed
See sequelise documentation below for more guides on creating and managing models https://sequelize.org/master/manual/migrations.html**
POST /api/v1/auth/sign_in
: Sign in- Payload
body:
{
branch, login_ID
}
GET /api/v1/transactions/fetch
: Get Transactions- Payload
header:
{
authorization: `Bearer ${token}`
}