sayakongit / sangnet

Sangnet swiftly connects compatible blood donors with recipients, prioritizing privacy and security. We simplify the process, enabling donors to help during emergencies and medical procedures, ultimately saving lives in our communities.
MIT License
11 stars 21 forks source link
django djangorestframework jwt material-ui react swoc-24

sangnet

[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)

πŸš€ Sangnet | Connecting blood, saving life

This repository contains a project that combines Django, Django REST Framework, React, and Vite to create a web application with a robust backend and a dynamic frontend.

Project Structure

The project is organized into two main folders:

Backend (Django) πŸ“¦

The backend is built using Django and Django REST Framework, providing a RESTful API to communicate with the frontend. The key features of the backend include:

Setting Up the Backend πŸ› οΈ

  1. Navigate to the backend folder:

    cd backend
  2. Setup the environment variables:

    Rename the .env.example to .env and update all the env variables.

    • EMAIL_HOST_USER is your gmail.
    • EMAIL_HOST_PASSWORD will be the App Password in your gmail. Refer this doc to create your app password.
    • DATABASE_URL is typically a external Postgres db URL hosted on cloud. You can create a free one on Render.
    • PS: If you don't want to setup a cloud db, you can still use a local db for development purpose. For that uncomment line 88-93 in core/settings.py and comment out line 95-97
  3. Create a Python Virtual Environment (Optional, but recommended):

    Create and activate a virtual environment to isolate project dependencies.

    On macOS and Linux:

    python3 -m venv venv
    source venv/bin/activate

    On Windows:

    pip install virtualenv
    virtualenv venv
    ./venv/Scripts/Activate.ps1
  4. Install the required Python packages:

    pip install -r requirements.txt
  5. Run database migrations:

    python manage.py makemigrations
    python manage.py migrate
  6. Start the Django development server:

    python manage.py runserver
  7. Use http://localhost:8000 as the API base URL.

Frontend (React with Vite) βš›οΈ

The frontend is built using React and Vite, providing fast development and hot module replacement for efficient code changes. The frontend offers a user-friendly interface to interact with the API provided by the Django backend.

Setting Up the Frontend πŸ› οΈ

  1. Navigate to the frontend folder:
    cd frontend
  2. Install the required Node packages:
    npm install
  3. Start the Vite development server:
    npm run dev
  4. Navigate to http://localhost:5173 to view the frontend.

Postman API Public Workspace πŸ“š

For detailed information about the available API endpoints and their usage, refer to the Post API Documentation.

Contributors

Sayak Saha
Sayak Saha

πŸ’»
Riddhick Dalal
Riddhick Dalal

πŸ’»
Shiwangi Kumari
Shiwangi Kumari

πŸš‡
Stefan Anevski
Stefan Anevski

πŸ“–
Harith
Harith

πŸ’»

Credits πŸ‘