16 |
17 |
--------------------------------------------------------------------------------
/app/user/user_schema.py:
--------------------------------------------------------------------------------
1 | from datetime import date
2 |
3 | from pydantic import BaseModel, EmailStr
4 |
5 |
6 | class UserCreate(BaseModel):
7 | userid: EmailStr
8 | password: str
9 | fullname: str
10 | birthdate: date
11 |
12 | class Config:
13 | from_attributes = True
14 |
15 |
16 | class UserEdit(BaseModel):
17 | password: str = None
18 | fullname: str = None
19 | birthdate: date = None
20 |
21 |
22 | class User(BaseModel):
23 | id: int
24 | userid: EmailStr
25 | fullname: str
26 | birthdate: date
27 |
28 |
29 | class UserLogin(BaseModel):
30 | userid: str
31 | password: str
32 |
--------------------------------------------------------------------------------
/app/statement/statement_model.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy import Column, Integer, String, DateTime
2 |
3 | from app.database.db import Base
4 |
5 |
6 | class Statement(Base):
7 | __tablename__ = "statement"
8 |
9 | id = Column(Integer, primary_key=True, index=True, autoincrement=True)
10 | description = Column(String, unique=False)
11 | type = Column(String, nullable=False)
12 | created_at = Column(DateTime, nullable=False)
13 | amount = Column(String, nullable=False)
14 | to_user = Column(String, nullable=False)
15 | from_user = Column(String, nullable=False)
16 | bank_name = Column(String, nullable=False)
17 | authentication = Column(String, nullable=False)
18 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/app/home/home_routes.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from dotenv import load_dotenv
4 | from fastapi import APIRouter, status
5 | from fastapi.responses import JSONResponse
6 | from fastapi.responses import RedirectResponse
7 |
8 | load_dotenv()
9 | router = APIRouter()
10 |
11 |
12 | @router.get("/")
13 | def redirect_to_docs():
14 | response = RedirectResponse(url='/docs')
15 | return response
16 |
17 |
18 | @router.get("/health-check")
19 | def health_check():
20 | return JSONResponse(
21 | content={"status": "ok"},
22 | status_code=status.HTTP_200_OK
23 | )
24 |
25 |
26 | @router.get("/version")
27 | def health_check():
28 | return JSONResponse(
29 | content={"version": os.getenv("VERSION")},
30 | status_code=status.HTTP_200_OK
31 | )
32 |
--------------------------------------------------------------------------------
/app/user/user_model.py:
--------------------------------------------------------------------------------
1 | from passlib.context import CryptContext
2 | from sqlalchemy import Column, Integer, String, Date
3 |
4 | from app.database.db import Base
5 |
6 | pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
7 |
8 |
9 | class User(Base):
10 | __tablename__ = "users"
11 |
12 | id = Column(Integer, primary_key=True, index=True, autoincrement=True)
13 | userid = Column(String, unique=True, index=True)
14 | fullname = Column(String, nullable=False)
15 | birthdate = Column(Date, nullable=False)
16 | hashed_password = Column(String)
17 |
18 | def verify_password(self, password):
19 | return pwd_context.verify(password, self.hashed_password)
20 |
21 | def hash_password(self, password):
22 | self.hashed_password = pwd_context.hash(password)
23 |
--------------------------------------------------------------------------------
/app/dependencies/current_user.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | import jwt
4 | from dotenv import load_dotenv
5 | from fastapi import HTTPException, Security
6 | from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
7 | from jwt import PyJWTError
8 |
9 | load_dotenv()
10 | security = HTTPBearer()
11 |
12 | credentials_exception = HTTPException(
13 | status_code=401,
14 | detail="Could not validate credentials",
15 | headers={"WWW-Authenticate": "Bearer"},
16 | )
17 |
18 |
19 | def get_current_user(authorization: HTTPAuthorizationCredentials = Security(security)):
20 | token = authorization.credentials
21 | try:
22 | payload = jwt.decode(token, os.getenv("SECRET"), algorithms=[os.getenv("ALGORITHM")])
23 | user_id = payload.get("sub")
24 |
25 | if user_id is None:
26 | raise credentials_exception
27 | return user_id
28 | except PyJWTError:
29 | raise credentials_exception
30 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ------- | ------------------ |
10 | | 1.1.0 | :x: |
11 | | 1.1.1 | :white_check_mark: |
12 |
15 |
16 | ## Reporting a Vulnerability
17 |
18 | Use this section to tell people how to report a vulnerability.
19 |
20 | Tell them where to go, how often they can expect to get an update on a
21 | reported vulnerability, what to expect if the vulnerability is accepted or
22 | declined, etc.
23 |
24 | ## fastapi
25 |
26 | Original Report
27 |
28 | This was originally reported to FastAPI as an email to security@tiangolo.com, sent via https://huntr.com/, the original reporter is Marcello, https://github.com/byt3bl33d3r
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/workflows/python-tests.yml:
--------------------------------------------------------------------------------
1 | name: Python 3.11 Tests with Coverage
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | pull_request:
7 | branches: [ main ]
8 |
9 | jobs:
10 | test:
11 |
12 | runs-on: ubuntu-latest
13 | strategy:
14 | matrix:
15 | python-version: [3.11]
16 |
17 | steps:
18 | - name: Checkout repository
19 | uses: actions/checkout@v2
20 |
21 | - name: Set up Python ${{ matrix.python-version }}
22 | uses: actions/setup-python@v3
23 | with:
24 | python-version: ${{ matrix.python-version }}
25 |
26 | - name: Install dependencies
27 | run: |
28 | python -m pip install --upgrade pip
29 | pip install -r requirements_for_dev.txt
30 |
31 | - name: Run tests with coverage
32 | run: |
33 | pytest --cov=app --cov-report=xml --cov-report=term
34 |
35 | - name: Upload coverage reports to Codecov
36 | uses: codecov/codecov-action@v3
37 | env:
38 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
39 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:3.11-slim
2 |
3 | # Use a imagem oficial do Python 3.11 em sua versão slim
4 | FROM python:3.11-slim
5 |
6 | # Defina uma variável de ambiente para garantir que a saída python seja enviada diretamente para o terminal sem buffering
7 | ENV PYTHONUNBUFFERED=1
8 |
9 | # Defina o diretório de trabalho dentro do container
10 | WORKDIR /code
11 |
12 | # Copie o Pipfile e Pipfile.lock (se estiver usando Pipenv) ou requirements.txt para o diretório de trabalho
13 |
14 | COPY ./requirements.txt /code/requirements.txt
15 |
16 | # Instale as dependências
17 | RUN pip install --upgrade pip && \
18 | pip install --no-cache-dir --upgrade -r requirements.txt
19 |
20 | # Copie o restante do código do projeto para o diretório de trabalho
21 | COPY ./app /code/app
22 |
23 | # Expõe a porta em que sua aplicação irá rodar. Por padrão, FastAPI usa a porta 8000.
24 | EXPOSE 8000
25 |
26 | # Comando para rodar a aplicação. Ajuste conforme a forma que você roda sua aplicação.
27 | CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000"]
--------------------------------------------------------------------------------
/.github/workflows/deploy_prod.yml:
--------------------------------------------------------------------------------
1 | name: Deploy Production
2 |
3 | on:
4 | push:
5 | branches: [ release ]
6 |
7 | jobs:
8 | deploy:
9 | runs-on: ubuntu-latest
10 |
11 | steps:
12 | - name: Checkout repository
13 | uses: actions/checkout@v2
14 |
15 | - name: Set up SSH
16 | run: |
17 | mkdir -p ~/.ssh
18 | echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
19 | chmod 600 ~/.ssh/id_rsa
20 | ssh-keyscan ${{ secrets.PROD_DEPLOY_DOMAIN }} >> ~/.ssh/known_hosts
21 |
22 | - name: Deploy to PythonAnywhere
23 | env:
24 | PA_USER: ${{ secrets.PROD_DEPLOY_USERNAME }}
25 | PA_HOST: ${{ secrets.PROD_DEPLOY_DOMAIN }}
26 | PROJECT_PATH: ${{ secrets.PROD_PROJECT_FOLDER }}
27 | run: |
28 | ssh $PA_USER@$PA_HOST "cd $PROJECT_PATH && git pull origin release"
29 |
30 | - uses: jensvog/pythonanywhere-webapp-reload-action@v1
31 | with:
32 | host: ${{ secrets.PROD_DEPLOY_HOST }}
33 | username: ${{ secrets.PROD_DEPLOY_USERNAME }}
34 | api-token: ${{ secrets.PROD_DEPLOY_TOKEN }}
35 | domain-name: ${{ secrets.PROD_DEPLOY_DOMAIN }}
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Michel Anderson Lütz Teixeira
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend4.md:
--------------------------------------------------------------------------------
1 | # Front-end Developer Technical Challenge 4 - Dashboard
2 |
3 | ## Objective:
4 |
5 | Creation of a dashboard with a side menu with the following items:
6 |
7 | - Home
8 | - Statements
9 | - Profile
10 |
11 | *Optionals (Api under development for the items below)*
12 |
13 | - Setting
14 | - Notification
15 | - Logout
16 |
17 | ## Specifications:
18 |
19 | ### Figma
20 |
21 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=13-3891&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
22 |
23 | 
24 |
25 | ### 1. Home
26 |
27 | - The home page should contain a welcome message
28 |
29 | ### 2. Statements
30 |
31 | Now this page is a blank page in next challenge you will create a list of statements.
32 |
33 | ### 3. Profile
34 |
35 | Now this page is a blank page in next challenge you will create a profile page for edit user information.
36 |
37 | ### Bonus:
38 |
39 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
40 |
41 | ## Final Considerations:
42 |
43 | - Your user interface should not only be functional but also intuitive and user-friendly.
--------------------------------------------------------------------------------
/app/authentication/auth_routes.py:
--------------------------------------------------------------------------------
1 | import os
2 | from datetime import timedelta, datetime
3 |
4 | from dotenv import load_dotenv
5 | from fastapi import APIRouter, Depends, HTTPException, status
6 | from jose import jwt
7 | from sqlalchemy.orm import Session
8 |
9 | from app.authentication.jwt_schema import Token
10 | from app.database.db import SessionLocal
11 | from app.user.user_model import User
12 | from app.user.user_schema import UserLogin
13 |
14 | load_dotenv()
15 | router = APIRouter()
16 |
17 |
18 | # Dependency
19 | def get_db():
20 | db = SessionLocal()
21 | try:
22 | yield db
23 | finally:
24 | db.close()
25 |
26 |
27 | def create_access_token(data: dict):
28 | to_encode = data.copy()
29 | expire = datetime.utcnow() + timedelta(minutes=int(os.getenv("TOKEN_EXPIRES")))
30 | to_encode.update({"exp": expire})
31 | encoded_jwt = jwt.encode(to_encode, os.getenv("SECRET"), algorithm=os.getenv("ALGORITHM"))
32 | return encoded_jwt
33 |
34 |
35 | @router.post("/auth/", response_model=Token)
36 | def login_for_access_token(form_data: UserLogin, db: Session = Depends(get_db)):
37 | user = db.query(User).filter(User.userid == form_data.userid).first()
38 | if not user or not user.verify_password(form_data.password):
39 | raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Incorrect username or password")
40 |
41 | access_token = create_access_token(data={"sub": user.userid})
42 | return {"access_token": access_token, "token_type": "bearer"}
--------------------------------------------------------------------------------
/readme_files/challenge_frontend_mobile3.md:
--------------------------------------------------------------------------------
1 | # Mobile Developer Technical Challenge 3 - Dashboard and Side Menu
2 |
3 | ## Objective:
4 |
5 | Creation of a dashboard with a side menu with the following items:
6 |
7 | - Home
8 | - Statements
9 | - Profile
10 |
11 | *Optionals (Api under development for the items below)*
12 |
13 | - Setting
14 | - Notification
15 | - Logout
16 |
17 | ## Specifications:
18 |
19 | ### Figma
20 |
21 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=13-4267&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
22 |
23 |
24 | | Home | Side Menu |
25 | |-----------------------|-------------------------|
26 | |  |  |
27 |
28 |
29 | ### 1. Home
30 |
31 | - The home page should contain a welcome message
32 |
33 | ### 2. Statements
34 |
35 | Now this page is a blank page in next challenge you will create a list of statements.
36 |
37 | ### 3. Profile
38 |
39 | Now this page is a blank page in next challenge you will create a profile page for edit user information.
40 |
41 | ### Bonus:
42 |
43 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
44 |
45 | ## Final Considerations:
46 |
47 | - Your user interface should not only be functional but also intuitive and user-friendly.
--------------------------------------------------------------------------------
/app/main.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from dotenv import load_dotenv
4 | from fastapi import FastAPI
5 | from fastapi.middleware.cors import CORSMiddleware
6 |
7 | # Importing routes
8 | from app.authentication import auth_routes
9 | from app.balance import balance_routes
10 | from app.contact import contact_routes
11 | from app.database.db import engine, Base
12 | from app.home import home_routes
13 | from app.statement import statement_routes
14 | from app.user import user_routes
15 |
16 | logging.basicConfig(level=logging.INFO)
17 | logger = logging.getLogger(__name__)
18 |
19 | load_dotenv() # Carrega as variáveis de ambiente do arquivo .env
20 | app = FastAPI()
21 |
22 |
23 | # print(os.getenv("PROJECT_NAME"))
24 |
25 | # title=config("PROJECT_NAME")
26 | # CORS
27 | app.add_middleware(
28 | CORSMiddleware,
29 | allow_origins=["*"], # Allows any origin. Don't do this in production!
30 | allow_credentials=True,
31 | allow_methods=["*"], # Allows all methods
32 | allow_headers=["*"],
33 | )
34 |
35 | def init_db():
36 | try:
37 | Base.metadata.create_all(bind=engine)
38 | logging.info("Database initialized successfully.")
39 | except Exception as e:
40 | logging.error(f"Error initializing the database: {e}")
41 |
42 |
43 | @app.on_event("startup")
44 | async def startup_event():
45 | init_db()
46 |
47 | app.include_router(auth_routes.router, tags=["authentication"])
48 | app.include_router(home_routes.router, tags=["home"])
49 | app.include_router(user_routes.router, tags=["users"])
50 | app.include_router(statement_routes.router, tags=["statement"])
51 | app.include_router(balance_routes.router, tags=["balance"])
52 | app.include_router(contact_routes.router, tags=["contact"])
53 |
--------------------------------------------------------------------------------
/readme_files/challenge_backend6.md:
--------------------------------------------------------------------------------
1 | # Back-end Developer Technical Challenge 6 - Profile edit
2 |
3 | ## Objective:
4 |
5 | Its main objective is to design and implement a logical back-end to support a front-end interface that presents user registration data and allows editing and saving of this data. Easily add and configure API routes, manipulate data, and ensure the authentication process works as expected.
6 |
7 | You are expected to create this backend in your preferred language/framework.
8 |
9 |
10 | ## Specifications:
11 |
12 | **PUT**: `/users/{user_id}`
13 |
14 | ### Edit User Profile:
15 |
16 | - The route should expect a PUT request with a JSON body formatted as:
17 |
18 | ```json
19 | {
20 | "password": "string",
21 | "fullname": "string",
22 | "birthdate": "2024-01-02"
23 | }
24 | ```
25 |
26 | ## Validations:
27 |
28 | - The Route shoul be authenticated if not user should receive a status code of 401 unauthorized, with the following message:
29 |
30 | ```json
31 | {
32 | "detail": "Not authenticated"
33 | }
34 | ```
35 |
36 | ### API Documentation
37 |
38 | - As a bonus, provide Swagger documentation for the `/users/{user_id}` route, offering insights into its expected input, output, and behavior.
39 |
40 | ### Unit Testing:
41 |
42 | - Integrate unit tests to ensure the reliability of the route under various scenarios. Tests should cover, at a minimum:
43 | - Successful user login.
44 | - Validation failures (incorrect email format, invalid date, etc.).
45 | - Proper password hashing and retrieval.
46 |
47 |
48 | ## Final Considerations:
49 |
50 | - Prioritize best practices concerning code structure, error handling, security, and scalability.
51 | - Make sure to handle potential database errors or conflicts, such as duplicate email addresses.
52 |
53 | Embarking on challenges like this offers a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
54 |
55 |
--------------------------------------------------------------------------------
/readme_files/challenge_backend1.md:
--------------------------------------------------------------------------------
1 | # Back-end Developer Technical Challenge 1
2 |
3 | ## Objective:
4 | Your task is to design and implement a route named create_contact in your preferred back-end language/framework. This route will handle the reception and processing of contact information sent via a POST request.
5 |
6 | ## Specifications:
7 |
8 | ### 1. Endpoint:
9 |
10 | - Develop an endpoint named /create_contact.
11 |
12 | ### 2. Input:
13 |
14 | - The route should expect a POST request with a JSON body formatted as:
15 |
16 | ```json
17 | {
18 | "nome": "User's Name",
19 | "email": "email@example.com",
20 | "message": "Message sent by the user",
21 | "interest": "Interest indicated by the user"
22 | }
23 | ```
24 |
25 | ### 3. Output:
26 |
27 | - After successfully processing the input data, the endpoint should return a status code of `200 OK`.
28 | - Additionally, it should provide a JSON response in the following format:
29 |
30 | ```json
31 | {
32 | "msg": "Thank [contact.name], for getting in touch and sharing your interests. We look forward to hearing from you soon."
33 | }
34 | ```
35 |
36 | ### Additional Points (Bonus):
37 |
38 | - As a distinguishing feature, integrate a Swagger documentation for the `create_contact` route, outlining its expected input, output, and behavior. This would not only demonstrate your proficiency with modern API documentation standards but would also offer a clear interface for front-end developers and other consumers of your API.
39 |
40 |
41 | ## Final Considerations:
42 |
43 | - Ensure your solution adheres to best practices in terms of code structure, error handling, and security.
44 | - Thoroughly test the route to guarantee its reliability under different scenarios.
45 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
46 |
47 | We wish you the best with this challenge and eagerly await your solution!
--------------------------------------------------------------------------------
/app/user/user_routes.py:
--------------------------------------------------------------------------------
1 | from fastapi import APIRouter, Depends, HTTPException, status
2 | from fastapi.responses import JSONResponse
3 | from sqlalchemy.orm import Session
4 |
5 | from app.database.db import SessionLocal
6 | from app.dependencies.current_user import get_current_user
7 | from app.user.user_model import User
8 | from app.user.user_schema import UserCreate, UserEdit
9 |
10 | router = APIRouter()
11 |
12 |
13 | # Dependency
14 | def get_db():
15 | db = SessionLocal()
16 | try:
17 | yield db
18 | finally:
19 | db.close()
20 |
21 |
22 | # Create a new user
23 | @router.post("/users/", status_code=201)
24 | def create_user(user: UserCreate, db: Session = Depends(get_db)):
25 | db_user = db.query(User).filter(User.userid == user.userid).first()
26 | if db_user:
27 | raise HTTPException(status_code=400, detail="Username already registered")
28 |
29 | new_user = User(userid=user.userid)
30 | new_user.hash_password(user.password)
31 | new_user.fullname = user.fullname
32 | new_user.birthdate = user.birthdate
33 |
34 | db.add(new_user)
35 | db.commit()
36 | db.refresh(new_user)
37 | return JSONResponse(
38 | content={'msg': 'success'},
39 | status_code=status.HTTP_201_CREATED
40 | )
41 |
42 |
43 | @router.put("/users/{user_id}", response_model=UserEdit)
44 | def update_user(user_id: int, user_edit: UserEdit, db: Session = Depends(get_db), _: str = Depends(get_current_user)):
45 | db_user = db.query(User).filter(User.id == user_id).first()
46 | if not db_user:
47 | raise HTTPException(status_code=404, detail="User not found")
48 |
49 | if user_edit.password:
50 | db_user.hash_password(user_edit.password)
51 | if user_edit.fullname:
52 | db_user.fullname = user_edit.fullname
53 | if user_edit.birthdate:
54 | db_user.birthdate = user_edit.birthdate
55 |
56 | db.commit()
57 | db.refresh(db_user)
58 | return db_user
59 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend1.md:
--------------------------------------------------------------------------------
1 | # Front-end Developer Technical Challenge 1
2 |
3 | ## Objective:
4 |
5 | Implement a graphical user interface that allows users to submit contact information through a form. The interface should be developed in your preferred language/framework and will be used to communicate with a REST API.
6 |
7 | ## Specifications:
8 |
9 | ### 1. Contact Form:
10 | - The interface should include a form with the following fields:
11 | - Name (text field)
12 | - Email (text field with email format validation)
13 | - Message (multiline text field)
14 | - Interest (text field)
15 | The form should have a submit button to send the information.
16 |
17 |
18 | ### 2. API Communication:
19 |
20 | - Upon form submission, make a POST request to the API at the following endpoint: /contact/.
21 | - The request body should adhere to the following JSON format:
22 |
23 | ```json
24 | {
25 | "nome": "User's Name",
26 | "email": "email@example.com",
27 | "message": "Message sent by the user",
28 | "interest": "Interest indicated by the user"
29 | }
30 | ```
31 |
32 | - Handle any potential errors that might occur during communication with the API and provide suitable user feedback.
33 |
34 | ### 3. API Documentation
35 |
36 | - Comprehensive API documentation can be found at: http://localhost/docs#/contact. Use it to familiarize yourself with the request details and possible API responses.
37 |
38 | ### 4. Show response to user
39 |
40 | - After sending the data to the API, show the user the response received from the API.
41 |
42 | ## Final Considerations:
43 |
44 | - We value creativity, so feel free to design an intuitive and appealing interface.
45 | - Your code implementation should be clean, well-organized, and adhere to best development practices.
46 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
47 |
48 | We wish you the best with the challenge! We're looking forward to seeing your solution!
49 |
--------------------------------------------------------------------------------
/app/balance/balance_routes.py:
--------------------------------------------------------------------------------
1 | from fastapi import APIRouter, Depends
2 | from sqlalchemy.orm import Session
3 |
4 | from app.balance.balance_schema import Balance
5 | from app.database.db import SessionLocal
6 | from app.dependencies.current_user import get_current_user
7 | from app.statement.statement_model import Statement
8 |
9 | router = APIRouter()
10 |
11 | # Dependency
12 | def get_db():
13 | db = SessionLocal()
14 | try:
15 | yield db
16 | finally:
17 | db.close()
18 |
19 |
20 | @router.get("/balance/", response_model=Balance, description="""
21 | This route returns the calculated balance of all transactions for a user.
22 |
23 | - Rule for **Deposit**: If the user deposits from_user == to_user, the amount is added to the balance.
24 | - Rule for **Deposit**: If the user deposits from_user != to_user, the amount is added to the balance.
25 | - Rule for **Withdrawal**: If the user withdraws from their own account, the amount is subtracted from the balance.
26 | - Rule for **Transfer**: If the user transfers to their own account (to_user == from_user), the amount is added to the balance.
27 | - Rule for **Transfer**: If the user transfers to another account (to_user != from_user), the amount is subtracted from the balance.
28 | """)
29 | def get_calculated_balance(db: Session = Depends(get_db), _: str = Depends(get_current_user)):
30 | statements = db.query(Statement).all()
31 |
32 | amount = 0
33 |
34 | for stmt in statements:
35 | if (stmt.type == "Deposit" and stmt.to_user == stmt.from_user
36 | or stmt.type == "Deposit" and stmt.to_user != stmt.from_user):
37 | amount += float(stmt.amount)
38 | elif stmt.type == "Withdrawal":
39 | amount -= float(stmt.amount)
40 | elif stmt.type == "Transfer":
41 | if stmt.to_user == stmt.from_user:
42 | amount += float(stmt.amount)
43 | elif stmt.from_user != stmt.to_user:
44 | amount -= float(stmt.amount)
45 |
46 | return Balance(amount=amount)
--------------------------------------------------------------------------------
/readme_files/challenge_frontend6.md:
--------------------------------------------------------------------------------
1 | # Front-end Developer Technical Challenge 6 - Edit Profile information
2 |
3 | Its main mission is to design and implement a screen that displays user registration data and allows editing and saving this data.
4 |
5 | You are expected to create this interface in your preferred language/framework.
6 |
7 | ### Figma
8 |
9 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=19-3597&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
10 |
11 | 
12 |
13 | ## Specifications:
14 |
15 | **PUT**: `/users/{user_id}`
16 |
17 | ### Edit User Profile:
18 |
19 | - The route should expect a PUT request with a JSON body formatted as:
20 |
21 | ```json
22 | {
23 | "password": "string",
24 | "fullname": "string",
25 | "birthdate": "2024-01-02"
26 | }
27 | ```
28 |
29 | > At this moment, the api does not yet support other image fields and image uploading. We will soon be evolving it. Feel free to contribute.
30 |
31 |
32 | ## Validations:
33 |
34 | - The Route is authenticated, so it is necessary to send the token, otherwise the user will receive a 401 unauthorized status code, with the following message:
35 |
36 | ```json
37 | {
38 | "detail": "Not authenticated"
39 | }
40 | ```
41 |
42 | ### Bonus:
43 |
44 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
45 |
46 | ## Final Considerations:
47 |
48 | - Your user interface should not only be functional but also intuitive and user-friendly.
49 | - The design should take into account both aesthetics and usability.
50 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
51 |
52 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
53 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend_mobile5.md:
--------------------------------------------------------------------------------
1 | # Mobile Developer Technical Challenge 5 - Edit Profile information
2 |
3 | Its main mission is to design and implement a screen that displays user registration data and allows editing and saving this data.
4 |
5 | You are expected to create this interface in your preferred language/framework.
6 |
7 | ### Figma
8 |
9 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=19-4040&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
10 |
11 | 
12 |
13 | ## Specifications:
14 |
15 | **PUT**: `/users/{user_id}`
16 |
17 | ### Edit User Profile:
18 |
19 | - The route should expect a PUT request with a JSON body formatted as:
20 |
21 | ```json
22 | {
23 | "password": "string",
24 | "fullname": "string",
25 | "birthdate": "2024-01-02"
26 | }
27 | ```
28 |
29 | > At this moment, the api does not yet support other image fields and image uploading. We will soon be evolving it. Feel free to contribute.
30 |
31 |
32 | ## Validations:
33 |
34 | - The Route is authenticated, so it is necessary to send the token, otherwise the user will receive a 401 unauthorized status code, with the following message:
35 |
36 | ```json
37 | {
38 | "detail": "Not authenticated"
39 | }
40 | ```
41 |
42 | ### Bonus:
43 |
44 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
45 |
46 | ## Final Considerations:
47 |
48 | - Your user interface should not only be functional but also intuitive and user-friendly.
49 | - The design should take into account both aesthetics and usability.
50 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
51 |
52 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
53 |
--------------------------------------------------------------------------------
/readme_files/challenge_backend3.md:
--------------------------------------------------------------------------------
1 | # Back-end Developer Technical Challenge 3
2 |
3 | ## Objective:
4 |
5 | Its main objective is to design and implement the back-end logic to support the front-end interface form for user login. Continuing the previous challenge where a user was registered. This includes configuring the required API routes, handling data, and ensuring that the authentication process works as expected.
6 |
7 | ## Specifications:
8 |
9 | ### Validate User Credentials:
10 |
11 | - The route should expect a POST request with a JSON body formatted as:
12 |
13 | ```json
14 | {
15 | "userid": "john.doe@email.com",
16 | "password": "string"
17 | }
18 | ```
19 |
20 | ### Create JWT Token:
21 |
22 | Your route must expect a user id (e-mail) and a password, a **jwt** encode with **secret** must be performed, use the **HS256** algorithm for the token and expire in **30 min**
23 |
24 | ### Response:
25 |
26 | - After successfully processing the input data and storing the user information, the endpoint should return a status code of 200 OK. With JSON token:
27 |
28 | ```json
29 | {
30 | "access_token": "string",
31 | "token_type": "string"
32 | }
33 | ```
34 |
35 | - If the user is not found, return a status code of 401 unauthorized, with the following message:
36 |
37 |
38 | ```json
39 | {
40 | "detail": "Incorrect username or password"
41 | }
42 | ```
43 |
44 | ### API Documentation
45 |
46 | - As a bonus, provide Swagger documentation for the `auth` route, offering insights into its expected input, output, and behavior.
47 |
48 | ### Unit Testing:
49 |
50 | - Integrate unit tests to ensure the reliability of the route under various scenarios. Tests should cover, at a minimum:
51 | - Successful user login.
52 | - Validation failures (incorrect email format, invalid date, etc.).
53 | - Proper password hashing and retrieval.
54 |
55 |
56 | ## Final Considerations:
57 |
58 | - Prioritize best practices concerning code structure, error handling, security, and scalability.
59 | - Make sure to handle potential database errors or conflicts, such as duplicate email addresses.
60 |
61 | Embarking on challenges like this offers a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
62 |
63 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend2.md:
--------------------------------------------------------------------------------
1 | # Front-end Developer Technical Challenge 2
2 |
3 | ## Objective:
4 | Your primary mission is to design and implement a user-friendly interface that interacts with the `users` route for user registration. You are expected to craft this interface in your preferred language/framework.
5 |
6 | ## Specifications:
7 |
8 | ### Figma
9 |
10 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=1%3A655&mode=design&t=aSjbTNYsb0UGO0yp-1) to follow the style guide and components in your interfaces.
11 |
12 | 
13 |
14 | ### 1. User Registration Form:
15 |
16 | - Your interface should provide a registration form containing the following fields:
17 | - User ID (to be filled with an email): userid
18 | - Password: password
19 | - Full Name: fullname
20 | - Birthdate: birthdate
21 |
22 | The form structure should closely align with this JSON model:
23 |
24 | ```json
25 | {
26 | "userid": "user@example.com",
27 | "password": "string",
28 | "fullname": "string",
29 | "birthdate": "2023-09-22"
30 | }
31 | ```
32 |
33 | ### 2. API Communication:
34 |
35 | - To gain a better understanding of the request details and expected API responses, you are encouraged to refer to the comprehensive API documentation available at: [http://localhost:8000/docs#/users/create_user_users__post](http://localhost:8000/docs#/users/create_user_users__post).
36 |
37 | ### Bonus:
38 |
39 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
40 |
41 | ## Final Considerations:
42 |
43 | - Your user interface should not only be functional but also intuitive and user-friendly.
44 | - The design should take into account both aesthetics and usability.
45 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
46 |
47 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
48 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend_mobile1.md:
--------------------------------------------------------------------------------
1 | ## Objective:
2 |
3 | Your primary mission is to design and implement a user-friendly interface that interacts with the `users` route for user registration. You are expected to craft this interface in your preferred language/framework.
4 |
5 | ## Specifications:
6 |
7 | ### Figma
8 |
9 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=1%3A655&mode=design&t=aSjbTNYsb0UGO0yp-1) to follow the style guide and components in your interfaces.
10 |
11 | 
12 |
13 | ### 1. User Registration Form:
14 |
15 | - Your interface should provide a registration form containing the following fields:
16 | - User ID (to be filled with an email): userid
17 | - Password: password
18 | - Full Name: fullname
19 | - Birthdate: birthdate
20 |
21 | The form structure should closely align with this JSON model:
22 |
23 | ```json
24 | {
25 | "userid": "user@example.com",
26 | "password": "string",
27 | "fullname": "string",
28 | "birthdate": "2023-09-22"
29 | }
30 | ```
31 |
32 | ### 2. API Communication:
33 |
34 | - To gain a better understanding of the request details and expected API responses, you are encouraged to refer to the comprehensive API documentation available at: [http://localhost:8000/docs#/users/create_user_users__post](http://localhost:8000/docs#/users/create_user_users__post).
35 |
36 | [Online API Doc](https://dev-challenge.micheltlutz.me/docs)
37 |
38 |
39 | ### Bonus:
40 |
41 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
42 |
43 | ## Final Considerations:
44 |
45 | - Your user interface should not only be functional but also intuitive and user-friendly.
46 | - The design should take into account both aesthetics and usability.
47 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
48 |
49 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
50 |
--------------------------------------------------------------------------------
/readme_files/challenge_backend5.md:
--------------------------------------------------------------------------------
1 | # Back-end Developer Technical Challenge 5 - Balance (Amout Value)
2 |
3 | ## Objective:
4 |
5 | Its main objective is to design and implement back-end logic to support the front-end interface presenting the bank balance(amount) following the specific business rules below. This includes configuring API routes, manipulating data, and ensuring the authentication process works as expected. Easily add and configure API routes, manipulate data, and ensure the authentication process works as expected.
6 |
7 |
8 | ## Business rules from statements values:
9 |
10 | > You should consider the following rules for the values of the statements to build amount:
11 |
12 | - Rule for **Deposit**: If the user deposits from_user == to_user, the amount is added to the balance.
13 | - Rule for **Deposit**: If the user deposits from_user != to_user, the amount is added to the balance.
14 | - Rule for **Withdrawal**: If the user withdraws from their own account, the amount is subtracted from the balance.
15 | - Rule for **Transfer**: If the user transfers to their own account (to_user == from_user), the amount is added to the balance.
16 | - Rule for **Transfer**: If the user transfers to another account (to_user != from_user), the amount is subtracted from the balance.
17 |
18 |
19 | **GET:** `/balance/`
20 |
21 | ## Response:
22 |
23 | ```json
24 | {
25 | "amount": 13512.590000000002
26 | }
27 | ```
28 |
29 | ## Validations:
30 |
31 | - The Route shoul be authenticated if not user should receive a status code of 401 unauthorized, with the following message:
32 |
33 | ```json
34 | {
35 | "detail": "Not authenticated"
36 | }
37 | ```
38 |
39 | ### API Documentation
40 |
41 | - As a bonus, provide Swagger documentation for the `balance` route, offering insights into its expected input, output, and behavior.
42 |
43 | ### Unit Testing:
44 |
45 | - Integrate unit tests to ensure the reliability of the route under various scenarios. Tests should cover, at a minimum:
46 | - Successful user login.
47 | - Validation failures (incorrect email format, invalid date, etc.).
48 | - Proper password hashing and retrieval.
49 |
50 |
51 | ## Final Considerations:
52 |
53 | - Prioritize best practices concerning code structure, error handling, security, and scalability.
54 | - Make sure to handle potential database errors or conflicts, such as duplicate email addresses.
55 |
56 | Embarking on challenges like this offers a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
57 |
58 |
--------------------------------------------------------------------------------
/readme_files/challenge_backend2.md:
--------------------------------------------------------------------------------
1 | # Back-end Developer Technical Challenge 2
2 |
3 | ## Objective:
4 |
5 | Your primary mission is to design and implement a backend route named create_user for user registration. This route will handle the reception and processing of user data sent via a POST request. The solution should be crafted using your preferred back-end language/framework.
6 |
7 | ## Specifications:
8 |
9 | ### 1. Endpoint:
10 |
11 | - Develop an endpoint named /create_user.
12 |
13 | ### 2. Input:
14 |
15 | - The route should expect a POST request with a JSON body formatted as:
16 |
17 | ```json
18 | {
19 | "userid": "user@example.com",
20 | "password": "string",
21 | "fullname": "string",
22 | "birthdate": "2023-09-22"
23 | }
24 | ```
25 |
26 | ### 3. Database Integration:
27 |
28 | - Implement database integration using SQLite.
29 | - Successfully processed user data should be stored persistently in the SQLite database.
30 |
31 | ### 4. Field Validations & Security:
32 |
33 | - Ensure that the `userid` field is validated for a correct email format.
34 | - Ensure that the `birthdate` field strictly adheres to the date format as specified in the JSON model above.
35 | - Passwords must be stored securely.
36 | - Use password hashing techniques before storing the password in the database.
37 | - We suggest using `bcrypt` for password hashing.
38 |
39 | ### 5. Output:
40 |
41 | - After successfully processing the input data and storing the user information, the endpoint should return a status code of 201 Created.
42 | - The response should contain a confirmation message, for example:
43 |
44 | ```json
45 | {
46 | "msg": "User created successfully"
47 | }
48 | ```
49 |
50 | ### 6. API Documentation
51 |
52 | - As a bonus, provide Swagger documentation for the `create_user` route, offering insights into its expected input, output, and behavior.
53 |
54 | ### 7. Unit Testing:
55 |
56 | - Integrate unit tests to ensure the reliability of the route under various scenarios. Tests should cover, at a minimum:
57 | - Successful user registration.
58 | - Validation failures (incorrect email format, invalid date, etc.).
59 | - Proper password hashing and retrieval.
60 |
61 | ## Final Considerations:
62 |
63 | - Prioritize best practices concerning code structure, error handling, security, and scalability.
64 | - Make sure to handle potential database errors or conflicts, such as duplicate email addresses.
65 |
66 | Embarking on challenges like this allows you to demonstrate both your technical knowledge and your problem-solving abilities. We eagerly await your innovative solution and wish you the best of luck!
--------------------------------------------------------------------------------
/readme_files/challenge_frontend3.md:
--------------------------------------------------------------------------------
1 | # Front-end Developer Technical Challenge 3
2 |
3 |
4 | ## Objective:
5 |
6 | Your primary mission is to design and implement a user-friendly interface form to user login interface that interacts with the `auth` route for user login. You are expected to craft this interface in your preferred language/framework.
7 |
8 | ## Specifications:
9 |
10 | ### Figma
11 |
12 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=1-655&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
13 |
14 | 
15 |
16 | ### 1. User Login Form:
17 |
18 | - Your interface should provide a login form containing the following fields:
19 | - User ID (to be filled with an email): userid
20 | - Password: password
21 |
22 | The form structure should closely align with this JSON model:
23 |
24 | ```json
25 | {
26 | "userid": "john.doe@email.com",
27 | "password": "string"
28 | }
29 | ```
30 |
31 | ### 2. API Communication:
32 |
33 | - To gain a better understanding of the request details and expected API responses, you are encouraged to refer to the comprehensive API documentation available at: [http://localhost/docs#/auth/login_auth__post](http://localhost/docs#/auth/login_auth__post).
34 | - The API will return a JSON object containing the access token and token type. You should store the access token in the browser's local storage for future requests.
35 | - The access token should be sent in the `Authorization` header of all future requests to the API.
36 | - The access token should be prefixed with the token type and a space, like this: `Bearer `
37 |
38 | **Response example**:
39 |
40 | ```json
41 | {
42 | "access_token": "access_token",
43 | "token_type": "bearer"
44 | }
45 | ```
46 |
47 | ### Bonus:
48 |
49 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
50 |
51 | ## Final Considerations:
52 |
53 | - Your user interface should not only be functional but also intuitive and user-friendly.
54 | - The design should take into account both aesthetics and usability.
55 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
56 |
57 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
58 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend_mobile2.md:
--------------------------------------------------------------------------------
1 | # Mobile Developer Technical Challenge 2
2 |
3 |
4 | ## Objective:
5 |
6 | Your primary mission is to design and implement a user-friendly interface form to user login interface that interacts with the `auth` route for user login. You are expected to craft this interface in your preferred language/framework.
7 |
8 | ## Specifications:
9 |
10 | ### Figma
11 |
12 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=1-731&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
13 |
14 | 
15 |
16 | ### 1. User Login Form:
17 |
18 | - Your interface should provide a login form containing the following fields:
19 | - User ID (to be filled with an email): userid
20 | - Password: password
21 |
22 | The form structure should closely align with this JSON model:
23 |
24 | ```json
25 | {
26 | "userid": "john.doe@email.com",
27 | "password": "string"
28 | }
29 | ```
30 |
31 | ### 2. API Communication:
32 |
33 | - To gain a better understanding of the request details and expected API responses, you are encouraged to refer to the comprehensive API documentation available at: [http://localhost/docs#/auth/login_auth__post](http://localhost/docs#/auth/login_auth__post).
34 | - The API will return a JSON object containing the access token and token type. You should store the access token in the browser's local storage for future requests.
35 | - The access token should be sent in the `Authorization` header of all future requests to the API.
36 | - The access token should be prefixed with the token type and a space, like this: `Bearer `
37 |
38 | **Response example**:
39 |
40 | ```json
41 | {
42 | "access_token": "access_token",
43 | "token_type": "bearer"
44 | }
45 | ```
46 |
47 | ### Bonus:
48 |
49 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
50 |
51 | ## Final Considerations:
52 |
53 | - Your user interface should not only be functional but also intuitive and user-friendly.
54 | - The design should take into account both aesthetics and usability.
55 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
56 |
57 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
58 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | [](https://codecov.io/gh/micheltlutz/dev-challenge)
3 | [](https://codebeat.co/projects/github-com-micheltlutz-dev-challenge-main)
4 |
5 |
6 | 
7 |
8 | # Development challenge
9 |
10 | This project aims to enrich the studies of professionals working in web, mobile, and back-end development by offering a series of practical challenges.
11 |
12 | For **Front-End Web** and **Mobile** developers, we provide [Figma](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=1%3A4&mode=design&t=1oLA9vtlXknWRtig-1) with screen flows, components, and a ready-to-use style guide to streamline the construction process and provide a development experience closer to reality.
13 | Additionally, the project includes an **API** ready for use, configured to run in a Docker environment or online, published by us. This API includes routes for listings, authentication, user creation, login, among other functionalities, allowing developers to focus primarily on design and interface implementation.
14 |
15 | For **back-end** developers, the challenge is to replicate the already developed routes in their preferred programming language and then produce relevant documentation.
16 |
17 | ### This **README** is currently divided into two parts:
18 |
19 | In Instructions for challengers you will find instructions for completing the challenge by creating an interface, whether web or mobile, for the routes existing in the project documentation and also challenges for creating the same routes using your preferred programming language.
20 | - [Instructions and challenges](readme_files/challenged.md)
21 |
22 | In Instructions for contributors you will find instructions to contribute to the project, whether to correct bugs or add new features.
23 | - [Instructions for contributors](readme_files/contributors.md)
24 |
25 |
26 | ## Acknowledgments:
27 |
28 | I would like to express my sincere gratitude to my friend and colleague [Aline Moraes](https://www.linkedin.com/in/alinegermanodemoraes/) for the excellent UI and UX work done for these challenges.
29 |
30 |
31 | ## Non-profit project:
32 |
33 | The entire development of this project was done voluntarily, with the purpose of supporting professionals interested in enhancing their skills. At no time should this project be used for commercial purposes. Use it to support your team, mentoring, and students, and if possible, make the proper references.
--------------------------------------------------------------------------------
/readme_files/challenge_backend4.md:
--------------------------------------------------------------------------------
1 | # Back-end Developer Technical Challenge 4 - Pagination Statements
2 |
3 | ## Objective:
4 |
5 | Its main objective is to design and implement the back-end logic to support the front-end interface for bank statement paging. This includes configuring the required API routes, handling data, and ensuring that the authentication process works as expected.
6 |
7 |
8 | ### Pagination:
9 |
10 | The route should receive two parameters, `limit` and `offset`, the `limit` parameter will be the number of statements to be returned and the `offset` parameter will be the number of statements to be skipped.
11 |
12 | **GET:** `/statements/{limit}/{offset}`
13 |
14 | ### Response:
15 |
16 | - After successfully processing the input data and check the auth information, the endpoint should return a status code of 200 OK. With JSON Statement list:
17 |
18 | ```json
19 | [
20 | {
21 | "type": "Deposit",
22 | "amount": "15000.00",
23 | "description": "Payment from Freela",
24 | "from_user": "John Doe",
25 | "authentication": "45d064afbd6cf24613daed52133320b84ece0e2cc751995a4d0b94fca84823dd",
26 | "id": 1,
27 | "created_at": "2023-09-21T18:46:45.478966",
28 | "to_user": "John Doe",
29 | "bank_name": "Adams LLC"
30 | },
31 | {
32 | "type": "Deposit",
33 | "amount": "88.81",
34 | "description": "Trip authority window myself hour.",
35 | "from_user": "Holly Bailey",
36 | "authentication": "0ef6dc8284c7908ce7af354b10b6f354ff355a201f8f54e22bd60d928a6670c8",
37 | "id": 2,
38 | "created_at": "2020-09-07T00:00:00",
39 | "to_user": "Caitlin Bennett",
40 | "bank_name": "Williams-Norris"
41 | }, ....
42 | ]
43 | ```
44 |
45 | ## Validations:
46 |
47 | - The Route shoul be authenticated if not user should receive a status code of 401 unauthorized, with the following message:
48 |
49 | ```json
50 | {
51 | "detail": "Not authenticated"
52 | }
53 | ```
54 |
55 | ### API Documentation
56 |
57 | - As a bonus, provide Swagger documentation for the `/statements/{limit}/{offset}` route, offering insights into its expected input, output, and behavior.
58 |
59 | ### Unit Testing:
60 |
61 | - Integrate unit tests to ensure the reliability of the route under various scenarios. Tests should cover, at a minimum:
62 | - Successful user login.
63 | - Validation failures (incorrect email format, invalid date, etc.).
64 | - Proper password hashing and retrieval.
65 |
66 |
67 | ## Final Considerations:
68 |
69 | - Prioritize best practices concerning code structure, error handling, security, and scalability.
70 | - Make sure to handle potential database errors or conflicts, such as duplicate email addresses.
71 |
72 | Embarking on challenges like this offers a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
73 |
74 |
--------------------------------------------------------------------------------
/app/statement/statement_routes.py:
--------------------------------------------------------------------------------
1 | import random
2 | from datetime import datetime
3 |
4 | from faker import Faker
5 | from fastapi import APIRouter, Depends, HTTPException, status
6 | from fastapi.responses import JSONResponse
7 | from sqlalchemy.orm import Session
8 |
9 | from app.database.db import SessionLocal
10 | from app.dependencies.current_user import get_current_user
11 | from app.statement.statement_model import Statement
12 | from app.statement.statement_schema import StatementCreate
13 |
14 | router = APIRouter()
15 | fake = Faker()
16 |
17 |
18 | # Dependency
19 | def get_db():
20 | db = SessionLocal()
21 | try:
22 | yield db
23 | finally:
24 | db.close()
25 |
26 |
27 | # Create a new statement
28 | @router.post("/statement/", status_code=201)
29 | def create_statement(statement: StatementCreate, db: Session = Depends(get_db), _: str = Depends(get_current_user)):
30 | # Criar o registro de statement
31 | db_statement = Statement(
32 | description=statement.description,
33 | type=statement.type,
34 | created_at=datetime.now(),
35 | amount=statement.amount,
36 | to_user=statement.to_user,
37 | from_user=statement.from_user,
38 | bank_name=statement.bank_name,
39 | authentication=statement.authentication
40 | )
41 |
42 | # Adicionar ao banco de dados
43 | db.add(db_statement)
44 | db.commit()
45 | db.refresh(db_statement)
46 |
47 | return JSONResponse(
48 | content={'msg': 'success'},
49 | status_code=status.HTTP_201_CREATED
50 | )
51 |
52 |
53 | @router.get("/generate-random-statement/{registers_to_generate}")
54 | def generate_random_statements(registers_to_generate: int = 1, db: Session = Depends(get_db), _: str = Depends(get_current_user)):
55 | if registers_to_generate < 1 | registers_to_generate > 100:
56 | raise HTTPException(status_code=400, detail="Count must be greater than 0 an minor 100.")
57 |
58 | statements = []
59 |
60 | for _ in range(registers_to_generate):
61 | # Gerar dados aleatórios para o statement
62 | description = fake.sentence()
63 | type = random.choice(["Deposit", "Withdrawal", "Transfer"])
64 | amount = str(round(fake.random_number(4, True) * 0.01, 2)) # Gera um valor aleatório como 1234.56
65 | to_user = fake.name()
66 | from_user = fake.name()
67 | bank_name = fake.company()
68 | authentication = fake.sha256()
69 |
70 | # Criar o registro de statement
71 | db_statement = Statement(
72 | description=description,
73 | type=type,
74 | created_at=fake.date_this_decade(),
75 | amount=amount,
76 | to_user=to_user,
77 | from_user=from_user,
78 | bank_name=bank_name,
79 | authentication=authentication
80 | )
81 |
82 | # Adicionar ao banco de dados
83 | db.add(db_statement)
84 | statements.append(db_statement)
85 |
86 | db.commit()
87 |
88 | for stmt in statements:
89 | db.refresh(stmt)
90 |
91 | return {"message": f"{registers_to_generate} random statements generated and added.", "statements": statements}
92 |
93 |
94 | @router.get("/statements/")
95 | def list_statements(skip: int = 0, limit: int = 10, db: Session = Depends(get_db), _: str = Depends(get_current_user)):
96 | # Query the database
97 | statements = db.query(Statement).offset(skip).limit(limit).all()
98 | return statements
--------------------------------------------------------------------------------
/readme_files/challenge_frontend5.md:
--------------------------------------------------------------------------------
1 | # Front-end Developer Technical Challenge 5 - Statement List and Amount
2 |
3 | Its main mission is to design and implement a screen that displays the user's balance and their list of bank transactions with pagination, hiding the display of values.
4 |
5 | You are expected to create this interface in your preferred language/framework.
6 |
7 | ### Figma
8 |
9 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=13-5855&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
10 |
11 | 
12 |
13 | ### Pagination:
14 |
15 | The route should receive two parameters, `limit` and `offset`, the `limit` parameter will be the number of statements to be returned and the `offset` parameter will be the number of statements to be skipped.
16 |
17 | **GET:** `/statements/{limit}/{offset}`
18 |
19 | ### Response:
20 |
21 | - After successfully processing the input data and CHECK the auth information, the endpoint should return a status code of 200 OK. With JSON Statement list:
22 |
23 | ```json
24 | [
25 | {
26 | "type": "Deposit",
27 | "amount": "15000.00",
28 | "description": "Payment from Freela",
29 | "from_user": "John Doe",
30 | "authentication": "45d064afbd6cf24613daed52133320b84ece0e2cc751995a4d0b94fca84823dd",
31 | "id": 1,
32 | "created_at": "2023-09-21T18:46:45.478966",
33 | "to_user": "John Doe",
34 | "bank_name": "Adams LLC"
35 | },
36 | {
37 | "type": "Deposit",
38 | "amount": "88.81",
39 | "description": "Trip authority window myself hour.",
40 | "from_user": "Holly Bailey",
41 | "authentication": "0ef6dc8284c7908ce7af354b10b6f354ff355a201f8f54e22bd60d928a6670c8",
42 | "id": 2,
43 | "created_at": "2020-09-07T00:00:00",
44 | "to_user": "Caitlin Bennett",
45 | "bank_name": "Williams-Norris"
46 | }, ....
47 | ]
48 | ```
49 |
50 | ## Validations:
51 |
52 | - The Route is authenticated, so it is necessary to send the token, otherwise the user will receive a 401 unauthorized status code, with the following message:
53 |
54 | ```json
55 | {
56 | "detail": "Not authenticated"
57 | }
58 | ```
59 |
60 | ### Bonus:
61 |
62 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
63 |
64 | ## Final Considerations:
65 |
66 | - Your user interface should not only be functional but also intuitive and user-friendly.
67 | - The design should take into account both aesthetics and usability.
68 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
69 |
70 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
71 |
72 |
73 | ### Bonus:
74 |
75 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
76 |
77 | ## Final Considerations:
78 |
79 | - Your user interface should not only be functional but also intuitive and user-friendly.
80 | - The design should take into account both aesthetics and usability.
81 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
82 |
83 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
84 |
--------------------------------------------------------------------------------
/readme_files/challenge_frontend_mobile4.md:
--------------------------------------------------------------------------------
1 | # Mobile Developer Technical Challenge 4 - Statement List and Amount
2 |
3 | Its main mission is to design and implement a screen that displays the user's balance and their list of bank transactions with pagination, hiding the display of values.
4 |
5 | You are expected to create this interface in your preferred language/framework.
6 |
7 | ### Figma
8 |
9 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=19-1283&mode=design&t=1oLA9vtlXknWRtig-4) to follow the style guide and components in your interfaces.
10 |
11 | 
12 |
13 | ### Pagination:
14 |
15 | The route should receive two parameters, `limit` and `offset`, the `limit` parameter will be the number of statements to be returned and the `offset` parameter will be the number of statements to be skipped.
16 |
17 | **GET:** `/statements/{limit}/{offset}`
18 |
19 | ### Response:
20 |
21 | - After successfully processing the input data and CHECK the auth information, the endpoint should return a status code of 200 OK. With JSON Statement list:
22 |
23 | ```json
24 | [
25 | {
26 | "type": "Deposit",
27 | "amount": "15000.00",
28 | "description": "Payment from Freela",
29 | "from_user": "John Doe",
30 | "authentication": "45d064afbd6cf24613daed52133320b84ece0e2cc751995a4d0b94fca84823dd",
31 | "id": 1,
32 | "created_at": "2023-09-21T18:46:45.478966",
33 | "to_user": "John Doe",
34 | "bank_name": "Adams LLC"
35 | },
36 | {
37 | "type": "Deposit",
38 | "amount": "88.81",
39 | "description": "Trip authority window myself hour.",
40 | "from_user": "Holly Bailey",
41 | "authentication": "0ef6dc8284c7908ce7af354b10b6f354ff355a201f8f54e22bd60d928a6670c8",
42 | "id": 2,
43 | "created_at": "2020-09-07T00:00:00",
44 | "to_user": "Caitlin Bennett",
45 | "bank_name": "Williams-Norris"
46 | }, ....
47 | ]
48 | ```
49 |
50 | ## Validations:
51 |
52 | - The Route is authenticated, so it is necessary to send the token, otherwise the user will receive a 401 unauthorized status code, with the following message:
53 |
54 | ```json
55 | {
56 | "detail": "Not authenticated"
57 | }
58 | ```
59 |
60 | ### Bonus:
61 |
62 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
63 |
64 | ## Final Considerations:
65 |
66 | - Your user interface should not only be functional but also intuitive and user-friendly.
67 | - The design should take into account both aesthetics and usability.
68 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
69 |
70 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
71 |
72 |
73 | ### Bonus:
74 |
75 | - Unit Testing: As an added advantage, we'd be highly impressed if you can integrate unit tests for the designed interface. It will provide us with a clear understanding of your proficiency in ensuring the robustness and reliability of your implementations.
76 |
77 | ## Final Considerations:
78 |
79 | - Your user interface should not only be functional but also intuitive and user-friendly.
80 | - The design should take into account both aesthetics and usability.
81 | - Be sure to write a good README guiding how to run your project, dependencies and what you think is necessary to install and run the project.
82 |
83 | Challenges like this offer a unique opportunity to showcase your skills. We wish you the best and eagerly await your innovative solution!
84 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | share/python-wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 | MANIFEST
28 |
29 | # PyInstaller
30 | # Usually these files are written by a python script from a template
31 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
32 | *.manifest
33 | *.spec
34 |
35 | # Installer logs
36 | pip-log.txt
37 | pip-delete-this-directory.txt
38 |
39 | # Unit test / coverage reports
40 | htmlcov/
41 | .tox/
42 | .nox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | *.py,cover
50 | .hypothesis/
51 | .pytest_cache/
52 | cover/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | .pybuilder/
76 | target/
77 |
78 | # Jupyter Notebook
79 | .ipynb_checkpoints
80 |
81 | # IPython
82 | profile_default/
83 | ipython_config.py
84 |
85 | # pyenv
86 | # For a library or package, you might want to ignore these files since the code is
87 | # intended to run in multiple environments; otherwise, check them in:
88 | # .python-version
89 |
90 | # pipenv
91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
94 | # install all needed dependencies.
95 | #Pipfile.lock
96 |
97 | # poetry
98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99 | # This is especially recommended for binary packages to ensure reproducibility, and is more
100 | # commonly ignored for libraries.
101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102 | #poetry.lock
103 |
104 | # pdm
105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106 | #pdm.lock
107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108 | # in version control.
109 | # https://pdm.fming.dev/#use-with-ide
110 | .pdm.toml
111 |
112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113 | __pypackages__/
114 |
115 | # Celery stuff
116 | celerybeat-schedule
117 | celerybeat.pid
118 |
119 | # SageMath parsed files
120 | *.sage.py
121 |
122 | # Environments
123 | #.env
124 | .venv
125 | env/
126 | venv/
127 | ENV/
128 | env.bak/
129 | venv.bak/
130 |
131 | # Spyder project settings
132 | .spyderproject
133 | .spyproject
134 |
135 | # Rope project settings
136 | .ropeproject
137 |
138 | # mkdocs documentation
139 | /site
140 |
141 | # mypy
142 | .mypy_cache/
143 | .dmypy.json
144 | dmypy.json
145 |
146 | # Pyre type checker
147 | .pyre/
148 |
149 | # pytype static type analyzer
150 | .pytype/
151 |
152 | # Cython debug symbols
153 | cython_debug/
154 |
155 | # PyCharm
156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158 | # and can be added to the global gitignore or merged into this file. For a more nuclear
159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160 | #.idea/
161 |
--------------------------------------------------------------------------------
/readme_files/challenged.md:
--------------------------------------------------------------------------------
1 | ## Instructions for challenged
2 |
3 | This project is already prepared with a instructions for you to create a docker image and run it so that you have your api environment without the need to configure the entire project.
4 |
5 | Follow the instructions below to carry out the procedure.
6 |
7 | ## News
8 |
9 | Now, the challenges are available in the cloud as I have deployed the API to streamline the initial access. Check out the documentation at: [https://dev-challenge.micheltlutz.me/docs](https://dev-challenge.micheltlutz.me/docs). However, you still have the option to use the challenges locally, either by using Docker or by setting up the Python environment.
10 |
11 |
12 | ## Requirements to run local
13 |
14 | - Terminal
15 |
16 | **For Linux**
17 | - [Docker Engine](https://docs.docker.com/engine/install/ubuntu/)
18 |
19 | **For macOS**
20 | - [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation#macos)
21 |
22 | **Windows**
23 | - [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install)
24 | - [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation#windows)
25 |
26 | > **Attention!:** If you are using Windows, you need to run the terminal as administrator.
27 | >
28 | > Prefer Rancher Desktop, it is free, more complete and has more features
29 |
30 | ## 1. Create Image
31 |
32 | ```bash
33 | docker build -t "dev-challenge" .
34 | ```
35 |
36 | ### 2. Check if image was created
37 |
38 | ```bash
39 | docker images
40 | ```
41 | ## 3. Run container
42 |
43 | ```bash
44 | docker run -d --name dev-challenge-demo -p 8000:8000 dev-challenge:latest
45 | ```
46 |
47 | ## 4. Check if container is running
48 |
49 | ```bash
50 | docker ps
51 | ```
52 |
53 | ## 5. Access the API
54 |
55 | - [http://localhost:8000](http://localhost:8000)
56 |
57 | ## Stop container
58 |
59 | When you need to stop the container, run the code below in your terminal
60 |
61 | ```bash
62 | docker stop dev-challenge-demo
63 | ```
64 |
65 | ## Api Documentation information
66 |
67 | The project documentation uses swagger, you can access it after running the docker container and accessing the address below in the browser, where you will find the routes, parameters and schemes of each of the routes created for your challenge, in addition to being able to execute the routes directly in the documentation.
68 |
69 | - [http://localhost:8000/docs](http://localhost:8000/docs)
70 | - [Online API and Docs](https://dev-challenge.micheltlutz.me/docs)
71 |
72 | Routes with authentication have a padlock icon
73 |
74 | 
75 |
76 | 
77 |
78 | ## Challanges
79 |
80 |
81 | ### Figma
82 |
83 | Access the [Figma link](https://www.figma.com/file/Q44nlEVrODE7W6iBFRVPZL/Desafio-para-devs---App-%2F-Dashboard-%7C-UX%2FUI?type=design&node-id=1%3A655&mode=design&t=aSjbTNYsb0UGO0yp-1) to follow the style guide and components in your interfaces.
84 |
85 |
86 | ### Front-End
87 |
88 | For front-end developers, we provide a ready-to-use API set up to run in a Docker environment or online usage. This API includes routes for listings, authentication, user creation, login, among other features. This allows the developer to focus primarily on the design and implementation of interfaces.
89 |
90 | - [Challenge 1. Contact Form No Figma](challenge_frontend1.md)
91 | - [Challenge 2. Create User Form](challenge_frontend2.md)
92 | - [Challenge 3. Login Form](challenge_frontend3.md)
93 | - [Challenge 4. Dashboard](challenge_frontend4.md)
94 | - [Challenge 5. Show Amount and Pagination Statent](challenge_frontend5.md)
95 | - [Challenge 6. Profile Edit](challenge_frontend6.md)
96 |
97 |
98 | ### Mobile
99 |
100 | For Mobile developers, we provide a ready-to-use API set up to run in a Docker environment or online usage. This API includes routes for listings, authentication, user creation, login, among other features. This allows the developer to focus primarily on the design and implementation of interfaces.
101 |
102 | - [Challenge 1. Create User Form](challenge_frontend_mobile1.md)
103 | - [Challenge 2. Login Form](challenge_frontend_mobile2.md)
104 | - [Challenge 3. Dashboard](challenge_frontend_mobile3.md)
105 | - [Challenge 4. Show Amount and Pagination Statent](challenge_frontend_mobile4.md)
106 | - [Challenge 5. Profile Edit](challenge_frontend_mobile5.md)
107 |
108 |
109 | ### Back-End
110 |
111 | The challenge set for back-end developers is to replicate the already developed routes in their preferred programming language and then produce relevant documentation.
112 |
113 | - [Challenge 1. Contact Route](challenge_backend1.md)
114 | - [Challenge 2. Create User Route](challenge_backend2.md)
115 | - [Challenge 3. Login Route](challenge_backend3.md)
116 | - [Challenge 4. Statements](challenge_backend4.md)
117 | - [Challenge 5. Amount](challenge_backend5.md)
118 | - [Challenge 6. Profile Edit](challenge_backend6.md)
119 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | .
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/Auth.drawio:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------