bendog / she-codes-crowdfunding-api-project-kalicialopez

she-codes-crowdfunding-api-project-kalicialopez created by GitHub Classroom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

{{ EducAid }}

{{ EducAid is a non-for-profit online crowdfunding platform that aims to make highly rated, online educational courses/learning more accessible to those who are trying to better themselves, yet are limited by their financial situation. If it's a career change you're seeking Regardless of an individuals' highest level of education, current occupation/industry, EducAid can assist.

Potential donors: Private enterprise, philanthropists and the general public, and even the participating institutions themselves could donate to get the ball rolling. }}

Features

User Accounts

  • Username
  • Email Address
  • Password

Project

  • Create a project
    • Title
    • Owner (a user)
    • Description
    • Image
    • Target Amount to fundraise
    • Open/Close (Accepting new supporters)
    • When was the project created
  • Ability to pledge to a project
    • An amount
    • The project the pledge is for
    • The supporter
    • Whether the pledge is anonymous
    • A comment to go with the pledge

Implement suitable update delete

Note: Not all of these may be required for your project, if you have not included one of these please justify why.

  • Project
    • Create
    • Retrieve
    • Update
    • Destroy
  • Pledge
    • Create
    • Retrieve
    • Update
    • Destroy
  • User
    • Create
    • Retrieve
    • Update
    • Destroy

Implement suitable permissions

Note: Not all of these may be required for your project, if you have not included one of these please justify why.

  • Project
    • Limit who can create Default - must have authentication to create a project
    • Limit who can retrieve No authentication required to view projects
    • Limit who can update
    • Limit who can delete
  • Pledge
    • Limit who can create Default - must have an authentication to create a pledge
    • Limit who can retrieve No authentication required to view other users pledges
    • Limit who can update
    • Limit who can delete
  • User
    • Limit who can retrieve Users cannot view other users User profile details, list view only hide personal details in list view?
    • Limit who can update
    • Limit who can delete

Implement relevant status codes

  • Get returns 200
  • Create returns 201
  • Not found returns 404

Handle failed requests gracefully

  • 404 response returns JSON rather than text

Use token authentication

  • implement /api-token-auth/

Additional features

  • {Filtering }

{{ Filtering through existing project list based on a number of parameters }}

  • {Search Function}

{{ Search Function currently embedded into Filter }}

  • {Title Feature 3}

{{ description of feature 3 }}

External libraries used

  • django-filter

Part A Submission

  • A link to the deployed project. https://little-silence-1263.fly.dev/

  • A screenshot of Insomnia, demonstrating a successful GET method for any endpoint.

  • A screenshot of Insomnia, demonstrating a successful POST method for any endpoint.

  • A screenshot of Insomnia, demonstrating a token being returned.

  • Your refined API specification and Database Schema.

    *API Spec: https://docs.google.com/document/d/15uhUWko3P4Z2_bwiIbDz3tKzQwObk-tJgQqC9SFlBtA/edit?usp=sharing
    
    *Database Schema and MVP in 'Ben'.
    

Step by step instructions for how to register a new user and create a new project (i.e. endpoints and body data).

  1. Create User
curl --request POST \
  --url http://localhost:8000/users/ \
  --header 'Authorization: Token 7a56f8811047d79b47498ed97445a4a7ac7fcbc3' \
  --header 'Content-Type: application/json' \
  --data '{
	"first_name": "Harriette",
	"last_name": "Wells",
	"date_of_birth": "1998-08-09",
	"profile_picture": "http://t0.gstatic.com/licensed-image?q=tbn:ANd9GcSl2g-ek1913YE-0UKoWmzr1y-nXzJ59fBAWDH7klvHtc1saFzy8ynISmHCzc-S3n5ELMCPUf8xlomN2-w",
	"bio": "Hi, I'\''m Harriete :)",
	"country_of_residence": "Switzerland",
	"highest_level_of_education": "Technical entry",
	"username": "Harriette",
	"email": "harriettewells@gmail.com",
	"password": "harriettewells",
	"repeat_password": "harrygeorge"
}'
  1. Sign in User
curl --request POST \
  --url http://localhost:8000/api-token-auth/ \
  --header 'Content-Type: application/json' \
  --data '{
	"username": "admin",
	"password": "bigboss2"
}'
  1. Create Project
curl --request POST \
  --url http://localhost:8000/projects/ \
  --header 'Authorization: Token 7a56f8811047d79b47498ed97445a4a7ac7fcbc3' \
  --header 'Content-Type: application/json' \
  --data '{
	"title": "Fat panda",
	"description": "Squish the fat panda!",
	"goal": 12.5,
	"image": "https://cff2.earth.com/uploads/2022/01/18083629/Giant-pandas2-960x640.jpg",
	"is_open": true,
	"date_created": "2023-01-29T04:01:05.630Z"
}'

About

she-codes-crowdfunding-api-project-kalicialopez created by GitHub Classroom


Languages

Language:Python 98.3%Language:Dockerfile 1.3%Language:Shell 0.4%