Chat by sockets, if you want to try it go to ===> Jobsitychat
- Git (Installation), (SSH config)
- Docker (Installation) (Linux-postinstall), Docker-composer (Installation)
- AWS-CLI (Installation) (only if you want to deploy to AWS)
- Python3
- Node.js and NPM
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 .
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/
- 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
clean architecture
- 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
Remember you need AWS-CLI, it is not possible to test in localhost
npm install
Install Serverless Framework
npm install -g [email protected]
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
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
- Go to Cognito User Pools https://us-west-2.console.aws.amazon.com/cognito/users/?region=us-west-2#/?_k=qaioty and copy the DNS
- Go to app Client Setting make sure that Cognito User Pool is enabled, and copy the ID like XXXXXXXXXXXXXXXXX
- Build your DNS log in, replace COGNITO_DNS, COGNITO_CLIENT_ID and enjoy your app
- https://COGNITO_DNS.auth.us-west-2.amazoncognito.com/login?response_type=token&client_id=COGNITO_CLIENT_ID&redirect_uri=https://COGNITO_DNS.s3-us-west-2.amazonaws.com/index.html