Skip to content

The service to keep the core 'hero' information (actuallly more like profile-service...)

Notifications You must be signed in to change notification settings

Volunteero/user-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Service (Altar)

The CRUD for the user data associated with the usernames

Internal

Build with express and mongoose

Hosting

Hosted on Heroku as volunteero-altar: https://volunteero-altar.herokuapp.com/altar/v1/users

Routes

POST: ../altar/v1/users
purpose: create a new user entry
body in: (request)

{
	"username":"dafoe5",
	"first_name":"Friend"
  ...
}

body out: (response)

{
	"success": true,
	"user": {
		"user_id": "124387561asd374",
		"username": "dafoe2",
		"first_name": "Friend",
		"last_name": "",
		"email": "",
		"city": "",
		"country": "",
		"bio": "",
		"points": 0
	}
}

PUT: ../altar/v1/users
purpose: update a user
body in: (request)

{
	"username":"dafoe5",   # points to the user
	"first_name":"Friend", # the updated fields
	"last_name":"Dafoe"    #
}

body out: (response)

{
	"success": true,
	"user": {
		"user_id": "124387561asd374",
		"username": "dafoe5",
		"first_name": "Friend",
		"last_name": "Dafoe",
		"email": "",
		"city": "",
		"country": "",
		"bio": "",
		"points": 0
	}
}

GET: ../altar/v1/users
purpose: get all the users
body out: (response)

[
	{
		"user_id": "124387561asd374",
		"username": "bobski",
		"first_name": "Bob",
		"last_name": "Ski",
		"email": "",
		"city": "Paris",
		"country": "USA",
		"bio": "",
		"points": 0
	},
	...
]

PUT: ../altar/v1/users/find
purpose: find a user by request
body in: (request)

{
	"username":"dafoe5"  
}

or

{
	"user_id":"dafoe5"  
}

note: if the input body contains both user_id and username, the preference is for the latter
body out: (response)

{
	"username": "dafoe5",
	"first_name": "Friend",
	"last_name": "",
	"email": "",
	"city": "",
	"country": "",
	"bio": ""
}

PUT: ../altar/v1/users/delete
purpose: find a user by request
body in: (request)

{
	"username":"dafoe5"
}

body out: (response)

{
	"success": true,
}

POST: ../altar/v1/users/:username/confirmEventParticipation
purpose: add points to a user body in: (request)

{
	"points": 123
}

body out: (response)

{
	"newPoints": 223,
}

About

The service to keep the core 'hero' information (actuallly more like profile-service...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published