Skip to content

vsgobbi/pyAdvertiser

Repository files navigation

ATNAP (Aqui tem Nova Alta Paulista) project. A python Web Advertiser: Flask RESTful API with PynamoDB and AWS Lambda

Description

Project created by ATNAP team as designed for Hackatrouble. (https://www.hackatrouble.com.br/) Web project development of an API using Flask, designed with Blueprints pattern, database created with NoSQL DynamoDB as PynamoDB (https://github.com/pynamodb/PynamoDB). Using AWS KMS service to encrypt hashed passwords and secure login system. In order to deploy at Amazon Web Services for Lambda with Python 3.7 environment we use Serverless framework. Using Serverless framework to deploy on localhost and deploying it to AWS Lambda as well. Used NodeJS Axios to access created API routes with front end client requests.
Our website: https://master.d1jjesgxkfrs63.amplifyapp.com/
API Documentation: https://documenter.getpostman.com/view/6679239/Szf6WTn4?version=latest
Our purpose (project video in pt-br): https://youtu.be/8zPwqxar7Q4
This project is GPL v3.0 licensed.

Table of Contents

Install

Crate virtualenvironment 'venv' using Python3.7

$ virtualenv -p python3.7 venv
$ source venv/bin/activate

Install requirements

$ pip install -r requirements.txt

In order to deploy web applications on localhost or on AWS Lambda and AWS API Gateway use Serverless framework:

$ npm install -g serverless

Check serverless.yml file (choose AWS region to 'us-east-1', runtime to 'python3.7', service name pyAdvertiser):

$ nano serverless.yml

Install serverless plugins:

$ sls plugin install -n serverless-wsgi
$ sls plugin install -n serverless-python-requirements

Use the 'default' created config in ~/.aws/config

Create default bucket

check serverless.yml and deploy:

$ sls wsgi serve

Running app in aws lambda:

$ sls deploy

Checking logs from application:

$ sls logs -f app

Current endpoints:

Endpoints and API V1 Documentation: ATNAP API v1

User registration:

$ /api/v1/register

User login/authentication:

$ /api/v1/login

Advertiser, company informations and registration:

$ /api/v1/advertiser

Advertisement, company detailed advertisements:

$ /api/v1/advertisement

Current Front-end:

Website Hosted by AWS Amplify: PORTAL ATNAP

Current Front-end git repo: Front-end with ReactJs

Running Application

check serverless.yml and deploy on localhost:

$ sls wsgi serve

Running app in aws lambda:

$ sls deploy

Run VUEjs application locally to test client frontend

$ npm run serve

Contributing

  • Step 1

    • 🍴 Fork this repo!
  • Step 2

    • 🔨🔨 Clone this repo to your local machine using:
git clone https://github.com/vsgobbi/pyAdvertiser

License

License: GPL v3

About

ATNAP Project: Python RESTful API project using Flask with PynamoDB and AWS Lambda.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages