-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3baac86
Showing
179 changed files
with
27,332 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.DS_Store | ||
node_modules | ||
db.sqlite3 | ||
/dist | ||
/venv | ||
__pycache__ | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
django = "*" | ||
whitenoise = "*" | ||
pyjwt = "*" | ||
pillow = "*" | ||
django-cors-headers = "*" | ||
|
||
[requires] | ||
python_version = "3.7" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frontend | ||
|
||
## Project setup | ||
``` | ||
npm install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
``` | ||
npm run serve | ||
``` | ||
|
||
### Compiles and minifies for production | ||
``` | ||
npm run build | ||
``` | ||
|
||
### Run your tests | ||
``` | ||
npm run test | ||
``` | ||
|
||
### Lints and fixes files | ||
``` | ||
npm run lint | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset' | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
ASGI config for backend project. | ||
It exposes the ASGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') | ||
|
||
application = get_asgi_application() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from .models import Client, Business | ||
|
||
admin.site.register(Client) | ||
admin.site.register(Business) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class AuthAppConfig(AppConfig): | ||
name = 'auth_app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Generated by Django 3.0 on 2019-12-07 02:31 | ||
|
||
import backend.auth_app.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Business', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=50)), | ||
('email', models.EmailField(max_length=100, unique=True)), | ||
('password', models.CharField(max_length=100)), | ||
('cnpj', models.CharField(max_length=30)), | ||
('city', models.CharField(max_length=50)), | ||
('state', models.CharField(max_length=30)), | ||
('photo', models.ImageField(upload_to=backend.auth_app.models.business_directory_path)), | ||
('created', models.DateTimeField()), | ||
('updated', models.DateTimeField()), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Businesses', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Client', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('first_name', models.CharField(max_length=25)), | ||
('last_name', models.CharField(max_length=50)), | ||
('birthday', models.DateTimeField()), | ||
('email', models.EmailField(max_length=50, unique=True)), | ||
('password', models.CharField(max_length=80)), | ||
('city', models.CharField(max_length=50)), | ||
('state', models.CharField(max_length=35)), | ||
('photo', models.ImageField(upload_to=backend.auth_app.models.client_directory_path)), | ||
('created', models.DateTimeField()), | ||
('updated', models.DateTimeField()), | ||
], | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from django.db import models | ||
|
||
def client_directory_path(instance, filename): | ||
return 'clients/{0}/{1}'.format(instance, filename) | ||
|
||
def business_directory_path(instance, filename): | ||
return 'businesses/{0}/{1}'.format(instance, filename) | ||
|
||
class Client(models.Model): | ||
first_name = models.CharField(max_length=25) | ||
last_name = models.CharField(max_length=50) | ||
birthday = models.DateTimeField() | ||
email = models.EmailField(unique=True, max_length=50) | ||
password = models.CharField(max_length=80) | ||
city = models.CharField(max_length=50) | ||
state = models.CharField(max_length=35) | ||
photo = models.ImageField(upload_to=client_directory_path) | ||
created = models.DateTimeField() | ||
updated = models.DateTimeField() | ||
|
||
def __str__(self): | ||
return str(self.id) | ||
|
||
class Business(models.Model): | ||
name = models.CharField(max_length=50) | ||
email = models.EmailField(unique=True, max_length=100) | ||
password = models.CharField(max_length=100) | ||
cnpj = models.CharField(max_length=30) | ||
city = models.CharField(max_length=50) | ||
state = models.CharField(max_length=30) | ||
photo = models.ImageField(upload_to=business_directory_path) | ||
created = models.DateTimeField() | ||
updated = models.DateTimeField() | ||
|
||
class Meta: | ||
verbose_name_plural = "Businesses" | ||
|
||
def __str__(self): | ||
return str(self.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from rest_framework import serializers | ||
|
||
from .models import Client, Business | ||
|
||
class ClientSerializer(serializers.ModelSerializer): | ||
# first_name = serializers.CharField() | ||
|
||
class Meta: | ||
model = Client | ||
fields = ['id', 'photo', 'first_name', 'last_name', 'birthday', 'city', 'state'] | ||
|
||
class BusinessSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Business | ||
fields = ['id', 'photo', 'name', 'email', 'city', 'state'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.urls import path | ||
|
||
from . import views | ||
|
||
urlpatterns = [ | ||
path('test/', views.Test.as_view()), | ||
path('client/create/', views.CreateClient.as_view()), | ||
path('login/', views.Login.as_view()), | ||
path('business/create/', views.CreateBusiness.as_view()), | ||
path('photo_uploader/', views.UserAvatarUploader.as_view()) | ||
] |
Oops, something went wrong.