Sbily

A Django project for a link shortener.

license mit Code style: Ruff

A Django project for a link shortener.

Technologies Used

How to Execute the Project

To run the project, you need to have Python and Node (to run Rspack) installed on your machine, or you can use Docker.

Without Docker

Once the repository is cloned and the global dependencies are installed, you can install the project's local dependencies.

1. Install Local Dependencies

Python dependencies:

pip install -r requirements/local.txt

Node dependencies:

pnpm install

2. Configure environment variables

Copy the .envs.example directory to the .envs directory (which will be ignored by Git):

cp -r .envs.example .envs

3. Make the migrations

python manage.py migrate

4. Create a super user

python manage.py createsuperuser

5. Running application in development mode

Django application:

python manage.py runserver

Rspack:

pnpm dev

The Python command will start the Django application at http://localhost:8000 and Node will start Rspack and a proxy server for automatic reloading at http://localhost:3000.

With Docker

Once the repository is cloned, the global dependencies are installed and variables defined, let's start the container:

docker compose -f docker-compose.local.yml up

When started, the container starts the Django application!

The steps below will only be necessary if you have not yet carried out the migrations and created a super user! If you have already done so, the application can be accessed at: http://localhost:3000

You will need to enter the container via CLI:

docker compose -f docker-compose.local.yml up exec django zsh

Now you are inside the container!

You will need to make the migrations:

python manage.py migrate

Creating a super user:

python manage.py createsuperuser

The Python command will start the Django application at http://localhost:8000 and Node will start Rspack and a proxy server for automatic loading at http://localhost:3000.

License

This project is under the MIT license.