i701 63b1a6b9ef
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Has been cancelled
fix(tasks): include paid filter in expired topups query to prevent notifications for paid topups 🐛
2025-07-05 18:05:39 +05:00
2025-04-16 11:33:48 +05:00
2025-04-12 06:45:07 +05:00
2025-01-20 14:33:03 +05:00
2025-02-13 22:50:17 +05:00
2025-01-20 14:33:03 +05:00
2025-01-20 14:33:03 +05:00
2025-01-20 14:33:03 +05:00

sarlink-portal-api

API for SARLink portal in Django Rest Framework.

Deployment steps

  1. clone the repo git clone git@github.com:i701/sarlink-portal-api.git
  2. Create virtual enviroment virtualenv venv and activate it source venv/bin/activate
  3. Install requirements pip install -r requirements.txt
  4. Copy .env.example to .env and fill in the configs cp .env.example .env
  5. generate static python manage.py collectstatic
  6. Run Migrations python manage.py migrate

deployement with Docker

  1. Create compose.yml
services:
  portal-api:
    hostname: portal-api
    image: git.shihaam.dev/sarlink/sarlink-portal-api/api
    env_file: .env.api
  nginx:
    hostname: portal-api-nginx
    image: git.shihaam.dev/sarlink/sarlink-portal-api/nginx
    volumes_from:
      - portal-api
    ports:
      - 4000:80
    depends_on:
      - portal-api
  portal-db:
    image: postgres:14
    restart: always
    hostname: portal-db
    volumes:
      - ./database:/var/lib/postgresql/data
    env_file: .env.db
  1. Start services: docker compose up -d
  2. Run Migrations: docker compose exec portal-api python manage.py migrate
  3. Test api with curl:
curl -X POST http://localhost:4000/api/auth/login/ \
-H "Content-Type: application/json" \
-d '{"username":"admin", "password":"soemthign"}'

expected response: {"message":"Unable to log in with provided credentials."}

  1. For procrastinate (postgres background tasks) to work run the worker
python manage.py procrastinate worker
Description
API for SARLink portal in Django Rest Framework.
Readme GPL-3.0 874 KiB
Languages
Python 96.1%
HTML 2.6%
Dockerfile 0.9%
Shell 0.2%
Just 0.2%