https://github.com/mateoramirezrubio1/mini-blog-rest-api
A mini blog Django project demonstrating the implementation of the Services and Repositories design pattern for a blog application.
https://github.com/mateoramirezrubio1/mini-blog-rest-api
api api-rest django django-rest-framework pytest python rest rest-api test testing
Last synced: about 2 months ago
JSON representation
A mini blog Django project demonstrating the implementation of the Services and Repositories design pattern for a blog application.
- Host: GitHub
- URL: https://github.com/mateoramirezrubio1/mini-blog-rest-api
- Owner: MateoRamirezRubio1
- Created: 2024-07-08T10:58:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-28T09:54:33.000Z (almost 2 years ago)
- Last Synced: 2025-04-01T05:42:49.018Z (about 1 year ago)
- Topics: api, api-rest, django, django-rest-framework, pytest, python, rest, rest-api, test, testing
- Language: Python
- Homepage: https://mateoramirezr.hashnode.dev/django-services-and-repositories-design-pattern-with-rest-api
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](https://mateoramirezr.hashnode.dev/django-services-and-repositories-design-pattern-with-rest-api).**
**You can see the application test here: [Testing App](https://mateoramirezr.hashnode.dev/preview/669dcc8df7b0290261679dad).**
## 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

## 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
```
2. **Set up a virtual environment:**
```
python -m venv venv
source `venv\Scripts\activate` # This is for windows
```
3. **Install dependencies:**
```
pip install -r requirements.txt
```
4. **Apply migrations:**
```
python manage.py makemigrations
python manage.py migrate
```
5. **Create a superuser:**
```
python manage.py createsuperuser
```
6. **Run the development server:**
```
python manage.py runserver
```
7. **Access the application:**
Open your web browser and go to `http://127.0.0.1:8000/api/posts/` to start creating posts.