Synthra is a file hosting application built using FastAPI (with Python 3.11) and SvelteKit, with PostgreSQL, SQLAlchemy and Alembic.
This repository contains both the frontend and the backend of the project in their respective folders.
This is a project for the courses Implementation of free and open source systems
and Team project
.
See DOCUMENTATION.md.
Authors:
- Stefan Milev - 206055
- Alek Jarmov - 206012
- Ana Marija Atanasovska - 206004
- Danilo Najkov - 206033
- File hosting
- User registration and login
- Intuitive interface
- Support for webhooks
- Administrative panel
See also FEATURES.md.
For running the application in production mode, it's highly recommended to use Docker. Otherwise, the manual setup is also available for those who wish to test the application in a development environment.
For most users, just these few steps should be sufficient, provided that you are comfortable with using Docker for deploying applications.
- Grab the
docker-compose.prod.yaml
file from the repository - Rename it to
docker-compose.yaml
- Run
docker compose up -d
To setup your environment and the project for development:
- Run
poetry install
(while inside thebackend
folder) - Run
pre-commit install
The project contains two Docker Compose configurations. docker-compose.yaml
is for the development environment, and docker-compose.prod.yaml
is for the production environment.
While building the frontend, the environment variable VITE_BASE_URL
should be present, which is the URL to the API. You can also add this to the global .env
file.
- Run
git clone [email protected]:Delemangi/synthra.git
(orgit clone https://github.com/Delemangi/synthra.git
) - Run
docker compose build
- If you need the Docker image built for a machine running ARM architecture, then use the
PLATFORM
build argument as such:docker compose build --build-arg PLATFORM=linux/arm64
- If you need the Docker image built for a machine running ARM architecture, then use the
The manual setup requires that you have the following requirements installed:
- Python >= v3.11
- Poetry
- Node.js >= v20
- PostgreSQL >= v16
Once you have all these dependencies installed, then:
- Run
git clone [email protected]:Delemangi/synthra.git
(orgit clone https://github.com/Delemangi/synthra.git
) - Next, you have to install each module separately.
- Navigate to the
backend
folder:cd backend
- Run
poetry install
- Navigate to the
frontend
folder:cd frontend
- Run
npm i
- Run
npm run build
- Copy or rename the
.env.sample
file to.env
, and edit it to your liking, or leave it as is - Run
docker compose up
- Start the PostgreSQL service
- Apply all migrations:
alembic upgrade head
- Start the backend service
- Open the project in your terminal
- Run
cd backend
- Run
poetry run uvicorn app.main:app --host 0.0.0.0 --port 80 [--reload]
- the last parameter is optional, in case you want hot reloading
- Start the frontend service
- Open the project in your terminal
- Run
cd frontend
- If you would like to start the application in a development environment with hot reloading, then run
npm run dev
, otherwisenpm run preview
, provided that you have runnpm run build
previously
This project is licensed under the MIT license.