Giter Club home page Giter Club logo

aglcodingtest's Introduction

AGL Coding Test

By Yaser Mehraban

This project consists of a set of API's which consume the AGL coding test API and return the full list and also the list of all the cats grouped by the gender of their owners. It also has a client side SPA application written in Angular 4 using the Angular CLI which consumes the API's and shows the list of cats in the home page.

The API project is written in ASP.Net Core 2.0.

Running in debug mode

Navigate to Web folder and run the below commands in a command prompt or PS command line:

dotnet restore
dotnet run

Now the web API project is running and listening on http://localhost:5000.

Open up another command prompt and run the Angular project:

npm install
npm start

It is time to open a browser and navigate to http://localhost:4200 to see the home page of the Angular SPA application.

Run in production mode

Open a command line and type these commands:

npm install
npm run publish <=or=> ng build --prod

dotnet restore
dotnet run

Now if you navigate to http://localhost:4200 you will see the home page with all the cats.

Running xUnit tests

In order to run the tests you can just simply type:

dotnet test

If you want to run the Jasmine tests, you can use:

npm test

The Angular tests will run in a headless Chrome. If you want to change that please open up the karma.config.js and change the browser to whichever you prefer.

Docker

To run the application in docker container run the commands blow:

npm install
npm run publish <=or=> ng build --prod

docker-compose  -f ".\docker-compose.yml" -f ".\docker-compose.override.yml" -f ".\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose2966794116290414041 up -d

This will create the docker image and run it. Now you need to know the address:

First let's get the container id:

docker ps --filter "status=running" --filter "name=dockercompose2966794116290414041_web_" --format "{{.ID}}" -n 1

Now run:

docker inspect --format="{{.NetworkSettings.Networks.nat.IPAddress}}" <ID from previous command>

This will give you the address where the app is running.

aglcodingtest's People

Contributors

yashints avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.