Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/yale-swe/f23-here
Browse files Browse the repository at this point in the history
  • Loading branch information
phucd5 committed Nov 4, 2023
2 parents ed0e12e + b0e0b61 commit 14a1029
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
53 changes: 53 additions & 0 deletions app/newHere1/newHere/Registration.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// Registration.swift
// newHere
//
// Created by TRACY LI on 2023/11/4.
//

import SwiftUI

struct RegistrationView: View {
@State private var firstName: String = ""
@State private var lastName: String = ""
@State private var email: String = ""
@State private var password: String = ""
@State private var confirmPassword: String = ""

var body: some View {
NavigationView {
Form {
Section(header: Text("Name")) {
TextField("First Name", text: $firstName)
TextField("Last Name", text: $lastName)
}

Section(header: Text("Credentials")) {
TextField("Email", text: $email)
.keyboardType(.emailAddress)
.autocapitalization(.none)
SecureField("Password", text: $password)
SecureField("Confirm Password", text: $confirmPassword)
}

Section {
Button(action: registerUser) {
Text("Submit")
}
}
}
.navigationBarTitle("Registration")
}
}

func registerUser() {
// Implement registration logic
print("User registration logic goes here.")
}
}

struct RegistrationView_Previews: PreviewProvider {
static var previews: some View {
RegistrationView()
}
}
108 changes: 108 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
Note that base url will change with deployment of backend.

# AUTH
- REGISTER: POST "http://localhost:6000/auth/register"
- params:
{
"userName": "JohnDED",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"password": "secretpassword"
}

- LOGIN: GET "http://localhost:6000/auth/login"
- params:
{
"inputLogin": "JaneD",
"password": "secretpassword"
}

# MESSAGE
- POST MESSAGE: POST "http://localhost:6000/message/post_message"
- params:
{
"user_id": "653d51478ff5b3c9ace45c26",
"text": "Hi, this is a test message - Jane",
"visibility": "friends",
"location": {
"type": "Point",
"coordinates": [40.7128, -74.0060]
}
}

- DELETE MESSAGE: POST "http://localhost:6000/message/delete_message"
- params:
{
"messageId": "653d62a37ce9c61f28dcaa7f"
}

- INCREMENT LIKES: POST "http://localhost:6000/message/increment_likes"
- params:
{
"id": "653d62de7ce9c61f28dcaa87"
}

- CHANGE VISIBILITY: POST "http://localhost:6000/message/change_visibility"
- params:
{
"id": "dsfsf",
"new_data": ""
}

# REPLY
- ADD REPLY: POST "http://localhost:6000/reply/reply_to_message"
- params:
{
"message_id": "653ea4a35b858b2542ea4f13",
"content": "this is a test reply to a test message"
}

- LIKE REPLY: GET "http://localhost:6000/reply/like_reply"
- params:
{
"reply_id": "somekindofreplyid"
}

# USER
- SEARCH USER BY USER_ID: GET "http://localhost:6000/user/search"
- params:
{
"userId": ""
}
- SEARCH USER BY EMAIL: GET "http://localhost:6000/user/search"
- params:
{
"email": "[email protected]"
}

- SEARCH USER BY USERNAME: GET "http://localhost:6000/user/search"
- params:
{
"userName": ""
}

- ADD USER FRIEND: PUT "http://localhost:6000/user/userid"
- params:
{
"friendId": "friend's id"
}

- GET FRIEND OF USER: GET "http://localhost:6000/user/userId/friends"

- TOGGLE NOTIFY FRIENDS: PUT "http://localhost:6000/user/userId/toggle-notify-friends"

- UPDATE PROFILE: PUT "http://localhost:6000/user/userId/update-profile"
- params:
{
"userName": "john_d",
"password": "hello",
"firstName": "Johnn",
"lastName": "Doee",
"email": "[email protected]",
"avatar": ""
}

- REMOVE USER FRIEND: GET "http://localhost:6000/user/search/[email protected]"

- DELETE USER: DELETE "http://localhost:6000/user/653d58a37ab5eaf376965b82"

0 comments on commit 14a1029

Please sign in to comment.