- Configure and order custom mobile phones with different components (screen, camera, port, OS, and body)
- Input validation using Zod
- Error handling with custom error class
- Docker support for easy deployment and scalability
- API documentation using Swagger UI
Before running the application, make sure you have the following installed:
- Node.js (v14 or later)
- npm (v6 or later)
- Docker (if you want to run the application using Docker)
- Docker Compose (if you want to run the application using Docker Compose)
- Clone the repository:
git clone https://github.com/your-username/Backend-Assignment-Fanztar.git
- Install dependencies:
cd Backend-Assignment-Fanztar
npm install
- Start the development server:
npm run dev
The server will start running at http://localhost:3000
.
To build the application for production, run:
npm run build
This will create a dist
folder with the compiled JavaScript files.
You can run the application using Docker or Docker Compose.
- Build the Docker image:
npm run docker:build
- Run the Docker container:
npm run docker:run
The application will be accessible at http://localhost:3000
.
- Start the Docker containers:
npm run docker:compose:up
The application will be accessible at http://localhost:3000
.
- Stop the Docker containers:
npm run docker:compose:down
The API documentation is available at http://localhost:3000/api-docs
when the server is running. It provides information about the available endpoints and their request/response formats.
To run the unit tests, execute the following command:
npm test
This project uses ESLint for linting and Prettier for code formatting. You can run the following commands:
npm run lint
: Lint the TypeScript filesnpm run lint:fix
: Lint and fix any fixable issues in the TypeScript filesnpm run format
: Format the TypeScript files using Prettier
Contributions are welcome! Please follow the guidelines in the CONTRIBUTING.md file.
This project is licensed under the MIT License.