Technologies | Getting Started | API Endpoints | Collaborators | Contribute
A test task from effective mobile
- Vite (React Router v7)
- React
- Express
- TypeScript
- Drizzle ORM (PostgreSQL)
The project includes several components: a basic web application for interacting with the API, an API server, as well as packages containing common data types and database access.
It is recommended to use the web application in conjunction with the API server through the static content mechanism.
Detailed instructions on how to set up and launch the project are provided in the following sections.
To implement the project, the following software components are required:
Copy this repository and navigate to its root directory, and then install the dependencies:
git clone https://github.com/Zamelane/effective-mobile-test-task
cd effective-mobile-test-task
npm iIt is necessary to create a configuration file with the .env extension.
To do this, use the .env.example file as a template. In the created .env file, you need to enter your credentials for accessing the database and other parameters, if necessary.
During the system initialization task, it is recommended to make changes exclusively to the section on DATABASE configuration. It is important to specify the correct connection parameters to your database.
############
# DATABASE #
############
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=emtt
#######
# API #
#######
API_PORT=3000
API_JWT_SECRET=zR8J0MA9jh6lfyQMAeeYFUknQdPS6lM7
NODE_ENV=production # developmentBefore starting the project, the following steps must be performed::
- Make sure that the database specified in the
.envconfiguration file exists. - Check the availability of the public schema in the database and its current state (it should be empty).
Run the command in the root of the repository to create the table structure:
npm run db:migrateTo enter the test data, run the following command:
npm run db:seedAssemble the web components of the project using the command:
npm run web:buildAfter completing the above steps, start the server and follow the link displayed in the console.
npm run api:devData from the administrator account
Login: admin@admin.com
Password: admin!
The main API routes are shown here and the expected request types are indicated.
For clarity, the prefix /api is omitted. Take this into account before using!
| route | description |
|---|---|
| POST /login | User authentication in the system. For more information, see the request details section. |
| POST /registration | Registration of a new user in the system. For more information, see the request details section. |
| GET /users/:id | Getting information about a specific user by their ID. For more information, see the request details section. |
| POST /users/:id | Updating user profile data with the specified ID. For more information, see the request details section. |
| POST /users/:id/ban | Blocking (ban) the user by ID. For more information, see the request details section. |
| POST /users/:id/unban | Unblocking (removing ban) a user by ID. For more information, see the request details section. |
| GET /usersList/:page?pageSize={number} | Getting a page-by-page list of users with the ability to specify the page size. For more information, see the request details section. |
REQUEST
{
"email": "admin@admin.com",
"password": "admin!"
}RESPONSE
{
"userInfo": {
"id": 853,
"firstName": "Admin",
"lastName": "Adminovich",
"middleName": "",
"birthDate": "2010-10-09T00:00:00.000Z",
"email": "admin@admin.com",
"role": "admin",
"isActive": true,
"createdAt": "2025-08-19T15:59:26.943Z",
"updatedAt": "2025-08-19T15:59:26.943Z"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}REQUEST
{
"firstName": "Имя",
"lastName": "Фамилия",
"middleName": "Отчество",
"birthDate": "2025-08-01T00:00:00.000Z",
"email": "superTest@mail.ru",
"password": "TestPass1!"
}RESPONSE
{
"userInfo": {
"id": 956,
"firstName": "Имя",
"lastName": "Фамилия",
"middleName": "Отчество",
"birthDate": "2025-08-01T00:00:00.000Z",
"email": "superTest@mail.ru",
"role": "user",
"isActive": true,
"createdAt": "2025-08-19T18:06:20.273Z",
"updatedAt": "2025-08-19T18:06:20.273Z"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}RESPONSE
{
"id": 956,
"firstName": "Имя",
"lastName": "Фамилия",
"middleName": "Отчество",
"birthDate": "2025-08-01T00:00:00.000Z",
"email": "superTest@mail.ru",
"role": "user",
"isActive": true,
"createdAt": "2025-08-19T18:06:20.273Z",
"updatedAt": "2025-08-19T18:06:20.273Z"
}REQUEST
{
"firstName": "Имя",
"lastName": "Фамилия",
"middleName": "Отчество",
"birthDate": "2025-08-01T00:00:00.000Z",
"email": "superTest@mail.ru"
}RESPONSE
{
"id": 956,
"firstName": "Имя",
"lastName": "Фамилия",
"middleName": "Отчество",
"birthDate": "2025-08-01T00:00:00.000Z",
"email": "superTest@mail.ru",
"role": "user",
"isActive": true,
"createdAt": "2025-08-19T18:06:20.273Z",
"updatedAt": "2025-08-19T18:06:20.273Z"
}RESPONSE
{
"id": 956,
"firstName": "Имя",
"lastName": "Фамилия",
"middleName": "Отчество",
"birthDate": "2025-08-01T00:00:00.000Z",
"email": "superTest@mail.ru",
"role": "user",
"isActive": false,
"createdAt": "2025-08-19T18:06:20.273Z",
"updatedAt": "2025-08-19T18:06:20.273Z"
}RESPONSE
{
"id": 855,
"firstName": "Андрей",
"lastName": "Васильев",
"middleName": "Петровна",
"birthDate": "1992-10-01T00:00:00.000Z",
"email": "peter.johnson.474@hotmail.com",
"role": "user",
"isActive": true,
"createdAt": "2025-08-19T15:59:27.046Z",
"updatedAt": "2025-08-19T15:59:27.046Z"
}RESPONSE
{
"data": [
{
"id": 853,
"firstName": "Admin",
"lastName": "Adminovich",
"middleName": "",
"birthDate": "2010-10-09T00:00:00.000Z",
"email": "admin@admin.com",
"role": "admin",
"isActive": true,
"createdAt": "2025-08-19T15:59:26.943Z",
"updatedAt": "2025-08-19T15:59:26.943Z"
},
<...>
],
"page": 1,
"pageSize": 8
}Special thank you for all people that contributed for this project.
|
Evgeny Malinin |
To contribute to the project, follow these steps:
git clone https://github.com/zamelane/effective-mobile-test-task.gitgit checkout -b feature/NAME- Follow the commit templates
- Open a pool request with a description of the solved problem or implemented function, if any, attach a screenshot of the visual changes and wait for verification!







