This is a project management dashboard API built with FastAPI. It allows users to create, update, share, and delete project information.
- Python 3.10.6
- Poetry for dependency management
- Make for the Makefile
- Docker (for building and running the application in a container)
- PostgreSQL 15
- Clone the repository:
git clone [email protected]:kojicmarko/FINAL-PYWEB.git
- Navigate to project directory:
cd FINAL-PYWEB
- Install dependencies:
make install
Before running the application, you need to set up the necessary environment variables.
These include:
SECRET_KEY
ALGORITHM
TOKEN_EXPIRE_TIME
DATABASE_URL
DB_HOST
DB_PORT
AWS_BUCKET_NAME
AWS_DEFAULT_REGION
You can set these up in a .env
file in the root of your project directory.
This application uses PostgreSQL 15. Make sure you have it installed and create a new database for this application.
After setting up the database, you need to run Alembic migrations to create the necessary tables:
make migrations
- Start the server directly:
make run
- Build the Docker image:
make build
- Start a Docker container with the server:
make up-docker
- To stop the Docker container and preserve volumes:
make down-docker
- To stop the Docker container and delete volumes:
make down-docker-v
- Lint and fix style and lint type-hinting:
make lint
- Run tests:
make test
The API provides the following endpoints:
POST /auth
: Creates a user.POST /login
: Logs in the user.
POST /projects
: Creates a new project. Making the user who created it the project ownerGET /projects
: Returns all projects where user is a participant.GET /project/<project_id>/info
: Returns project information, if the user is a participant.PUT /project/<project_id>/info
: Updates project information, if the user is a participant.DELETE /project/<project_id>
: Deletes project, if the user is project owner.POST /project/<project_id>/invite?user=<username>
: Adds user to a project as a participant. Only the project owner can invite.
GET /project/<project_id>/documents
: Returns all documents of a project.POST /project/<project_id>/documents
: Uploads a document for a specific project.GET /document/<document_id>
: Returns a document.PUT /document/<document_id>
: Updates a document.DELETE /document/<document_id>
: Deletes a document, if the user is project owner.
GET /project/<project_id>/logo
: Returns the logo of a project.PUT /project/<project_id>/logo
: Updates the logo of a project.DELETE /project/<project_id>/logo
: Deletes the logo, if the user is project owner.