GithubHelp home page GithubHelp logo

misterflicker / hammer_test Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 100 KB

Simulation of authorization and referral program system.

Home Page: https://hammer-test-ten.vercel.app

Makefile 4.56% Python 81.84% HTML 13.59%
django postgresql python html poetry

hammer_test's Introduction

hammer_test - is Imitation of the referral system.

Authorization by phone number.

Assigning each phone number its own invite code.

The ability to see a list of users who entered your invite code.

Ability to enter someone else's invite code yourself.

How to install

Dependencies:

  • Python >= 3.8
  • Django >= 4.2.3
  • psycopg2-binary >= 2.9.6
  • gunicorn >= 21.2.0
  • dj-database-url (for working remote database) >= 2.0.0

Installing

Type in terminal:

  1. make install
  2. make build

Also need to create postgresql database in environment named DATABASE_URL.

How to use

Type in terminal:

  • For starting with gunicorn: make start
  • For starting with manage.py: make run

API description (deployed on render.com)

  • GET hammer-test.onrender.com/ - get page with start authorization button.

  • GET hammer-test.onrender.com/authorization - get page with form to enter a phone number and submit button.

Options:

  1. django form of phone.

  • GET hammer-test.onrender.com/authorization/ - after 2 sec delayed (imitation of creation 4-symbol code) get page with phone form and authorization code form (can type any 4 symbols). This request checking phone in database and loading GET form if phone already in database or POST form for new phone.

Options:

  1. django form of phone;
  2. number of phone and status of phone in database (exists or not).

  • POST hammer-test.onrender.com/user/phone - after authorization of an new user get new user profile page with user's invite code, invite code form, and empty list of other user's phones (who activated our invite-code).

Options:

  1. django form of invite code;
  2. number of phone;
  3. empty value of entered invite code;
  4. own invite code;
  5. empty list of other phones.

  • POST hammer-test.onrender.com/user/phone - after entering invite-code get user profile page similar to the previous, but list of phones can be not empty. 3 variants of this page:
  1. If entered invite-code is correct. Form will never be displayed on page for this user. Instead the entered invite code will be displayed.
  2. If entered invite-code is own user's code. A message will be displayed next to the form about the impossibility to enter your own invite code.
  3. If entered invite-code does not exist. A message will be displayed next to the form about not existed code.

Options:

  1. django form of invite code;
  2. number of phone;
  3. empty value of entered invite code (if code does not exist or it's own code). Entered code value if code is correct.
  4. own invite code;
  5. list of other phones, who entered your own invite code.

  • GET hammer-test.onrender.com/user/phone - after authorization of an existing user get page with user's invite code, entered invite-code (or empty form for entering code - if user didn't enter code before), list of other phones.

Options:

  1. django form of invite code;
  2. number of phone;
  3. empty value of entered invite code (if code wasn't entered). Entered code value if code was entered.
  4. own invite code;
  5. list of other phones, who entered your own invite code.

hammer_test's People

Contributors

misterflicker avatar

Watchers

 avatar

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.