Skip to content

efrain17/jobsityChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jobsitychat

Chat by sockets, if you want to try it go to ===> Jobsitychat

Prerequisites

Installation

Install dynamodb by docker, the docker-compose file set a default database

docker-compose up

Install python dependencies

cd server
virtualenv --python=python3 venv
source venv/bin/activate
pip install -e .

Run Test

Remember to be inside ./server

pytest jobsitychat/test/

Coverage, Current testing coverage 100%

py.test --cov=jobsitychat/controllers/ --cov=jobsitychat/libraries/ --cov=jobsitychat/models/ --cov=jobsitychat/routes/ jobsitychat/test/

Linter, Current linter coverage 100%

pylint jobsitychat/

Technical information

  • The code is developed under the functional programming paradigm
  • Serverless architecture was chosen for the optimization of resources, costs and ensuring high availability.
  • You can see all the architecture configuration in the file server/serverless.yml
  • Dynamodb was chosen for the high performance to store the data types of a chat
  • For the authentication control, cognito was used, due to the high security standards
Cloud computing arquitecture with serverless
Alt text
Authorizer architecture
Alt text
Code architecture

clean architecture

Alt text

Features

  • All mandatory features are developed
  • You can register, log in and recover password
  • The bot is fault tolerant in the event that the stock api fails, it will try 3 times, it is decoupled and each call to the bot is a unique and asynchronous instruction, it also validates if the code is incorrect
  • Bonus Features are developed

Deploy

Remember you need AWS-CLI, it is not possible to test in localhost

Install required npm packages
npm install

Install Serverless Framework

npm install -g serverless@1.74.1

Install required Python packages

pip install -r requirements.txt -t ./lib/python

Install required serverless plugins

sls plugin install -n serverless-pseudo-parameters

Deploy to AWS

serverless deploy --stage dev

Additional configuration

we do not buy a domain so we need to do few configurations

  • Copy your Websocket endpoint from your console like this wss://hqzzsehbij.execute-api.us-west-2.amazonaws.com/dev and replace in the dns section web socket of the frontend
Alt text
Alt text
  • Go to app Client Setting make sure that Cognito User Pool is enabled, and copy the ID like XXXXXXXXXXXXXXXXX
Alt text

Releases

No releases published

Packages

No packages published