Skip to content

SPARCS-UP-Mindanao/SPARCS-Payment-Service

Repository files navigation

Serverless API Starter

A serverless REST API implemented with Clean Architecture and Domain Driven Design.

Architecture

This project follows the clean architecture style and has structured the codebase accordingly.

cleanArchitecture image

Image credit to Thang Chung under MIT terms

Most Important Rule:

Source code dependencies can only point inward. Nothing in an inner circle can know anything about something in an outer circle. In particular, the name of something declared in an outer circle must not be mentioned by the code in an inner circle. That includes functions and classes, variables, or any other named software entity.

Setup Local Environment

  1. Pre-requisites:

    • Ensure Python 3.10 is installed
  2. Install pipenv:

    pip install pipenv==2023.4.29 --user
  3. Install Python Dependencies:

    pipenv install
  4. Activate Virtual Environment:

    pipenv shell
  5. Add Environment Variables:

    • Add the .env file provided to you in the backend directory

Run Locally

  1. Activate Virtual Environment:

    pipenv shell
  2. Start Local Server:

    uvicorn main:app --reload --log-level debug --env-file .env

Setup AWS CLI

  1. Download and Install AWS CLI:

  2. Create AWS Profile:

    aws configure --profile {profile}
    • Input your AWS Access Key ID and AWS Secret Access Key provided to you.
    • Input ap-southeast-1 for the default region name.
    • Leave blank for the default output format.

Setup Serverless Framework

  1. Pre-requisites:

    • Ensure Node 14 or later is installed
  2. Install serverless framework:

    npm install -g serverless
  3. Install serverless plugins:

    npm install
  4. Install Python Requirements Plugin:

    sls plugin install -n serverless-python-requirements

Deploy to AWS

  1. Setup Docker (Only for Non-Linux Users)
  2. pipenv shell
  3. serverless deploy --stage 'dev' --aws-profile {profile} --verbose

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published