This API provides endpoints to manage authentication for the PetWell application. Using MongoDB, Node.js, Express, and other related technologies.
Demo Link: https://petwell-api-wmaq4jxv4a-et.a.run.app
- Endpoint:
/signup - Method:
POST - Description: Register a new user with email, username, name, and password.
- Body:
{ "email": "example@example.com", "username": "exampleuser", "password": "examplepassword" }
- Endpoint:
/login - Method:
POST - Description: Authenticate user by email and password to obtain access token.
- Body:
{ "email": "example@example.com", "password": "examplepassword" }
- Endpoint:
/verify/:token - Method:
GET - Description: Verify user email using the token sent to the user's email.
- Endpoint:
/forgot-password - Method:
POST - Description: Send a password reset token to the user's email.
- Body:
{ "email": "example@example.com" }
- Endpoint:
/reset-password - Method:
POST - Description: Reset the user's password using the reset token.
- Body:
{ "token": "reset_token_here", "newPassword": "new_example_password" }
- URL:
/article - Method:
POST - Request Body:
{ "title": "Judul Artikel", "desc": "Deskripsi Artikel", "thumbnail": "URL Thumbnail", "type": "Tipe Artikel" }
- URL:
/article - Method:
GET
- URL:
/article/:id - Method:
GET
- URL:
/article/:id - Method:
PUT - Request Body:
{ "title": "Judul Artikel Baru", "desc": "Deskripsi Artikel Baru", "thumbnail": "URL Thumbnail Baru", "type": "Tipe Artikel Baru" }
- URL:
/article/:id - Method:
DELETE
- Endpoint:
/pets - Method:
POST - Description: Create a new pet.
- Request Body:
{ "name": "nama hewan", "species": "kucing/anjing", "age": 3 }
- Endpoint:
/pets - Method:
GET - Description: Get all pet list.
- Endpoint:
/pets/:id - Method:
GET - Description: Get specific pet information.
- Endpoint:
/pets/:id - Method:
UPDATE - Description: Update specific pet information.
- Request Body:
{ "name": "nama hewan", "species": "kucing/anjing", "age": 3 }
- Endpoint:
/pets/:id - Method:
DELETE - Description: Delete specific pet information.
- Request Body:
- Endpoint:
/profile - Method:
GET - Description: Get user profile.
- Endpoint:
/profile - Method:
UPDATE - Description: Update user profile.
- Request Body:
{ "username": "username", "profilePict": "url" }
- Endpoint:
/appointments - Method:
GET - Description: Retrieves a list of all doctors available.
- Endpoint:
/appointments/detail - Method:
GET - Description: Retrieves details of a specific doctor including their schedules.
- Endpoint:
/appointments/detail - Method:
GET - Description: Retrieves details of a specific doctor including their schedules.
- Query Parameter: doctorId: ID of the doctor
- Endpoint:
/appointments/summary - Method:
GET - Description: Retrieves detailed appointment information based on selected work hour.
- Query Parameter: workHourId: ID of the selected work hour
To start the server, use the following command:
npm start
For development mode with automatic restarts, use:
npm run dev
Ensure you have a .env file with the following variables:
DB_URL="your_mongodb_connection_string"
USER_VERIFICATION_TOKEN_SECRET="your_verification_token_secret"
EMAIL_USERNAME="your_email@example.com"
EMAIL_PASSWORD="your_email_password"
JWT_KEY="your_jwt_secret_key"
BASE_URL=https://petwell-api-wmaq4jxv4a-et.a.run.app
- Refer to
package.jsonfor the full list of dependencies.