Coder Social home page Coder Social logo

joshjhans / django-angular-to-do-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 254 KB

To-do App with Django, Django Rest Framework, Angular, TypeScript, Tailwind, OpenAPI Generator, and NgRx

License: MIT License

Dockerfile 2.71% Makefile 0.02% Python 11.78% TypeScript 79.94% HTML 4.45% CSS 0.38% JavaScript 0.71%

django-angular-to-do-app's Introduction

To-do App with Django, Django Rest Framework, Angular, TypeScript, Tailwind, OpenAPI Generator, and NgRx

alt text

This is a simple to do application demonstrating use of the following technologies:

  • Django
  • Django REST Framework
  • DRF Spectacular
  • Angular
  • TypeScript
  • Tailwind
  • OpenAPI Generator
  • NgRx

Getting Started

1. Clone Repo

git clone https://github.com/joshjhans/django-angular-to-do-app.git

2. Attach VS Code to cloned django-angular-to-do-app directory

Open the django-angular-to-do-app directory with VS Code.

3. Open django-angular-to-do-app directory in a container

VS Code Open Folder in Container

Note that the Dockerfile will install the necessary Python, Node, and Java dependencies as part of the Docker image.

4. Backend API

The backend is located in the ./src/api directory. It utilizes Django, Django Rest Framework, and more to serve a REST API for the to-do app.

For security, ensure you update SECRET_KEY and ALLOWED_HOSTS in ./src/api/api/settings.py:

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure"

ALLOWED_HOSTS = ["*"]

Press Ctrl + Shift + B to open a pre-configured terminal in the ./src/api directory.

alt text

Next, ensure to migrate the Django and to-do app models to the local SQLite database by executing the following command in the API terminal (./src/api):

python manage.py migrate

Then, run the Django REST API with the following command:

python manage.py runserver

The REST API is not running at http://127.0.0.1:8000/:

python@d0878fca4e6e:/django-angular-to-do-app/src/api$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 11, 2024 - 15:45:59
Django version 5.0.3, using settings 'api.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

5. Frontend UI

The frontend is located in the ./src/ui directory. It utilizes Angular, TypeScript, Tailwind, OpenAPI Generator, NgRx and more to provide a simple user interface for the to-do application.

Press Ctrl + Shift + B to open a pre-configured terminal in the ./src/ui directory.

alt text

To start the frontend Angular application, execute the following command in the UI terminal (./src/ui):

ng serve --open

The above command will open http://localhost:4200/ in a browser.

6. Generating TypeScript Fetch Client with OpenAPI Generator

The openapi-generator project provides a means to generate REST API clients from an OpenAPI specification like that provided by DRF Spectacular. To re-generate the to-do app TypeScript client in the ./src/ui/src/app/clients directory, run the following command in the UI terminal (./src/ui):

npm run make:client

Useful Commands

Formatting

ruff check --fix .
ruff format .

To Do

  • Add backend tests
  • Add frontend tests
  • Debug permissions issues with npm i in Dockerfile
  • Show more of to-do model data in UI

django-angular-to-do-app's People

Contributors

joshjhans avatar

Watchers

 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.