Skip to content

Simple express and postgres project using sequelize and pg

Notifications You must be signed in to change notification settings

Harish-clb/simple-express-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-express-postgres

This is a simple express project using sequelize ORM and postgres for CRUD operations. Users with a list of subscriptions.

Users and Subscriptions tables will be created by sequelize using sync method based on the models defined.

User has subscriptions, subscriptions needs user table id which will be used as foreign key in subscriptions. Please refer to models on how its linked.

Please refer swagger for details and usage related to user and subscriptions API.

image

Technologies:

To run this project

  • Install

      npm install
  • Make sure that you update db.config.js with your local DB configuration.

  • Run the API:

      npm run start
  • Access URL

      http://localhost:3000
  • Swagger

      http://localhost:3000/docs

Add initial entries to tables using create API

  • Using any of the API clients like Postman, ThunderClient etc.

Users

{ "email": "[email protected]", "username": "Test" }

image

Subscriptions

{ "platform": "Disney+", "subscriptionType": "Premium", "startDate": "2024-02-14", "endDate": "2025-02-14", "userId": 1 }

image

About

Simple express and postgres project using sequelize and pg

Topics

Resources

Stars

Watchers

Forks