Giter Site home page Giter Site logo

coding_challenge's Introduction

Coding Challenge

This is an Erlang based chat server.

Here are the instructions to run this application.

Prerequisites

Erlang/OTP25 and rebar3 must be installed on your machine to build and run this application.

Third-Party Libraries

  • erlcloud: used to connect to DynamoDB and interact with it, using methods to add, update or remove data from tables.

AWS access

It is possible to log in to AWS using an IAM user to see the created EC2 instances, DynamoDB status and other thing created through CloudFormation templates. Here are the credentials for the AWS IAM user:

  • Console link
  • Username: coding_challenge
  • User ID: 713881814113

Run the server application

  • Open a terminal inside this project's base folder, then run the command:
$ rebar3 shell

Release and run project

  • Open a terminal inside this project's base folder, then run the command:
$ rebar3 release
  • Go inside the _build/default/rel/coding_challenge/bin folder
  • From a terminal, run the command:
$ coding_challenge foreground

Testing with client

  • Go into the apps/client folder
  • From a terminal, run the command:
$ rebar3 shell

For quick testing, you can run one of these commands:

  • Test clients
$ client_app:test_clients().

That will create 5 different clients and connect them to the server

  • Test rooms
$ client_app:test_rooms().

This will connect some clients and create different rooms, testing various cases of error and success.

  • Test private messages
$ client_app:test_private_messages().

This will connect some clients and send some private messages.

  • Test private rooms
$ client_app:test_private_rooms().

This will create one private and one public room, testing various cases.

There are various other useful methods to test the single functions, like creating a room, joining a room, sending a message, etc. To use one of those methods, check the source code inside the client_app.erl file, from there you can see the exported methods you can use for testing purposes.

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.