A simple API project for user invitation, sign up, login, logout, and user details editing.
- Invite users by entering their details
- Sign up using an invitation ID and set a password
- Log in with email and password
- Log out from the session
- Edit user details (password, name, phone, alternate email)
- POST /invitation: Invite a user by providing their details.
- POST /signup: Sign up using an invitation ID and set a password.
- POST /login: Log in with email and password.
- POST /logout: Log out from the session.
- PUT /edit-user: Edit user details (password, name, phone, alternate email).
- Invitation
curl -X POST \
http://localhost:3000/invitation \
-H 'Content-Type: application/json' \
-d '{
"name": "Ajay Suresh SJ",
"email": "[email protected]",
"phone": "1234567890",
"alternate_email": "[email protected]",
"organizations": {
"organization_name": "ABC Company",
"role_in_organization": "Manager",
"valid_till": "2024-12-31"
}
}'
- Sign up
curl -X POST \
http://localhost:3000/signup \
-H 'Content-Type: application/json' \
-d '{
"id": "6035ea7a-0d03-4cca-88f3-2bf79717a908",
"password": "my_secure_password"
}'
- Login
curl -X POST \
http://localhost:3000/login \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"password": "my_secure_password"
}'
- Edit User
curl -X PUT \
http://localhost:3000/edit-user \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"newPassword": "new_secure_password",
"newDetails": {
"name": "Ajay Suresh SJ",
"phone": "9876543210",
"alternate_email": "[email protected]"
}
}'
- Logout
curl -X POST \
http://localhost:3000/logout
- Node.js
- Express.js
- SQLite
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License.