Skip to content

ArmandoBarragan/TickTickSchoolBackend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tick Tick School backend app

Frontend repository: https://github.com/montesp/tick-tick-school-frontend

Project contributers

  • Armando Barragán Pacheco.
    Role: Backend developer, software architect.
    Email: armandobp765@gmail.com
    Github user: ArmandoBarragan
  • Pavel Ivan Montes Bissio.
    Role: Frontend developer, UI/UX designer.
    Email: pavelmontes22@gmail.com
    Github user: montesp

API usage

Models of the database are, at the moment, User, Task and Subject. A neither a task nor a subject can be created without any users, so you need to create a few to test them.

You can call the api in local with the address localhost:8000 and use the following urls:

  • Users:
    • users/signup/ to create a new user.
    • Parameters: email, password, password_confirmation, first_name, last_name

    • api-token-auth to get the user's token.
    • Parameters: Username and password

      KEEP IN MIND: This URL and parameters MIGHT BE CHANGED on future updates.

      Note: This will return 404 if credentials are incorrect

    • users/{{pk}} to get a user's email, firstname and lastnames
    • users/ This does not work. It's only for staff, which has not been planned as a functionality yet.
  • Subjects:
    • POST subjects/
    • Parameters: (Being * a required param) name*, teacher, classroom.
    • GET subjects/ returns name, student, teacher, classroom of all user's subjects.
    • GET subjects/{subject_pk} returns name, student, teacher, classroom of a specific subject.
  • Tasks:
    • POST tasks/
    • Parameters: name*, subject*, description, status. If a status is not sent, it's set as 'pendiente' as default.
    • GET tasks/ returns name, subject, description and status of all user's tasks.
    • GET tasks/{ task_pk } returns name, subject, description and status a specific task.

Authorization

The project works with token authorization, so for each request it is necessary to set 'Authorization: Token {{token}}' in it's header, except for the login and signup urls.

Local installation for frontends

To have this project installed for development purposes, it is necessary to first install docker and docker compose. To do so, you can follow the given documentation:

After having those installed, you need to cd your way into the project till you are in the root, right next to the local.yml file, and execute the following command: docker-compose -f local.yml up --build -d, and then docker-compose -f local.yml exec app python3 manage.py migrate.These commands will do just enough if you are working on the frontend and neet to test the API calls. If you want to run the project as a backend dev, you can either work on it on a container or the Django listener with python3 manage.py runserver. If you opt for the container option and are gonna work during full sessions on the compose files, you will probably want to export the file variable every session so that you don't have to write -f local.yml. You can do this by executing the following command: export COMPOSE_FILE=local.yml.

Local installation for backends

Backends can install their project with either docker-compose or directly executing python3 manage.py migrate and python3 manage.py runserver. They just need to change the CONTAINER_ENVIRON variable from the local.yml file to false to stop using docker.

Project deployment

For deployment it is as necessary to have docker and docker compose installed as it is needed on development. You, as well, need to cd your way into the root of the project. Environment variables have to be changed on the production.yml file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published