Backend service REST API for shopping and ordering application based on Django and Firebase.
django_firebase
: main service of applicationapi_auth
: app for authenticationpayment
: app for payment service
- Install pipenv
pip3 install pipenv
- Clone the repository.
cd
intodjango_firebase
directory and runpipenv install -r requirements.txt
to install necessary dependencies.- Create a virtualenv in the root of project with
pipenv shell
and activate the virtualenv. - Create a
.env
file in the same directory assettings
to store environment variables.
Make sure you are in the same directory as manage.py
, then run the following to develop:
- Run
python manage.py makemigrations
to stage migrations - Then run
python manage.py migrate
to write the migrations to the database schema. - To boot the development server and use the API, run
python manage.py runserver
.
You can use postman to test the api during development using the API test collection created by Andy Dong:
- Create new user:
/api/auth/register
. Verbs:POST
- Login:
/api/auth/login
. Verbs:POST
- Email Verify:
/api/auth/email_verify
. Verbs:POST
- Reset Password:
/api/auth/reset_password
. Verbs:POST
- Update Auth:
/api/auth/update
. Verbs:POST
- Add Info:
/api/auth/add_info
. Verbs:POST
- Create a customer:
/api/stripe/customer/add
. Verbs:POST
- Get customer info:
/api/stripe/customer
. Verbs:GET
- Update customer info:
/api/stripe/customer
. Verbs:POST
- Delete customer:
/api/stripe/customer
. Verbs:DELETE
- Add a card:
/api/stripe/card/add
. Verbs:POST
- Get a card info:
/api/stripe/card
. Verbs:GET
- Update card info:
/api/stripe/card
. Verbs:POST
- Delete a card:
/api/stripe/card
. Verbs:DELETE
- Get all cards of one customer:
/api/stripe/card/list
. Verbs:GET
- Set default card of one customer:
/api/stripe/default
. Verbs:POST
- Create a charge:
/api/stripe/charge/add
. Verbs:POST
- Get a charge info:
/api/stripe/charge
. Verbs:GET
- Recent transactions:
/api/stripe/transaction
. Verbs:GET
- Add a refund:
/api/stripe/refund/add
. Verbs:POST
- Get a refund info:
/api/stripe/refund
. Verbs:GET