Copy from .env.dist to .env
% git clone [email protected]:westanvv/university-library-api.git
% cd university-library-api && yarn
For local environment Docker and Docker-compose must be installed.
For Mac: Install Docker for Mac For Windows: Install Docker for Windows
The installation provides Docker Engine, Docker CLI client, Docker Compose, and Docker Machine.
Configuration in compose.yml and Dockerfile files.
To start DB docker compose up or docker compose up -d command must be used.
This command create 1 service: database-university-library
Check services status with docker compose ps command.
% yarn dev
Local api url: http://localhost:3030
% yarn run db:sync
% yarn run db:drop
% yarn run db:migration:run
% yarn run db:migration:undo
% yarn run db:seed:all
% yarn run db:seed:undo
% yarn sequelize migration:generate --name migration-skeleton
% yarn sequelize db:migrate
% yarn sequelize db:migrate:undo
% yarn sequelize db:migrate:undo:all || sequelize-cli db:migrate:undo:all --to=20190916154403-add-column-tokeniat-to-user-table.js
.
├── /cmd # Helpful scripts
├── /node_modules # 3rd-party packages
├── /src # Application source code
│ ├── /constants # Core constants
│ ├── /controllers # Route handlers
│ ├── /db # Database components
│ ├── /helpers # Core helpers
│ ├── /middlewares # Route middleware
│ ├── /public # Public
│ ├── /routes # HTTP endpoints
│ ├── /services # General application services
│ ├── /validation # Joi validation schemas
│ ├── /views # Templates
└── index.js # Index file
% docker compose up -d
% yarn
% yarn run db:sync
% yarn run db:seed:all
% yarn run dev