laurabeatris / active-businesses-locations Goto Github PK
View Code? Open in Web Editor NEWExplore the list of businesses locations from Los Angeles
License: MIT License
Explore the list of businesses locations from Los Angeles
License: MIT License
Set up the architecture and initial structure of the API.
The architecture is going to be based on DDD and the development process is going to be based on TDD.
As DDD is going to be applied, the domain layers should be configured, refer to the following structure:
Must follow the principles of SOLID and configure a container for dependencies.
.gitkeep
to be used on the next pull requests.Add the businesses domain in order to retrieve data about the businesses.
The frontend should receive the locations data according to these three filters:
A new service should be created for each filter since the logic to parse the data is different.
GetOldestBusinessService
GetBusinessWithMostLocations
The controllers can be the following:
BusinessesController
show
method receives two types of query params (oldest
and most-locations
)index
method returns all the locations fetched from the data source.GetOldestBusinessService
and add testsGetBusinessWithMostLocations
and add testsGetAllBusinessesService
and add testsBusinessesController
BusinessWithMostLocationsController
OldestBusinessController
Return only the first page of businesses
Filters for the businesses list
A component that has three types of filter:
BusinessFilters.All
BusinessFilters.Oldest
BusinessFilters.MostLocations
Usage:
<BusinessFilters onFilterChange={handleFilterChange} />
Add the main page to show the header, business filter, and businesses list
The page should show the businesses according to the filter currently selected
Add the component to show the business with the most locations
The component should show the business with the most locations and fetch it
A header component to show an introduction message
A header component with text constants and also extensible via props
Usage:
<Header title="Welcome!" message="Explore the LA businesses" />
Possible implementation:
const Header = ({ title = headerTexts.title, message = headerTexts.message }) => (...);
Add the user domain in order to retrieve and create the user data
The frontend will upload the user avatar and send the username to the backend and we must store this data in order to retrieve on the next accesses.
The following repositories should be created:
UserRepository
(Should also create a fake class in order to use for unit tests)The following service should be created:
CreateUserService
The following providers should be created in order to upload photos:
StorageProvider
The following controller should be created in order to retrieve the user data:
UserController
StorageProvider
- For now, it can use the file system.User
schemaUserRepository
and FakeUserRepository
CreateUserService
and testsUserController
Add the business component
Handle the case when the component shows a badge
Usage:
<Business
badgeText="Some badge text"
locationsCount={5}
city="Some city"
street="Some street"
zipCode="Some zipcode"
name="The business name"
/>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.