This is a RESTful API built with Ruby on Rails, designed for managing user and contact information. It utilizes a PostgreSQL database and adheres to RESTful principles for seamless interaction with client applications.
- User Management:
- Create, read, update, and delete user accounts.
- Primary email management.
- User authentication (login and signup).
- Contact Management:
- Create, read, update, and delete contact information.
- Associates contacts with users.
- Handles various contact types (emails, phone numbers, etc.).
- Authentication:
- Secure endpoints for user authentication using JWT.
- Protected Endpoint:
/notify
endpoint: A protected endpoint that receives auserId
for notification purposes.
- GRPC Notification Service Integration:
- Communicates with an external notification server via GRPC.
- Ruby on Rails (API-only mode)
- PostgreSQL
- UUID v4
- JWT (JSON Web Tokens)
- GRPC
(Provide a list of the API endpoints here, e.g.)
POST /signup
- User signupPOST /login
- User loginGET /users
- List all usersGET /users/:id
- Get a specific userPOST /users
- Create a new userPUT /users/:id
- Update a userDELETE /users/:id
- Delete a userGET /users/:user_id/contacts
- List all contacts of a userGET /contacts/:id
- Get a specific contactPOST /contacts
- Create a new contactPUT /contacts/:id
- Update a contactDELETE /contacts/:id
- Delete a contactPOST /notify
- Send a notification (protected)
-
Clone the repository:
git clone <repository_url> cd <repository_name>
-
Install dependencies:
bundle install
-
Configure the database:
-
Create a
config/database.yml
file with your PostgreSQL credentials. -
Run database migrations:
rails db:create rails db:migrate
-
-
Start the server:
rails s
-
GRPC Service Setup:
- Add instructions on how to setup the GRPC connection
- User authentication is required for protected endpoints.
- Use the
/login
endpoint to obtain a JWT. - Include the JWT in the
Authorization
header of your requests (e.g.,Authorization: Bearer <token>
).
- Explain how the GRPC client is configured and used to communicate with the notification service.
- Include details about the GRPC service's address and port.
- Explain how to run the tests.
- Explain how others can contribute to the project.
- Specify the license under which the project is distributed.