Git Product home page Git Product logo

bitcamp-backend's Introduction

Bitcamp Backend

Django back of BitCamp platform.

Local Development

Follow these steps to set up your local development environment.

Prerequisites

  • Python 3.11 or higher
  • Pip (Python package manager)
  • Django 4.2 or higher
  • Django Rest Framework 3.14 or higher
  • A Discord bot token (Set an environment variable DISCORD_BOT_TOKEN)

Setup

  1. Clone the repository

    git clone https://github.com/bitcamp-ge/bitcamp-backend
  2. Build and start the server

    Navigate to the project directory and run:

    docker-compose up --build

    The application should now be running at http://0.0.0.0/. The Discord bot should be running alongside Django.

Documentation

API documentation is available at http://0.0.0.0/api/docs when the server is running.

bitcamp-backend's People

Contributors

nickkipshidze avatar otarza avatar konstantine25b avatar

Forkers

georgetoloraia

bitcamp-backend's Issues

Enrollment Flow

  1. User registers & logs in using phone verification;
  2. User initiates enrollment by sending POST request to enrollment creation endpoint. Request payload is only partially filled because at first user only chooses a program he is enrolling in to, so payload contains only program ID. New enrollment id is sent back as a response.
  3. User chooses a service and sends PUT request to the enrollment endpoint identified by previously received enrollment id. So enrollment now has service as well.
  4. If service price is greater than 0 we should initiate payment process by creating payment on Payze API and sending its details as a response after choosing service in step 3. We follow standard payment process we already have in place.
  5. After successful payment, user will be presented with the list of Mentors associated to the program he chose in step 1.
  6. User chooses a mentor by sending one more PUT request to the enrollment endpoint.
  7. As a last action we send notifications to interested parties:
    • User should get SMS congratulating completion of the registration, with details about program he chose and contact details of his mentor (name, phone number) and a Discord invite link.
    • Mentor should also get an SMS or a message from Discord bot indicating that new student has registered for him and get student contact info

/enroll Does not work for new users without profile data - getting 400 bad request from Payze

How to reproduce?

  1. Create new user by submitting a Phone number on via dashboard front-end;
  2. Make sure this is actually a new user (No profile data is in the database - email, first name and last name fields are empty);
  3. Try to choose a program;
  4. Try to choose a service;
  5. Try to Buy via "ყიდვა" button;
  6. You will get an error.

By debugging the back-end I found out that metadata extraAttributes email field is empty and without that field provided, Payze returns Bad request. See the screenshot:

Screenshot 2024-05-07 at 02 02 25

Proposed resolution

  1. Add phone number to metadata;
  2. Check if all metadata fields are available;
  3. Only send the fields that are available and do not send empty field values to Payze.

Include Discord bot code

Include Discord bot code alongside Django

  • Create new app for the bot
  • Bind Discord bot and Django
  • Create experimental database

Initial project setup

Setup DRF project

  • Start DRF project - "back"
  • Write development/production settings
  • Write .gitignore file
  • Write requirements.txt file
  • Configure swagger / drf-spectacular
  • Dockerize the project
  • Update README.md

Program - ის მოდელზე დასამატებელია Weight ველი

ამჟამად პრობლემაა რომ პროგრამების თანმიმდევრობა dashboard - ზე იმის მიხედვით ჩანს თუ ბოლოს რომელი პროგრამის ინფორმაცია განახლდა. უნდა შევცვალოთ და ამის მართვა უნდა შეგვეძლოს.

  • უნდა დავამატოთ weight - რიცხვითი ველი;
  • ეს რიცხვითი ველი უნდა გამოვიყენოთ პროგრამების სორტირებისთვის;
  • პროგრამები უნდა დასორტირდეს weight ველის მიხედვით, დაბალიდან მაღალი მნიშვნელობისკენ.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.