Skip to content

A mini blog Django project demonstrating the implementation of the Services and Repositories design pattern for a blog application.

Notifications You must be signed in to change notification settings

MateoRamirezRubio1/mini-blog-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is a Django-based mini blog application designed to illustrate the implementation of the Services and Repositories design pattern. It features a clear separation of concerns, making the codebase easier to maintain and extend.

You can follow the step by step of the making of the app on my blog: My blog.
You can see the application test here: Testing App.

Features

  • Posts and Comments: Users can create, update, and delete blog posts and comments.
  • RESTful API: Provides endpoints for interacting with the application programmatically.
  • Web Interface: Offers a basic user-friendly interface for managing posts and comments.
  • Service Layer: Contains business logic and orchestrates interactions between views and repositories.
  • Repository Layer: Encapsulates data access logic, providing a clean API for the service layer.
  • Django Admin: Allows administrative management of posts and comments.

Project Structure

The project follows a modular structure, with each app having its own models, views, serializers, services, and repositories.

my_project_blog/
├── apps/
│ ├── comments/
│ │ ├── models.py
│ │ ├── repositories/
│ │ ├── services/
│ │ ├── templates/
│ │ ├── views/
│ ├── posts/
│ │ ├── models.py
│ │ ├── repositories/
│ │ ├── services/
│ │ ├── templates/
│ │ ├── urls/
│ │ ├── views/
├── my_project_blog/
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
├── manage.py

Architectural pattern

PatronArquitectura

Getting Started

To get started with this project, follow these steps:

  1. Clone the repository:
git clone https://github.com/MateoRamirezRubio1/mini-blog-rest-api.git
cd my_project_blog
  1. Set up a virtual environment:
python -m venv venv
source `venv\Scripts\activate` # This is for windows

  1. Install dependencies:
pip install -r requirements.txt
  1. Apply migrations:
python manage.py makemigrations
python manage.py migrate
  1. Create a superuser:
python manage.py createsuperuser
  1. Run the development server:
python manage.py runserver
  1. Access the application:
    Open your web browser and go to http://127.0.0.1:8000/api/posts/ to start creating posts.

Releases

No releases published

Packages

No packages published