Code Monkey home page Code Monkey logo

typescript-sequelize-example's Introduction

TypeScript + Sequelize v5 Example Project

This project aims to demonstrate basic usage of Sequelize in conjunction with TypeScript and Node.js. There are many examples out there, but few deal with version 5 of Sequelize, which comes with its own typing. If you find any issues or ways to improve it, let me know!

Format

The example consists of a simple database layout with three entity types: students, teachers, and classes.

Database Layout

Each class belongs to one teacher, and there is a many-to-many association between students and classes. Interaction with the database is handled by a simple API powered by Express.

Running the Project

While this project is intended mostly to provide guidance, it does run! To run the example, you will need Docker Desktop and Node.js. With these installed, simply clone the repository and run

npm install

in the root directory. The npm commands in package.json function as follows:

  • attached - Run the server and database in the foreground of your console
  • background - Run the server and database in the background
  • logs - View console output of the background processes
  • populate - After the database and server are fully initialized, running this will insert sample data into the database
  • stop - Stop the killed or backgrounded docker process

The API is documented lightly in the source code.

typescript-sequelize-example's People

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.