Code Monkey home page Code Monkey logo

university-library-api's Introduction

API

Configuration

Copy from .env.dist to .env

Local development

Clone and install dependencies
% git clone [email protected]:westanvv/university-library-api.git

% cd university-library-api && yarn
Docker

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.

Running in development mode
% yarn dev

Local api url: http://localhost:3030

Commands for managing DB:
% 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

Structure

.
├── /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

First start

% docker compose up -d
% yarn
% yarn run db:sync
% yarn run db:seed:all
% yarn run dev

university-library-api's People

Contributors

westanvv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.