Skip to content

Commit

Permalink
Merge pull request #19 from josemoracard/jose1-README
Browse files Browse the repository at this point in the history
fixed text README
  • Loading branch information
tommygonzaleza authored Jan 5, 2024
2 parents d655c4b + 7f74706 commit 79ede1f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 56 deletions.
57 changes: 28 additions & 29 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,73 @@
# StarWars Blog API
<!--endhide-->

Es recomendado desarrollar este proyecto en conjunto con el [StarWars Blog Reading List](https://github.com/breatheco-de/exercise-starwars-blog-reading-list), eventualmente ese Front-End se integrarΓ‘ con el API que vas a desarrollar en este proyecto y tendrΓ‘s una aplicaciΓ³n completamente funcional con Front-End y Back-End.
Es recomendado desarrollar este proyecto en conjunto con el [StarWars Blog Reading List](https://github.com/breatheco-de/exercise-starwars-blog-reading-list), eventualmente ese front-end se integrarΓ‘ con la API que vas a desarrollar en este proyecto y tendrΓ‘s una aplicaciΓ³n completamente funcional con front-end y back-end.

Hoy vamos a construir un API para administrar un blog (El Starwars Blog), los usuarios de este blog van a poder listar planetas, personas, y agregar o eliminar favoritos.
Hoy vamos a construir una API para administrar un blog (El StarWars Blog), los usuarios de este blog van a poder listar planetas, personajes, y agregar o eliminar favoritos.

Para permitir que los usuarios hagan todo esto, debemos seguir los siguientes pasos:

1. Comienza por modelar la base de datos: crea una base de datos y las tablas necesarias para almacenar esa informaciΓ³n, es posible que ya lo hayas hecho en el proyecto StartWars DataModeling en [python/flask](https://github.com/breatheco-de/exercise-starwars-data-modeling) o [node/express](https://github.com/breatheco-de/starwars-data-model-typeorm-node)
2. Crea tus endpoints finales utilizando Flask o Express (segΓΊn el idioma principal de tu clase).
3. Prueba constantemente endpoints con Postman.
1. Comienza por modelar la base de datos: crea una base de datos y las tablas necesarias para almacenar esa informaciΓ³n, es posible que ya lo hayas hecho en el proyecto StarWars DataModeling en [python/flask](https://github.com/breatheco-de/exercise-starwars-data-modeling) o [node/express](https://github.com/breatheco-de/starwars-data-model-typeorm-node).
2. Crea tus endpoints utilizando Flask o Express (segΓΊn el lenguaje principal de tu clase).
3. Prueba constantemente tus endpoints con [Postman](https://www.postman.com/).

## 🌱 Cómo comenzar este proyecto

No clones este repositorio porque vamos a usar una plantilla diferente.

Recomendamos abrir el `flask template` o el `express.js template` usando una herramienta de aprovisionamiento como [Codespaces](https://4geeks.com/es/lesson/tutorial-de-github-codespaces) (recomendado) o [Gitpod](https://4geeks.com/es/lesson/como-utilizar-gitpod). Alternativamente, puedes clonarlo en tu computadora local usando el comando `git clone`.
Recomendamos abrir el `flask template` o el `express.js template` usando un entorno de desarrollo como [Codespaces](https://4geeks.com/es/lesson/tutorial-de-github-codespaces) (recomendado) o [Gitpod](https://4geeks.com/es/lesson/como-utilizar-gitpod). Alternativamente, puedes clonarlo en tu computadora local usando el comando `git clone`.

Estos son los repositorios que necesitas abrir o clonar:

```
```text
🐍 Para Python/Flask:
https://github.com/4GeeksAcademy/flask-rest-hello
πŸ‘©πŸ½β€πŸ’» Para Node/Express.js:
https://github.com/4GeeksAcademy/expressjs-rest-hello
```

(si trabajas localmente debes tener una base de datos y Node.js o python 3.7+ pero puedes usar Gitpod, trae todo instalado)
> ⚠ Si trabajas localmente debes tener una base de datos y Node.js o Python 3.7+ pero si usas Codespaces o Gitpod ya viene todo instalado.
🐍 Para Python: El boilerplate tiene un archivo README con instrucciones y un video de como usarlo y como construir un API. Puedes hacer este tutorial interactivo primero sobre [como construir API's con Flask](https://github.com/breatheco-de/python-flask-api-tutorial).
🐍 Para Python: El boilerplate tiene un archivo README con instrucciones y un video de como usarlo y como construir una API. Puedes hacer este tutorial interactivo primero sobre [como construir APIs con Flask](https://github.com/breatheco-de/python-flask-api-tutorial).

**πŸ‘‰ Por favor sigue estos pasos** [cΓ³mo comenzar un proyecto de codificaciΓ³n](https://4geeks.com/es/lesson/como-comenzar-un-proyecto-de-codificacion).
**πŸ‘‰ Por favor sigue estos pasos sobre** [cΓ³mo comenzar un proyecto de programaciΓ³n](https://4geeks.com/es/lesson/como-comenzar-un-proyecto-de-codificacion).

πŸ’‘ Importante: Recuerda guardar y subir tu cΓ³digo a GitHub creando un nuevo repositorio, actualizando el remoto (`git remote set-url origin <your new url>`) y subiendo el cΓ³digo a tu nuevo repositorio usando los comandos `add`, `commit` y `push` desde la terminal de git.
> πŸ’‘ Importante: Recuerda guardar y subir tu cΓ³digo a GitHub creando un nuevo repositorio, actualizando el remoto (`git remote set-url origin <your new url>`) y subiendo el cΓ³digo a tu nuevo repositorio usando los comandos `add`, `commit` y `push` desde la terminal de git.
## πŸ“ Instrucciones

Crea un API conectada a una base de datos e implemente los siguientes endpoints (muy similares a SWAPI.dev or SWAPI.tech):
Crea una API conectada a una base de datos e implemente los siguientes endpoints (muy similares a SWAPI.dev or SWAPI.tech):

- `[GET] /people` Listar todos los registros de `people` en la base de datos
- `[GET] /people/<int:people_id>` Listar la informaciΓ³n de una sola `people`
- `[GET] /planets` Listar los registros de `planets` en la base de datos
- `[GET] /planets/<int:planet_id>` Listar la informaciΓ³n de un solo `planet`
- `[GET] /people` Listar todos los registros de `people` en la base de datos.
- `[GET] /people/<int:people_id>` Muestra la informaciΓ³n de un solo personaje segΓΊn su id.
- `[GET] /planets` Listar todos los registros de `planets` en la base de datos.
- `[GET] /planets/<int:planet_id>` Muestra la informaciΓ³n de un solo planeta segΓΊn su id.

Adicionalmente, necesitamos crear los siguientes endpoints para que podamos tener usuarios en nuestro blog:
Adicionalmente, necesitamos crear los siguientes endpoints para que podamos tener usuarios y favoritos en nuestro blog:

- `[GET] /users` Listar todos los usuarios del blog
- `[GET] /users` Listar todos los usuarios del blog.
- `[GET] /users/favorites` Listar todos los favoritos que pertenecen al usuario actual.
- `[POST] /favorite/planet/<int:planet_id>` AΓ±ade un nuevo `planet` favorito al usuario actual con el planet id = `planet_id`.
- `[POST] /favorite/people/<int:people_id>` AΓ±ade una nueva `people` favorita al usuario actual con el people.id = `people_id`.
- `[DELETE] /favorite/planet/<int:planet_id>` Elimina un `planet` favorito con el id = planet_id`.
- `[DELETE] /favorite/people/<int:people_id>` Elimina una `people` favorita con el id = `people_id`.
- Tu API actual no tiene un sistema de autenticaciΓ³n (todavΓ­a), es por eso que la ΓΊnica forma de crear usuarios es directamente en la base de datos usando el flask admin.
- `[POST] /favorite/planet/<int:planet_id>` AΓ±ade un nuevo `planet` favorito al usuario actual con el id = `planet_id`.
- `[POST] /favorite/people/<int:people_id>` AΓ±ade un nuevo `people` favorito al usuario actual con el id = `people_id`.
- `[DELETE] /favorite/planet/<int:planet_id>` Elimina un `planet` favorito con el id = `planet_id`.
- `[DELETE] /favorite/people/<int:people_id>` Elimina un `people` favorito con el id = `people_id`.
- Tu API actual no tiene un sistema de autenticaciΓ³n (todavΓ­a), es por eso que la ΓΊnica forma de crear usuarios es directamente en la base de datos usando el Flask admin.

☝️ Nota: Aquí hay un ejemplo en Postman:
https://documenter.getpostman.com/view/2432393/TzRSgnTS#a4174b48-3fc8-46e3-bf82-19a08107666f
> Nota: AquΓ­ hay un ejemplo en Postman: https://documenter.getpostman.com/view/2432393/TzRSgnTS#a4174b48-3fc8-46e3-bf82-19a08107666f
## πŸ“– Fundamentos

Este ejercicio te permitirΓ‘ practicar las siguientes habilidades y conceptos:

1. ConstrucciΓ³n de API's utilizando el standard REST (A.k.a: RESTful API's)
2. Construir una base de datos utilizando el **ORM** llamado [SQLAlchemy](https://www.sqlalchemy.org/) o TypeORM (https://typeorm.io/).
1. ConstrucciΓ³n de APIs utilizando el standard REST (a.k.a: RESTful APIs).
2. Construir una base de datos utilizando el **ORM** llamado [SQLAlchemy](https://www.sqlalchemy.org/) o [TypeORM](https://typeorm.io/).
3. Utilizar y entender sistemas de migraciones de bases de datos con [Alembic](https://alembic.sqlalchemy.org/en/latest/) o las migraciones nativas de TypeORM (en el caso de node.js).

## 😎 Te sientes con confianza?

Los siguientes requerimientos no son necesarios para completar el proyecto satisfactoriamente, pero puedes desarrollarlos para continuar tu aprendizaje si te sientes con suficiente confianza.

`+4` Crea API Endpoints para agregar (POST), modificar (PUT) y eliminar (DELETE) `planets` y `people`. De esta manera, toda la base de datos va a poder ser administrada via API.
`+4` Crea endpoints para agregar (POST), modificar (PUT) y eliminar (DELETE) `planets` y `people`. De esta manera, toda la base de datos va a poder ser administrada vΓ­a API en vez de depender del admin de Flask.

Este y otros proyectos son usados para [aprender a programar](https://4geeksacademy.com/es/aprender-a-programar/aprender-a-programar-desde-cero) por parte de los alumnos de 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) realizado por [Alejandro SΓ‘nchez](https://twitter.com/alesanchezr) y muchos otros contribuyentes. Conoce mΓ‘s sobre nuestros [Curso de ProgramaciΓ³n](https://4geeksacademy.com/es/curso-de-programacion-desde-cero?lang=es) para convertirte en [Full Stack Developer](https://4geeksacademy.com/es/coding-bootcamps/desarrollador-full-stack/?lang=es), o nuestro [Data Science Bootcamp](https://4geeksacademy.com/es/coding-bootcamps/curso-datascience-machine-learning).
Este y otros proyectos son usados para [aprender a programar](https://4geeksacademy.com/es/aprender-a-programar/aprender-a-programar-desde-cero) por parte de los alumnos de 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) realizado por [Alejandro SΓ‘nchez](https://twitter.com/alesanchezr) y muchos otros contribuyentes. Conoce mΓ‘s sobre nuestros [Cursos de ProgramaciΓ³n](https://4geeksacademy.com/es/curso-de-programacion-desde-cero?lang=es) para convertirte en [Full Stack Developer](https://4geeksacademy.com/es/coding-bootcamps/desarrollador-full-stack/?lang=es), o nuestro [Data Science Bootcamp](https://4geeksacademy.com/es/coding-bootcamps/curso-datascience-machine-learning).
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# StarWars Blog API
<!--endhide-->

It is recommended to develop this project in conjuntion with the [StartWars Blog Reading List](https://github.com/breatheco-de/exercise-starwars-blog-reading-list), you will eventually integrate both projects and have fully functional applications with backend and front-end.
It is recommended to develop this project in conjunction with the [StarWars Blog Reading List](https://github.com/breatheco-de/exercise-starwars-blog-reading-list), you will eventually integrate both projects and have fully functional applications with back-end and front-end.

Today we are going to build one API to manage a blog (about StartWars), users on this blog will be able to list planets, list characters, and create or remove favorites.
Today we are going to build an API to manage a blog (about StarWars). Users on this blog will be able to list planets, list characters, and create or remove favorites.

To allow users to do all of this, we must follow these steps:

1. Start by modeling the database: Create a database and the tables needed to store that information, you may have already done this when you did the StartWars DataModeling project in [python/flask](https://github.com/breatheco-de/exercise-starwars-data-modeling) or [node/express](https://github.com/breatheco-de/starwars-data-model-typeorm-node)
1. Start by modeling the database: Create a database and the tables needed to store that information. You may have already done this when you did the StarWars Data Modeling project in [python/flask](https://github.com/breatheco-de/exercise-starwars-data-modeling) or [node/express](https://github.com/breatheco-de/starwars-data-model-typeorm-node).
2. Build your endpoints using Flask or Express (depending on your cohort's main language).
3. Constantly test your endpoints with the postman.
3. Constantly test your endpoints with [Postman](https://www.postman.com/).

## 🌱 How to start this project
## 🌱 How to start this project

Do not clone this repository because we are going to be using a different template.

Expand All @@ -28,50 +28,49 @@ https://github.com/4GeeksAcademy/flask-rest-hello
https://github.com/4GeeksAcademy/expressjs-rest-hello
```

(you will need to have a database installed and python 3.7+ installed if you do it locally but all of that it's already installed on Gitpod)
> ⚠ You will need to have a database installed and Node.js or Python 3.7+ installed if you do it locally, but all of that is already installed on Codespaces or Gitpod.
The boiplerplate's README files has a video on how to start and complete your API.
The boilerplate's README files have a video on how to start and complete your API.

🐍 For python: There is an interactive tutorial on how to build a [Flask API](https://github.com/breatheco-de/python-flask-api-tutorial), it's a similar process but instead of `tasks` here you will be dealing with `people` and `planets`.
🐍 For Python: There is an interactive tutorial on how to build a [Flask API](https://github.com/breatheco-de/python-flask-api-tutorial), it's a similar process, but instead of `tasks`, here you will be dealing with `people` and `planets`.

**πŸ‘‰ Please follow these steps on** [how to start a coding project](https://4geeks.com/lesson/how-to-start-a-project).

πŸ’‘ Important: Remember to save and upload your code to GitHub by creating a new repository, updating the remote (`git remote set-url origin <your new url>`), and uploading the code to your new repository using the `add`, `commit` and `push` commands from the git terminal.
> πŸ’‘ Important: Remember to save and upload your code to GitHub by creating a new repository, updating the remote (`git remote set-url origin <your new url>`), and uploading the code to your new repository using the `add`, `commit` and `push` commands from the git terminal.
## πŸ“ Instructions

Create an API that connects to a database and implements the following Endpoints (very similar to SWAPI.dev or SWAPI.tech):
Create an API that connects to a database and implements the following endpoints (very similar to SWAPI.dev or SWAPI.tech):

- `[GET] /people` Get a list of all the people in the database
- `[GET] /people/<int:people_id>` Get a one single people information
- `[GET] /planets` Get a list of all the planets in the database
- `[GET] /planets/<int:planet_id>` Get one single planet information
- `[GET] /people` Get a list of all the people in the database.
- `[GET] /people/<int:people_id>` Get one single person's information.
- `[GET] /planets` Get a list of all the planets in the database.
- `[GET] /planets/<int:planet_id>` Get one single planet's information.

Additionally create the following endpoints to allow your StartWars blog to have users and favorites:
Additionally, create the following endpoints to allow your StarWars blog to have users and favorites:

- `[GET] /users` Get a list of all the blog post users
- `[GET] /users` Get a list of all the blog post users.
- `[GET] /users/favorites` Get all the favorites that belong to the current user.
- `[POST] /favorite/planet/<int:planet_id>` Add a new favorite planet to the current user with the planet id = `planet_id`.
- `[POST] /favorite/people/<int:people_id>` Add new favorite people to the current user with the people id = `people_id`.
- `[DELETE] /favorite/planet/<int:planet_id>` Delete favorite planet with the id = `planet_id`.
- `[DELETE] /favorite/people/<int:people_id>` Delete favorite people with the id = `people_id`.
- Your current API does not have an authentication system (yet), which is why the only way to create users is directly on the database using the flask admin.
- `[POST] /favorite/planet/<int:planet_id>` Add a new favorite `planet` to the current user with the planet id = `planet_id`.
- `[POST] /favorite/people/<int:people_id>` Add new favorite `people` to the current user with the people id = `people_id`.
- `[DELETE] /favorite/planet/<int:planet_id>` Delete a favorite `planet` with the id = `planet_id`.
- `[DELETE] /favorite/people/<int:people_id>` Delete a favorite `people` with the id = `people_id`.
- Your current API does not have an authentication system (yet), which is why the only way to create users is directly on the database using the Flask admin.

☝️ Note: here is a sample API in Postman:
https://documenter.getpostman.com/view/2432393/TzRSgnTS#a4174b48-3fc8-46e3-bf82-19a08107666f
> Note: here is a sample API in Postman: https://documenter.getpostman.com/view/2432393/TzRSgnTS#a4174b48-3fc8-46e3-bf82-19a08107666f
## πŸ“– Fundamentals

This exercise will make you practice the following fundamentals:

1. Building an RESTful API using one of the most popular libraries [Python Flask](https://flask.palletsprojects.com/en/1.1.x/) or [Express.js](https://expressjs.com/).
1. Building an RESTful API using one of the most popular libraries, [Python Flask](https://flask.palletsprojects.com/en/1.1.x/) or [Express.js](https://expressjs.com/).
2. Building a database with the **ORM** called [SQLAlchemy](https://www.sqlalchemy.org/) or [TypeORM](https://typeorm.io/)
3. Database Migrations using migration system [Alembic](https://alembic.sqlalchemy.org/en/latest/) or the native migration system from TypeORM.
3. Database Migrations using the migration system [Alembic](https://alembic.sqlalchemy.org/en/latest/) or the native migration system from TypeORM.

## 😎 Feeling confident?

The following requirements are not necessary to successfully complete this project, but you wpuld like to try coding them if you feel like challenging yourself ☺️
The following requirements are not necessary to successfully complete this project, but you would like to try coding them if you feel like challenging yourself ☺️

`+1` Create also an endpoint to add (POST), update (PUT), and delete (DELETE) planets and people, that way all the database information can be managed using the API instead of having to rely on the flask admin to create the plantes and people.
`+4` Create also endpoints to add (POST), update (PUT), and delete (DELETE) planets and people. That way all the database information can be managed using the API instead of having to rely on the Flask admin to create the planets and people.

This and many other projects are built by students as part of the 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) by [Alejandro Sanchez](https://twitter.com/alesanchezr) and many other contributors. Find out more about our [Full Stack Developer Course](https://4geeksacademy.com/us/coding-bootcamps/part-time-full-stack-developer), and [Data Science Bootcamp](https://4geeksacademy.com/us/coding-bootcamps/datascience-machine-learning).

0 comments on commit 79ede1f

Please sign in to comment.