Skip to content

codyaverett/acre-trader-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Todo REST service

This is a Django REST api project that can be used to create and manage Todos and Lists of Todos.

Table of Contents

Project Details

The service should perform CRUD operations on a database of to-do records. The service will be used privately by one user.

A to-do record should consist of the date and time the record was created, the date and time the to-do is due, the date and time the to-do was done, a description of the to-do, and the status of the to-do.

The service should provide valid and appropriate HTTP responses for the type of API resource request.

I am free to use any number of libraries and frameworks that I see fit to use.

Technologies used

Features

  • Create a to-do record by specifying the description and desired date and time of completion.
  • Retrieve a list of to-do records.
  • Update a to-do record with new values for meaningful fields.
  • Delete a to-do record.
  • Filtering, searching, and sorting to-do records by meaningful fields. (Provided through Admin panel)
  • Implements http authentication layer to protect the api from unauthorized write access

Extra features

  • Create lists of todos so it's not just one big list
  • Admin panel is configured to allow users to manage their Todos and TodoLists
  • Todos and TodoLists are searchable, and sortable by meaningful fields.

Public API

» ./manage.py show_urls | grep /api/v1/ | awk '{ print $1 }'

/api/v1/
/api/v1/\.<format>/
/api/v1/api-auth/login/
/api/v1/api-auth/logout/
/api/v1/todolists/
/api/v1/todolists/<id>/
/api/v1/todolists/<id>\.<format>/
/api/v1/todolists\.<format>/
/api/v1/todos/
/api/v1/todos/<id>/
/api/v1/todos/<id>\.<format>/
/api/v1/todos\.<format>/
/docs/
/docs/schema.js

After development setup, view the interactive docs for more detail. http://127.0.0.1:9001/docs/

Development

There a few steps required before local development can be started on a new machine.

1. Install Application dependencies

Install pipenv if you don't already have it.

pip install --user pipenv

Run pipenv install --dev anywhere in the project directory to install all the project dependencies and development dependencies.

Then run pipenv shell to place your shell into this pipenvs virutal context and enable use of the package dependencies we just installed.

2. Configure Project Environment Variables

Create a src/.env file with the following values:

POSTGRES_USER=admin
POSTGRES_PASSWORD=postgres
POSTGRES_DB=todo
POSTGRES_HOST=localhost
POSTGRES_PORT=5432

3. Setup a Postgres Database

Install docker if you don't have it.

With docker installed, run the src/start_db.sh script to download and start a postgres database and postgres admin container images.

This src/start_db.sh script also sources from the src/.env file we created for basic postgres configurations.

5. Start the Django development server

From the src/ directory run either:

  • the ./start_app.sh script to start the Django development server on port 9001.
  • or use ./manage.py runserver 9001

6. Use the api and development tools

About

Coding challenge for acre trader team

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published