The Backend service is being used to establish communication with database.
FASTAPI framework is a modern, fast, robust, easy scalable web framework for building APIs with Python 3.6+. The key features:
- Fast: One of the fastest Python open source framework link
- Easy Scalable and Maintainable
- Easy Learning: Designed to be easy to use and learn. Less time reading docs.
- Robust: Get production-ready code. With automatic interactive documentation. and many more..
Please follow official documentation for further information.
1.Ensure that you have a virtual environment setup for **python3.6+**, and it is activated.
If not, please setup a new virtual environment for python3.6+
2. Ensure that .env file exists in Backend root directory.
If not, please checkout configuration section.
3. Ensure that you are in root directory of ```Backend```
4. pip install -r requirements.txt
5. python main.py
Activate your python3.6+ virtual environment.
python main.py
- Normal Excecution
- visit
http://127.0.0.1:3333/docs
- Ensure that you have a virtual environment setup for python3.6+, and it is activated.
- Ensure that you are in root directory of
Backend
pytest test/[file name that ends with test.py]
Generating coverage report
coverage run -m pytest -v test && coverage report -m
This project has several APIs:
- The API Serves the communication with database and any device.
- The
GET
request has been used predominately in the API endpoints.
- Github Action is being used to automated Tests.
- Unit tests for APIs have been standardised for the GET request.
- Test File Structure
|..
├── test
|── [xyz] _ test.py
|..
- Adding new test file
- By convention and setup, the new test should go into
test
file
- By convention and setup, the new test should go into
MONGODB is being used as a database platform for NoSQL database.
Contact exisitng Developers/maintainers to get either admin access or developer access for MONGODB.
- Create
.env
file in the root directory - Add following variables with your access details
PASSWORD={.............}
NAME={.........}
DOCKER file configuration to run on server
# syntax=docker/dockerfile:1
FROM python:3.7
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
EXPOSE 3333
COPY . .
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "3333"]
Note: Configuration might not be updated. Therefore, please confirm with DOCKER file from the repository only.
The main branch continuous deploy on the heorku as staging environment.
staging environment
Please contact current developers for further configuration of heroku environment,
Currently, production server has been deployed on the Scantist local machine.
All bugs, feature requests, pull requests, feedback, etc., are welcome. Create an issue.
- API limiter
- Minimise additional dependencies
- Area of improvement regarding API's performance