This README file contains instructions on how to set up and run our project's backend server on a local device. We utilize two different servers for different purposes: a SAM (Serverless Application Model) server to simulate AWS Lambda calls, and a naive Django server for testing and documentation purposes. Each server has its own setup and configuration requirements, which are outlined below.
This Django project is a comprehensive scheduling and management application for appointments, transactions, and capacity planning. It features various APIs and modules that help manage the app's functionality, including analytics, authorization, search, and more.
If you are getting this error
django.db.utils.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher
You have to switch to dev environment.
Else if you are getting this error
django.db.utils.OperationalError: could not translate host name "host.docker.internal" to address: nodename nor servname provided, or not known
You have to switch to test environment.
If you are getting another error, please create an issue and notify project manager.
The SAM server is used for development purposes, allowing developers to test and debug their code locally by simulating AWS Lambda calls.
- AWS CLI
- AWS SAM CLI
- Configure your
.env.dev
file with your desired development environment settings. - Rename the
.env.dev
file to.env
so that the SAM server can use it.
To run the SAM server, simply execute the following command in your terminal:
bash run.sh
This will start the SAM server locally, allowing you to test and debug your Lambda functions.
The naive Django server is used for testing and documentation purposes, enabling you to run tests and view the Swagger/ReDoc API documentation.
- Python 3
- Django
- pip
- Copy the
.env.test
file to a new file named.env
. - Configure the naive Django server by editing the
.env
file with your desired test environment settings.
To run the naive Django server, execute the following command in your terminal:
python manage.py runserver
This will start the Django server locally, allowing you to run tests and view the Swagger/ReDoc API documentation.
As mentioned earlier, our backend utilizes two different servers for different purposes:
- SAM Server: Used for development purposes, allowing developers to simulate AWS Lambda calls and debug their code locally.
- Naive Django Server: Used for testing and documentation purposes, enabling you to run tests and view the Swagger/ReDoc API documentation.
Please ensure that you follow the appropriate setup and configuration instructions for each server depending on your intended use.