Skip to content

About

Django REST API for Crowds of Catan; a crowdfunding platform for the Catan board game community

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

Repository files navigation

crowdfunding_back_end

Nicole Chan

Planning

Concept / Name

Crowds of Catan is a crowdfunding platform the Catanians (Catan Community) can pitch their Catan-inspired game campaigns and receive community backing. Players become investors; pledging support for creative expansions, custom maps and/or innovative rule variations. Want an extra robber run amok on resources? This project plans to bring those out of the box ambitions of the Catanians to life.

Intended Audience / User Stories

  • Catan players
    • Authenticated users.
    • They have the ability to create, update and delete their fundraisers.
    • Their main goal is to create fundraisers to support their in-game ambitions and view their resource goals.
  • Catan game developers
    • Authenticated users.
    • They have the ability to create, update and delete their fundraisers.
    • Their main goal is to create fundraisers to support their creative expansions, custom maps or rule variations and view their resource goals.
  • Catan supporters
    • Authenticated users.
    • They have the ability to create pledges.
    • Their main goal is to support fundraisers by pledging their resources.
  • Catan visitors are
    • Unauthenticated users.
    • They have the ability to view fundraisers and pledges.
    • Their main goal is to view the fundraisers as a whole and in detail.

Installation

Install Python

For Windows, download the latest version from https://www.python.org/downloads/windows/
For Mac, download the latest version from https://www.python.org/downloads/macos/

To check the current Python version

# Windows Command
python --version

# Mac command
python3 --version

Create virtual environment

Create virtual environment

# Windows command
python -m venv venv

# Mac command
python3 -m venv venv

Create new project

# Windows command
python m venv project-name
# Mac command
python3 -m venv venv

Activate virtual environment

Ensure you're in the folder that contains your requirements.txt file.

In the project folder, use the following commands.

# Windows command
. venv/bin/activate

# Mac command
source venv/bin/activate

Install Django in virtual environment

# Windows command
python -m pip install Django

# Mac command
python3 -m pip install django

Run local server

# Windows command
python crowdfunding/manage.py runserver

# Mac command
python3 crowdfunding/manage.py runserver

Deactivate virtual environment

# Applies for both Windows and Mac
deactivate

API Spec

URL HTTP Method Purpose Request Body Response Success Response Code Authentication/Authorisation
/users POST Create an account username, first name, last name, email, password id, last_login, is_superuser, username, first_name, last_name, email 201 Created none
/api-token-auth/ POST Authenticate User username, password token, user_id, email 200 OK none
/users/ GET View all users id, last_login, is_superuser, username, first_name, last_name, email 200 OK none
/users/{id} GET View an user id, last_login, is_superuser, username, first_name, last_name, email 200 OK none
/fundraisers GET View all fundraisers id, owner, title, description, goal, image, is_open, date_created 200 OK none
/fundraisers/{id} GET View a fundraiser id, owner, pledges, title, description, goal, image, is_open, date_created 200 OK none
/fundraisers POST Create a fundraiser title, description, goal, image, is_open id, owner, title, description, goal, image, is_open, date_created 201 Created authenticated user
/fundraisers/{id} PUT Update a fundraiser title, description, goal, image, is_open id, owner, pledges, title, description, goal, image, is_open, date_created 204 No Content authenticated user
/fundraisers/{id} DELETE Delete a fundraiser 204 No Content authenticated user
/pledges/ GET View all pledges id, supporter, amount, comment, anonymous, fundraiser 200 OK none
/pledges/{id} GET View a pledge id, supporter, amount, comment, anonymous, fundraiser 200 OK none
/fundraisers/{id}/pledge POST Create a pledge amount, comment, anonymous, fundraiser id, supporter, amount, comment, anonymous, fundraiser 201 Created authenticated user

Database Schema

Database Schemas

API screenshots

Get Request Get Request

Post Request Post Request

Token Return Token Return

About

Django REST API for Crowds of Catan; a crowdfunding platform for the Catan board game community

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages