diff --git a/Assignment.md b/Assignment.md --- a/Assignment.md +++ b/Assignment.md @@ -1,43 +1,61 @@ -**React Native Developer Assessment** +# React Native Developer Assessment -**Introduction** -The purpose of this assignment is to evaluate your familiarity with React Native, mobile development best practices, and to showcase your approach to clean, reusable, and maintainable code. This will also help us understand your sense of design and user experience for mobile applications. +## Introduction -**Requirement** +The purpose of this assignment is to evaluate your familiarity with React Native, +mobile development best practices, and to showcase your approach to clean, reusable, +and maintainable code. This will also help us understand your sense of +design and user experience for mobile applications. + +## Requirement + Create a simple mobile banking application. -You can use the provided BankingMockAPI (see README for API details and setup instructions) as a source of data for your application. The app should allow a user to: +You can use the provided BankingMockAPI as a source of data for your application. +See README for API details and setup instructions. The app should allow a user to: 1. **Authenticate** (login) using credentials. 2. **View a list of their bank accounts** (e.g., checking, savings, etc.). -3. **View transactions** related to each account (display a list of transactions for a selected account). It should include ability to: +3. **View transactions** related to each account, display a + list of transactions for a selected account. + It should include ability to: - search - sort - paginate between transactions - 4. **View a list of their bank cards** (optional). -You are free to design the UI as you see fit, but the app should have at least the following screens: +You are free to design the UI as you see fit, +but the app should have at least the following screens: + - Login screen - Accounts overview screen - Account details/transactions screen -**Architecture** -There are no strict requirements for architecture. Please design your application as you see fit, but focus on: +## Architecture + +There are no strict requirements for architecture. +Please design your application as you see fit, but focus on: + - Clean, modular, and reusable code - Mobile development best practices - State management (your choice: Context, Redux, Redux-Toolkit etc.) - Clear separation of concerns -**Notes** -- The main technology for this assessment is **React Native**. You may use Expo or bare React Native CLI. +## Notes + +- The main technology for this assessment is **React Native**. +- You may use Expo or bare React Native CLI. - Use TypeScript for type safety. - The application should provide a good user experience on both iOS and Android. -- Please include a **README** file that explains your architectural decisions (e.g., why you chose a specific state management solution), instructions on how to run your solution, and details about the NodeJS and NPM/Yarn versions used. +- Please include a **README** file that explains your architectural decisions, + e.g., why you chose a specific state management solution, + instructions on how to run your solution, and details about the NodeJS and + NPM/Yarn versions used. - Please include **unit tests** for at least some key components/hooks/screens. - Ensure the application runs without errors before submitting. - The UI should be simple, intuitive, and visually appealing. -**Bonus Points** +## Bonus Points + - Refresh token before it expires to keep the user logged in - Add pull-to-refresh or loading indicators where appropriate - Add "infinite" scroll for transactions @@ -45,4 +63,4 @@ - e2e tests - Accessibility (voiceover, keyboard navigation, etc.) - Setup CI/CD -- Feel free to add extra features or polish to demonstrate your skills \ No newline at end of file +- Feel free to add extra features or polish to demonstrate your skills diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -3,30 +3,37 @@ ## Getting Started ### Prerequisites + - [Node.js](https://nodejs.org/) (v18 or higher) - [Docker](https://www.docker.com/) (optional, for containerized setup) ### Installation 1. Clone the repository: - ```bash - git clone - cd BankingMockAPI - ``` + +```bash +git clone +cd BankingMockAPI +``` + 2. Install dependencies: - ```bash - npm install - ``` + + ```bash + npm install + ``` ### Running the Server #### With Node.js + ```bash node server.js ``` + The server will start on [http://localhost:3001](http://localhost:3001) by default. #### With Docker + ```bash docker build -t banking-mock-api . docker run --name banking-mock-api -d -p 3001:3001 banking-mock-api @@ -35,19 +42,22 @@ Same as mentioned aboe the api will be available at on [http://localhost:3001](http://localhost:3001) Use following commands to stop or start the container: + ```bash docker container stop banking-mock-api docker container start banking-mock-api ``` - ## API Endpoints ### Authentication #### `POST /login` + Authenticate user and receive JWT and refresh token. + - **Body:** + ```json { "username": "test@test.test", @@ -63,7 +73,9 @@ ``` #### `POST /refresh-token` + Get a new JWT using a refresh token. + - **Body:** ```json { @@ -78,11 +90,12 @@ } ``` - ### Accounts #### `GET /accounts` + Get all accounts for the authenticated user. + - **Headers:** - `Authorization: Bearer ` - **Response:** @@ -101,7 +114,9 @@ ### Cards #### `GET /cards` + Get all cards for the authenticated user. + - **Headers:** - `Authorization: Bearer ` - **Response:** @@ -121,7 +136,9 @@ ### Transactions #### `GET /transactions` + Get transactions for the authenticated user, with search, sort, and pagination. + - **Headers:** - `Authorization: Bearer ` - **Query Parameters:** @@ -147,9 +164,11 @@ ``` ## Default Test User + - **Username:** `test@test.test` - **Password:** `password@123` ## Database + - The SQLite database is used. -- The database is reset and seeded with test data every time the server starts. \ No newline at end of file +- The database is reset and seeded with test data every time the server starts.