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.
- Express - https://expressjs.com/
- Sequelize - https://sequelize.org/
- Swagger UI - Using swagger-ui-express and swagger-jsdoc libraries
- Postgres - PostgreSQL client library
-
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
- Using any of the API clients like Postman, ThunderClient etc.
{ "email": "test@gmail.com", "username": "Test" }
{ "platform": "Disney+", "subscriptionType": "Premium", "startDate": "2024-02-14", "endDate": "2025-02-14", "userId": 1 }