Giter Club home page Giter Club logo

festival-api's Introduction

API for Improtřesk festival website

CircleCI Code Climate Test Coverage Issue Count

This API service written in Django manages database for Czech theatre improvisation festival called Improtřesk.

Requirements

  • Django 1.10
  • Python 3.5

Frontend

Frontend for this app is written in React / Redux. You can see it in separate repository: improtresk-web.

festival-api's People

Contributors

just-paja avatar petrdlouhy avatar

Watchers

 avatar  avatar  avatar

Forkers

petrdlouhy

festival-api's Issues

Think of different name for Order model

Order is quite confusing, because it can mean sequence as well as order of workshop. It is also translated by Django as "pořadí". We need some more unambiguous name.

Doplnit verbose_name k parametrům tříd v modelu

Je dobrým zvykem jednotlivé parametry v modelu pojmenovat trochu uživatelsky přívětivě pomocí parametru verbose_name, případně i dovysvětlit pomocí help_text. Například:

    bank_code = models.CharField(
        verbose_name=_("Code of bank"),
        help_text=_("Code of bank from which money was received"),
        max_length=30,
        blank=True,
    )

Translate order in locale objednávka

Field order is shown in admin as Pořadí, while it should be translated as Objednávka. Add at least translation of this field to the locale messages.

Secret key in repository

It is insecure to keep secret key in git repository despite it is just a development key. We need to find a way to hide this piece of configuration from repository and read production configuration.

Workshop prices in models

As user I need to be able to figure out how much I'm going to pay for signup on workshop. As organizer of festival, I need to be able to define different price for each workshop, Year and period of time.

  • Workshop model will have many (usually two) WorkshopPrices.
  • WorkshopPrice model will belong to Workshop and PriceLevel
  • PriceLevel model will belong to a Year

PriceLevel will carry a date of start - e.g. User will pay this much from this period of time.

Consider using auth.User as one-to-one for Signup

In Django is built-in model auth.User which has properties first_name, last_name, email, password and others. We could use it as one-to-one to Signup and omit duplicate fields there.
The main benefit of using this is, that we could use standart Django authentification backends.

Endpoint for list of all participants

As organizer, I need to print a list of all participants for current year that are paid and assigned to a workshop. I need endpoint that returns this information.

Stats endpoint

As organizer, I need to see how many people have shown active interest in the festival by watching database stats. I need to see:

  • How many participants there are?
  • How many orders are there in total?
  • How many orders are not paid yet?
  • How many orders are paid already?
  • How many paid orders are there without being assigned to workshop?
  • How many orders have assigned reservation?
  • How many payments were received?
  • How many payments are expected?
  • How many participants ordered lunch?
  • How many participants chose what accomodation?
  • How much money was received in expected payments?
  • How much money is yet to be paid on expected payments?

Create accomodation endpoint

As a participant I want to be able to see a list of offered accomodation for current year including the price, capacity, remaining places, photos and address.

Create workshop endpoint

As a participant I need to be able to see a list of workshops for current year to pick one before singning up. I need to be able to reference a lector with the lector endpoint and see list of photos assigned to the workshop.

Workshop Lectors and Lector Roles

As a participant I need to see all Lectors of the workshop including musicians. Create following models and relations:

  • LectorRole contains all different roles lector can have on workshop. Needs a slug.
  • WorkshopLector belongs to Workshop, Lector role and Lector

Some fields should not be required

Fields are required (blank=False, null=False) by default in Django. Some fields like Signup.birthday or Order.food should probably not be required.

Workshop location model

As participant, I need to see place where the workshop will be. As admin, I need to generate number of meals I need to deliver from HQ place.

Location

  • name, string
  • desc, text
  • address, text

LocationPhoto

  • caption, string, not required
  • image, image field
  • belongs to Location

Storing strategy

As an admin I need to store photos on a different machine than the on running the application because it can be nuked at any time. Preferable choice is AWS S3. It needs to be configurable by environment variables so it does not slow down development. Default store should point to local machine.

Create food order endpoint

As organizer, I need to see how many foods I need to preorder for lunch. Please create endpoint that will return per-FoodTime list of meals and their orders.

[
  {
    "name": "Obědy",
    "date": "2016-05-01",
    "order": [
      {
        "name": "Česnečka",
        "count": 88
      },
      {
        "name": "Pečené kuře s bramborovou kaší",
        "count": 92
      }
    ]
  }
]

Text model

As user I need to see some static informational texts with occasional photos such as rules on cancelling signups, howtos, page lead descriptions. This model might be later extended or reused for tips, terms and conditions.

Text

  • name, string
  • slug, string, unique
  • text, text (markdown)

TextPhoto

  • caption, string
  • image, image field

Create endpoint for years

As a participant I need to be able to list previous years of Improtřesk to browse it for reference. I should also be able to see if the year is current. It should be admin choice if the year is displayed on the frontend website.

Terms and conditions model

As a participant I need to see all the rules, terms and conditions there are in current festival year. I also need to see current and previous versions to compare what has changed.

Conditions model belongs to year, has name and text (in markdown).

Add Travelling tips model

As user I want to see some interesting facts that are along the way to the city of festival. Create model TravelTips and TravelTipPhoto to store them.

  • TravelTip has a name, text formatted in markdown and many TravelTipPhotos.
  • Photo has image, caption and belongs to TravelTip

Create lector endpoint

As a participant I need to be able to browse a list of lectors to know what workshop is lead by which lector. I also need to see photos of lector to be able to recognize him later.

Workshop difficulty

As administrator, I need to categorize workshops by difficulty. Create following models and relations:

  • WorkshopDifficulty - carries name (and description?)
  • Workshop belongs to WorkshopDifficulty

Create artifact for continuous delivery

As server admin I need to receive a single file containing both code ready to run and all static files and dependencies to deploy the application on staging and production server as fast as possible.

Create Year model

Create a model that will hold information about festival years: Topic, Year (SlugField), Start Date, End Date, Start Date of signups and (Bool) Is it current year(?).

Change Signup model to Participant

Extend the django.contrib.auth.user model to Participant that will hold information about participants for current Year and provide means to authenticat. Participants and users must be in separate tables.

Clone the production database

As tester, I need to be able to test application with real data on staging environment.

Question is, should it clone participants data as well? Tester should be allowed to test the e-mailing capability as well without affecting real life users.

Workshop participants endpoint

As organizer, admin or lector I need to see what people are going to which workshop. Create participants endpoint to workshop that lists names of participants on a workshop.

Consider separating in few apps

More Djangonautic approach is to separate project into more simple reusable apps. I would consider following apps: workshops, accomodation/food, signups, (transportation)

Payments model

As administrator I need to see log from payment gateway. Save all status changes into CardPaymentLog model.

Endpoint for list of teams

As future participant, I want to see list of all teams that are going to the festival with number of people who signed up and are paid. For example: "Poločas nápadu, 15 people signed up, 10 people assigned".

Clarify Order-workshop relationship

We need to decide whether we need to leave users with first, second and third workshop choice or we are able to secure that the workshop the user chooses first is reserved for him.

In first case, there should be through model (https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.ManyToManyField.through) for workshops parameter of Signup holding the order.

In second case, there would simply be workshop foreign key for Signup, but we need to ensure, that the signup is limited in time.

Workshop reservation models

As a participant, I need to be able to reserve spot on workshop for current year to be given some time to pay it. Create following models and relations:

  • Order
    • price, number
    • paid, bool
    • canceled, bool
  • Payment
    • type, enum (card payment, account transfer, cash)
    • belongs to Order
  • Reservation
    • endsAt, a date when the reservation becomes invalid
    • belongs to Participant, WorkshopPrice, ReservationFoodTime, Order
  • ReservationFoodTime
    • belongs to Reservation and FoodTime
    • has many (n:m) Food
  • FoodTime
    • has many Foods and ReservationFoodTimes
  • Food
    • name, string
    • course, enum(soup, main)
    • belongs to FoodTime

Food models

As organizer, I don't know when will the complete list of meals for lunch be available. As accountant or participant I need to know how much do I need to pay for signup. We've discussed it and we need to create following models and relations:

  • FoodTime carries date, name and price as for "5th May, Lunch, 90 CZK" (Price is for lunch)
  • Food as for specific menu item on time. Belongs to FoodTime

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.