A serverless REST API implemented with Clean Architecture and Domain Driven Design.
This project follows the clean architecture style and has structured the codebase accordingly.
Image credit to Thang Chung under MIT terms
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.
-
Pre-requisites:
- Ensure Python 3.10 is installed
-
Install pipenv:
pip install pipenv==2023.4.29 --user
-
Install Python Dependencies:
pipenv install
-
Activate Virtual Environment:
pipenv shell
-
Add Environment Variables:
- Add the
.env
file provided to you in thebackend
directory
- Add the
-
Activate Virtual Environment:
pipenv shell
-
Start Local Server:
uvicorn main:app --reload --log-level debug --env-file .env
-
Download and Install AWS CLI:
-
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.
-
Pre-requisites:
- Ensure
Node 14
or later is installed
- Ensure
-
Install serverless framework:
npm install -g serverless
-
Install serverless plugins:
npm install
-
Install Python Requirements Plugin:
sls plugin install -n serverless-python-requirements
- Setup Docker (Only for Non-Linux Users)
- Docker Installation Guide
- Make sure Docker is Running on your Machine
-
pipenv shell
-
serverless deploy --stage 'dev' --aws-profile {profile} --verbose