Your one-stop solution for organizing and storing memories!
First, clone the repository,
git clone https://github.com/mrinjamul/pocket-memory
cd pocket-memory
Install npm packages,
npm install
Copy environment file,
cp .env{.example,}
Fill the environment files with the required values.
To run the backend server,
npm run dev
Now, Install the frontend npm packages
cd ui && npm install
Copy environment file,
cp .env{.example,}
Run the frontend,
npm run dev
-
Method: POST
-
Endpoint: /auth/signup
-
Description: Register a new user.
-
Request Body:
name
: (string): Full nameusername
(string, required): Username of the user.email
(string, required): Email address of the user.password
(string, required): Password for the user account.
Example,
{
"name":"Injamul M.",
"username":"injamul",
"email":"injamul@example.com",
"password":"password"
}
- Response:
status
: (boolean): status of the requestdata
(object): return the user data (object).
- Method: POST
- Endpoint: /auth/login
- Description: Log in an existing user.
- Request Body:
username
(string, required): Username of the user.email
: (string): Email of the user.password
(string, required): Password for the user account.
Example,
{
"username":"injamul",
"password":"password"
}
- Response:
status
: (boolean): status of the requesttoken
(string): JWT token for authenticated access.data
(object): return the user data (object).
- Method: GET
- Endpoint: /auth/logout
- Description: Log out the currently authenticated user.
- Response:
status
: (boolean): status of the request- `` (string): JWT token for authenticated access.
message
(string): response with message.
-
Method: GET
-
Endpoint: /api/v1/user/:username
-
Description: Retrieve user details by username.
-
Parameters:
username
(string, required): Username of the user.
-
Response:
status
: (boolean): status of the requestdata
: (object) User object containing username, email, etc.
- Method: POST
- Endpoint: /api/v1/avatar/upload
- Description: Upload a new avatar for the currently authenticated user.
- Request Body: Form Data
avatar
(file, required): Avatar image file.
- Authorization Header: Bearer Token
- Method: GET
- Endpoint: /api/v1/avatar/:file
- Description: Retrieve the avatar image file by its filename.
- Parameters:
file
(string, required): Name of the avatar image file.
- Method: POST
- Endpoint: /api/v1/picture/upload
- Description: Upload a new picture.
- Request Body: Form Data
picture
(file, required): Picture image file.
- Authorization Header: Bearer Token
- Method: GET
- Endpoint: /api/v1/picture
- Description: Retrieve all pictures.
- Response:
- Array of picture objects.
- Method: GET
- Endpoint: /api/v1/picture/u/:username
- Description: Retrieve pictures uploaded by a specific user.
- Parameters:
username
(string, required): Username of the user.
- Response:
- Array of picture objects.
- Method: GET
- Endpoint: /api/v1/picture/:file
- Description: Retrieve a picture by its filename.
- Parameters:
file
(string, required): Name of the picture file.
- Method: POST
- Endpoint: /api/v1/picture/:id
- Description: Update a picture by its ID.
- Parameters:
id
(string, required): ID of the picture.
- Request Body:
- Updated picture data.
- Response:
- Updated picture data.
- Authorization Header: Bearer Token
- Method: DELETE
- Endpoint: /api/v1/picture/:id
- Description: Delete a picture by its ID.
- Parameters:
id
(string, required): ID of the picture.
- Response:
- Deleted picture data.
- Authorization Header: Bearer Token
Injamul Mohammad Mollah (c) 2024 mrinjamul(at)gmail(dot).com