hexfa / PassEntry

Simple Android Application for PassEntry
13 stars 92 forks source link

N|Solid

Simple Android Application


Overview πŸš€

Welcome to the PassEntry Android application repository! This project is designed to showcase a simple Android application integrated with a mock HTTP API.

Application Features πŸ“±

1. Login Page πŸ”

The application features a login page that accepts a username and password. Upon submission, the credentials are validated against the /login endpoint of the included mock API.

2. Tap History Page πŸ”„

Authenticated users can access the tap history page, displaying a list of pass taps retrieved from the /taps endpoint of the mock API.

Preview πŸ“±

APK fileπŸ“₯

You can download the precompiled APK file of the debug version from HERE.

Images πŸ–ΌοΈ

PassEntry App hexfa PassEntry App amir

Video πŸ“½οΈ

PassEntry App dehdarian fallah

Documentation πŸ“œ

Mock API Integration πŸ€–

🌐 I've hosted the mock API on an online server accessible at http://154.62.108.207:3000. This server will be available until December 31, 2023. You can use this IP address for API integration. 🌐

Alternatively, if you prefer to run the mock API locally, execute the following command:

docker-compose up --build

This will launch the mock HTTP API, accessible at http://localhost:3000.

Mock API Endpoints 🌐

1. POST /login

Description πŸšͺ

Authenticate a user and generate an API token.

Request πŸ“€

Request Body
{
  "username": "hello@passentry.com",
  "password": "securepass"
}

Success Response βœ…

If correct credentials are provided, the response body contains an API token for use with the /taps endpoint.

Success Response Body
{
  "api-token": "your-api-token"
}

Error Response ❌

If incorrect credentials are provided, no token is returned.

Error Response Body
{
  "error": "Unauthorized"
}

2. GET /taps

Description πŸ“Š

Retrieve a collection of pass tap history data.

Note: Include the bearer token returned by the /login endpoint in the request header for successful authentication.

Request πŸ“₯

Success Response βœ…

[
  {
    "tappedAt": "2023-12-22T12:34:56.789Z",
    "status": "success",
    "readerId": "someReaderId"
  },
  {
    "tappedAt": "2023-12-23T12:34:56.789Z",
    "status": "fail",
    "readerId": "someReaderId"
  }
  // ... more data
]

Error Response ❌

If the authorization token is missing or invalid, no data is returned.

Error Response Body
{
  "error": "Unauthorized"
}

Technologies and Libraries πŸ› οΈ

The PassEntry Android application is built using the following technologies and libraries: