Skip to content

yagreut/aqua-task

Repository files navigation

Aqua Assignment πŸš€

A RESTful user management server built with Node.js.

πŸ“Œ Features

  • Load users from a JSON file into a Map
  • Retrieve all usernames (GET /users)
  • Retrieve user info by name (GET /users/:name)
  • Create new users with validation (POST /users)
  • Validates Israeli IDs and phone numbers

πŸ› οΈ Setup (Linux)

Follow these steps to get the server up and running:

1️⃣ Prerequisites

Ensure you have Node.js and npm installed. If not, install them using:

sudo apt install nodejs npm

2️⃣ Clone the Repository

git clone https://github.com/yagreut/aqua-task
cd aqua-task

3️⃣ Install Dependencies

npm install

4️⃣ Start the Server

npm start

5️⃣ Run Tests

npm test

πŸ“„ API Endpoints

Method Endpoint Description
GET /users Returns a list of usernames
GET /users/:name Returns user details by name
POST /users Creates a new user (expects JSON body with id, phone, name, address)

πŸ“Œ Environment Variables

Create a .env file in the root directory and configure necessary environment variables:

PORT=3000
USERS_FILE_PATH=users.json

πŸ—οΈ Technologies Used

  • Node.js – Backend runtime
  • Express.js – Web framework

πŸ”Ή Happy Coding! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors