The random phone number generator is a project inspired by my LMS Outputs for Andela for my D2 Assessments. The aim is to specify an amount of random phone numbers you would like to generate. The results are downloadable in a text file which consists of these phone numbers sorted in ascending or descending order.
- Getting Started
- Technology Stack
- Installation
- Usage
- Testing
- API Endpoints
- Questions
- Support or Contribution
This is a javascript application built with Node JS using Express framework on the backend and React JS on the frontend. This application can run on any browser that is not IE 😀 as there are issues with the file-downloader.
UI & Templates
- Bulma CSS Framework
- Styled-components
Server Side
- NodeJS
- Express FrameWork
Client Side
- React JS
- WebPack
-
Install Node JS.
-
Clone the repository here
-
[cd] into the root of the project directory.
-
Run
yarn install
on the terminal to install project dependecies -
Create a
.env
file in the root directory of the application. Example of the content of a .env file is shown in the .env.sample -
Start the application: Different Build Environments
Production
yarn build:client-prod
yarn build:server-prod
yarn start:server-prod
Development
yarn client:dev
yarn server:dev
Sever side tests - Run yarn test
on the terminal while within the project root directory.
Client side tests - Run yarn client:test
on the terminal while within the project root directory.
Server side testing is achieved through use of chai-http
, mocha
and chai
packages. chai-http
is used to make requests to the api and mocha
is the testing framework and chai
is the exception library. They will both be installed when you run npm install
and the tests will run when you run npm test
.
Client side testing is achieved through the use of jest
package. jest
is used to test javascript code in
React applications.
Api endpoints were created using express
router. The routes are defined under src/routes/index.js
.
Request type | Endpoint | Action |
---|---|---|
POST | /api/v1/phonenumbers?order | Generates a list of phone Numbers in a particular order |
GET | /api/v1/phonumbers | Gets the information about the phone numbers generated |
GET | /api/v1/download | Downloads the files that are generated |
For more details contact benny.ogidan@andela.com
For any suggestions or contributions or issues please do raise them or email me. For Contributiions, Please clone the repo and implement a PR I would appreciate it