Code Monkey home page Code Monkey logo

django-reddit-challenge's Introduction

Jungle Devs - Django Reddit Challenge

Description

Challenge goal: The idea of the challenge is to implement a very simplified version of Reddit, meaning you will have Users, Topics, Posts and Comments. with this you're expected to test your knowledge on the basic concepts involved in a Django backend application, and to also learn even more. Always!

Target level: This is an entry level course, no prior knowledge of programming is needed.

Final accomplishment: By the end of this challenge, you’ll be able to understand the basics of Django and how to create your own RESTful API with basic CRUD functionalities.

Acceptance criteria

  • Separate your project into 4 Django apps, one for each entity:
    • User
    • Topic
    • Post
    • Comment
  • Have all the required fields for each entity as described on this README
  • Use the URL structure described on this README with Nested URL Routers

Entities

As mentioned in the description, this challenge will have four entities (each one should be a separate app). Here are brief descriptions of what they are and what are the expected properties of each (keep in mind that you can improve them as you wish!):

  • User: can be used plain from what is offered by Django;
  • Topic: the equivalent of a sub-reddit. The suggest fields are:
    • Name
    • Title
    • Author
    • Description
    • URLName - the name we want to use to reach it through the browser (check SlugField)
    • Created_at
    • Updated_at
  • Post: the equivalent of a Reddit thread, a post belongs to a specific topic and is created by an user. The suggested fields are: _ Title _ Content _ Created_at _ Updated_at * Topic
  • Comment: the equivalent of a comment, a comment belongs to a specific post (which belongs to a specific topic) and is created by an user. The suggested fields are: _ Title _ Content _ Created_at _ Updated_at * Post

URLs

We want to have a behavior similar to Reddit (not necessarily equal), so ideally we'd like a structure like this:

  • /topics/ - lists all available topics
  • /topics/{urlname}/ - details (as well as some posts) from a specific topic (identified by urlname)
  • /topics/{urlname}/posts/ - lists all posts from a specific topic
  • /topics/{urlname}/posts/{post_id}/ - lists details and some comments from a post
  • /topics/{urlname}/posts/{post_id}/comments/ - lists all comments from a post
  • /topics/{urlname}/posts/{post_id}/comments/{comment_id}/ - lists details from a comment

Prerequisites

Development

  • Create the virtual environment and activate it
virtualenv -p python3 venv
source venv/bin/activate
  • Install the requirements pip install -r requirements.txt
  • Start the dockers docker-compose up with the database and the localstack
  • Run the server with python manage.py runserver 8000

You need a .envfile with your environment variables, here's an example file:

LOAD_ENVS_FROM_FILE='True'
ENVIRONMENT='development'
SECRET_KEY='#*=backend-challenge=*#'
DEFAULT_FROM_EMAIL='Challenge <[email protected]>'
DATABASE_URL='postgres://postgres:postgres@localhost:5432/backend-challenge-001'
SENTRY_DSN='sentry_key'
AWS_STORAGE_BUCKET_NAME='django-be'

Additional Information

Here are some useful stuff to keep in mind while completing this challenge:

django-reddit-challenge's People

Contributors

dependabot[bot] avatar lucasflomuller avatar vinibiso avatar vjusto avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.