caloni / cadastro-dvds-venda Goto Github PK
View Code? Open in Web Editor NEWUm sistema de cadastro de DVDs para venda. Duh.
Um sistema de cadastro de DVDs para venda. Duh.
We have some DVDs that need images to be taken to be available to register them to sell.
The app can take picture of DVDs and those pictures will be saved in the cloud.
We need an image API to upload and have direct link to those images to use them in the spreadsheet to MercadoLivre product registration. Initially I tried to use imgr, but now they do not allow phone numbers from Brazil region to sign up, so we need a better solution. Could be an anonymous one, a free one and could be a very cheap one. What is easier to use as a REST API.
The app can take pictures and those pictures, the direct links are part of the DVD registration and those links can access the images from everywhere.
We started the project as a classic client/server approach, where the client could be any app or site that uses the API in the server side. However, the mobile approach will be the only one needed for this project and doesn't make sense put all this complexity of where to put the API running and database issues when a simple phone app can handle all of this.
Get rid of every API reference, including the API itself. The solution must still keep working using a local database and accessing external APIs.
Just use the sqlite (Android default database) for the app and delete a lot of code. It should be no complex interaction between APIs in the project.
It is possible to use the app without the need to put some server up. Just internet connection is enough.
We have a horrible Python script that manipulates a Mercado Livre spreadsheet used to create multiple products in order to register the available DVDs to sell.
Transform this script into an API that receives every item as a json object.
There is no need to think about security or good practices in this project right now, it is going to run locally. Just write a goddam API that receives one json object and put it into a database (every database is just fine). It can be done in every language.
The json object can be something like this:
{
"dvd":
{
"productTitle": "DVD O Poderoso Chefão",
"images": "url-to-image-or-empty,another-url-to-image-or-nothing",
"qty": "1",
"price": "12,99",
"condition": "Usado",
"movieTrailer": "link-to-youtube-with-movie-trailer",
"delivery": "A definir",
"takeout": "Permitido",
"warranty": "Sem garantia",
"format": "DVD",
"movieTitle": "O Poderoso Chefão",
"movieDirector": "Francis Ford Coppola",
"resolution": "SD",
"disks": "1",
"audio": "Inglês",
"gender": "Drama",
"company": "Paramount"
}
}
Use case:
curl -H "application/json" -d "@dvd.json" http://localhost:8080/dvds
dvd criado com sucesso!
It is possible to call this API and as a consequence the next select from the database should return this new item.
We need to type every detail of the movie when registering a new DVD.
We can use the IMDB and its REST API or Google. The advantage of Google is that is possible to type the brazilian title of the movie and still find it (not always available in IMDB). Other options include OMDB. We can take advantage of Python lib and export this in a endpoint inside the API (look at this script).
It is possible to type a word in the product title field and at least one movie should be floating; if selected at least the movie title and movie director fields should be filled automatically.
We have some DVDs that need images to be taken to be available to register them to sell. We also have the upload image feature available. Both are not tested or documented using a cell phone.
The app in the cell phone can take picture of DVDs and those pictures will be saved in the cloud after taken. The link to those images will appear in one of the fields used to register the DVD.
We already have a image upload API to send those images and get the URL. What we don't have is take pictures with the cell phone camera and select those pictures to send. There is not a updated documentation of how to proceed to do that (the installation and use doc).
The app in the cell phone can take pictures and those pictures, the direct links are part of the DVD registration field and those links can access the images from everywhere.
The Issue #8 was not fixed because it was discovered that there is a much simpler way to fill the movie details using Google Vision API.
Now we have in the app the feature of adding images to the cloud and get its links. Using the link above is possible to call Google Vision to get the text from those images and use it as an autocomplete option for other fields.
To use text from the images from the DVD to autocomplete the fields that are being filled by the user. The autocomplete option can show up in every field to be filled as was being made for movie title.
Call Google Vision API directly from the app using the images captured from the camera and use the autocomplete feature to fill the fields the user selected.
When editing or adding a new DVD with 1 or more images some text present in those images must be in the autocomplete option for the fields movie title and director, as well as others (optional).
With the register API we have a database with all the DVDs, but no way to transform this database to the MercadoLivre spreadsheet to registers the products.
Create a link to download a spreadsheet with all the DVDs registered.
This link can be a new endpoint. What the endpoint must do is to use a spreadsheet template and a select in the database to populate the spreadsheet (there is a Python script to do that already). This spreadsheet can be temporary and available in memory just to return to the caller is able to download it.
Must be possible to access a link and download the spreadsheet. The spreadsheet must contain all the DVDs registered.
We need to register a DVD using terminal command running curl or similar to access the API.
Use an app to register a DVD.
Just start an Android app using Android Studio or whatever and in the first screen put the DVD required fields. An add button must call the API using these fields to register a new DVD.
A new DVD registered using the app must show up in the downloaded spreadsheet.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.