Skip to content

Off-Top-App/SettingsService

Repository files navigation

User Settings Microservice

RESTful api service that connects to MySQL database and creates/updates user's settings information.

File Location: /Users/jsc31994/Documents/projects/micro-services/settings-service/SettingsService


Database Setup

  • Application Port = 3000
  • Database Port = 3306(default)
  • Host = localhost
  • Username = root
  • Password = password
  • Database Name = userSettings
  • Table Name = settings

Repo Setup

Software Requirements

  • Node.js v12.10.0 (Nodemon recommended for hot reload)
  • MySQL Server version: 8.0.20

MySQL Table Creation

DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
`id` int NOT NULL AUTO_INCREMENT,
`user_email` varchar(40) NOT NULL,
`app_color` varchar(25) NOT NULL,
`vibration_type` varchar(25) NOT NULL,
`default_categories` varchar(100) NOT NULL,
`alert_type` varchar(25) NOT NULL,
PRIMARY KEY (`id`)
);

How to Run

  1. Run node app.js within terminal/cmd (nodemon HIGHLY recommended)
  2. Open Postman and create new Request
  3. For Post Requests (creating a row)
    • Select POST on request type
    • Enter http://localhost:3000/api/userSettings on address line
    • Select Body tab under address bar
    • Write a JSON object or use...
      • {
        	"app_color": "blue",
        	"vibration_type": "heavy",
        	"default_categories": "[math, english, science]",
        	"alert_type": "global",
        	"user_email": "[email protected]"
        }
      • Hit Send, if done properly, Success message will appear.
  4. For Patch Requests (Updating a row)
    • Select PATCH on request type
    • Enter http://localhost:3000/api/userSettings on address line
    • Select Body tab under address bar
    • Write a JSON object or use...
      • {
        	"app_color": "green",
        	"vibration_type": "light",
        	"default_categories": "[music, french, biology]",
        	"alert_type": "in-app",
        	"user_email": "[email protected]"
        }
      • Hit Send, if done properly, Success message will appear.

About

Microservice created to save user settings. Written in Node.js and runs on port 3000.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •