PlantSwap is an application which enables you to trade your plant offsets for other plants of your liking.
You can either find a person which wants to trade their plant for your plant directly or sell your plants on the platform to receive coins which you can then use the buy plants from other people.
This repository documents the progress in the cloud computing course I took part in at the Universidad de Granada for my masters.
The above logo was generated using Dall-E.
This project is used the fullstack fastapi template as its starting point.
The project needs a Postgresql database to be running to be able to use all functionalities. Using a .env file one can pass the application the necessary details of the database. The specific parameters to be set are found in config.py.
The .env file in the project directory contains some default values for the database connection. Using these one can also use the dockerfile contained in the project directory to start a postgresql container. This can be done using the poethepoet script db
by typing:
Attention: The following command deletes and removes all running docker containers and starts a new postgresql container
poe db
To start up the application, one will have to install the dependencies first. uv is recommended to be installed. An installation guide can be found here. If pipx is already installed on the machine, it is as easy as
pipx install uv
After having installed uv, to create a venv and install the necessary dependencies, run:
uv python install
uv sync --all-extras --dev
The above will install all dependencies and the project could be started using
uv run fastapi dev
However, the project uses poethepoet as a task runner. To install poethepoet, run with pipx installed
pipx install poethepoet
Now the application can be started in development mode running
poe dev
and in production mode using
poe deploy
By default, the api will be served at http://0.0.0.0:8000
.
The following list keeps track of the development progress of the app and its backend/API.
- โก FastAPI for the Python backend API.
- ๐งฐ SQLModel for the Python SQL database interactions (ORM).
- ๐ Pydantic, used by FastAPI, for the data validation and settings management.
- ๐พ PostgreSQL as the SQL database.
- ๐ฆ Uvicorn used by FastAPI as ASGI webserver.
- ๐ Secure password hashing by default.
- ๐ JWT (JSON Web Token) authentication.
- ๐งช Tests with Pytest.
- ๐ช Poethepoet as task runner.
- ๐ฆ Package management with uv.
- โ๏ธ CI (continuous integration) and CD (continuous deployment) based on GitHub Actions.
Basic functionality includes things such as:
- Administrators have a (secure) way of logging in
- Users have a (secure) way of logging in
- Users can create accounts
- Administrators can create accounts
- Administrators can delete ads of users
- Administrators can delete accounts of users
Advanced functionality includes things such as:
- Users can send other users trade requests for their plants
- Users can accept trade requests
- Users can deny trade requests
- Users can answer trade requests with a text message
- Basic frontend
The following are references to the tasks of the respective milestones as discussed in the Repository of the cloud computing class.
- ๐ง Configuration of Git and GitHub
- ๐ Description of the problem and the application to solve it
- โ๏ธ MIT License used for the project
- ๐คนโโ๏ธ Task runner
- ๐งช Testing framework and assertion library
- โ๏ธ Writing tests
- ๐ค Continuous integration
- ๐ Visualization of continuous integration
- ๐ API framework used
- ๐๏ธ Design of API
- ๐ Logging setup
- ๐งช Testing update
- ...