Project Name: Serv
.png)
Project Objective:
Create a web marketplace offering digital marketing, programming, and other IT skills.
the main idea is we help the expert who have experience in IT skill with our platform and connect with user who need a service
Features:
- User accounts and login
- Item listing and pricing
- Item search by criteria
- Detailed item information and seller contact
- Admin dashboard panel for managing listings, users, and transactions
Technology Stack:
- Laravel 8
- MySQL
- Laragon
- Blade
Workflow
- Database Design:
- The first step is to create a database design to store data from the website. The database will consist of several tables, including Users, Items, Categories, and Transactions.
- Database Migration & Seeding:
- After designing the database, the next step is to perform migration and seeding. Migration involves making changes to the database structure, while seeding populates the database with dummy data.
- Eloquent:
- Eloquent is an Object Relational Mapping (ORM) provided by Laravel to simplify data access from the database.
- Blade:
- Blade is the template engine provided by Laravel for creating the website's views.
- Testing:
- After building all features, the next step is to conduct testing to ensure that all functionalities work correctly.
- Deployment:
- Once testing is complete, the website can be deployed to a server for user use.
- Documentation:
- Documentation will be created to facilitate user understanding of how to use the website.
Preparatory
Installation
-
Clone the repository:
git clone <https://github.com/aldiandarwin/Serv-commerce>
-
Navigate to the project directory:
cd your-social-auth-project
-
Install PHP dependencies using Composer:
composer install
-
Install NPM dependencies:
npm install
-
Copy the .env.example file and rename it to .env. Update the database configuration and other necessary settings:
cp .env.example .env
-
Generate an application key:
php artisan key:generate
-
Migrate the database:
php artisan migrate:fresh --see
-
Start the development server:
php artisan serve
-
Build the frontend assets:
npm run dev
Repository
- Source Code (Laravel)
https://github.com/aldiandarwin/serv-test
case study question
1.Programming Stack
I chose Laravel as the programming stack for this project for several reasons:
- Outstanding Ecosystem: Laravel boasts an extraordinary ecosystem supported by a large community and a wide array of packages and libraries. This makes application development with Laravel more straightforward and efficient.
- Backend Advantages: Laravel excels in the backend, offering ready-to-use features such as ORM, routing, authentication, and authorization. This streamlines the development of backend applications.
- Scalability: Laravel is a scalable framework, adaptable to the evolving needs of growing applications.
- Security: Laravel comes with built-in security features, enhancing the protection of applications against potential threats.
2.Database
I opted for MySQL as the database for this project due to the following reasons:
- Relevance to Requirements: MySQL, being a relational database, is suitable for storing data with complex relationships, aligning well with the project's requirements involving user data, items, categories, and transactions.
- Compatibility: MySQL is a popular and widely used relational database, ensuring ease of finding support and documentation.
- Performance: MySQL is known for its good performance, making it capable of supporting applications with a large user base.
3.ERD

ERD

folder structur

folder structure view
4. How many API did we need for this case? And try to create the documentation.
In this project, we are using API tokens for authentication and authorization purposes. Here's an explanation of why API tokens are employed:
Detailed item information and seller contact:
When a user wants to view detailed information about an item or contact a seller, the system needs to ensure that the user making the request has the necessary permissions and is authenticated. API tokens play a crucial role in this process.
Explanation:
- Authentication: API tokens serve as a method of authenticating users. When a user logs in, they receive an API token that uniquely identifies them. This token is included in subsequent requests to the server, proving the user's identity.
- Authorization: Beyond authentication, API tokens are often used for authorization. Each token can be associated with specific permissions or roles. For example, a user may have a token with permissions to view detailed item information and contact sellers.
- Secure Communication: Using API tokens adds a layer of security to communication between the client (user's browser or application) and the server. Tokens can be sent as part of the request headers, securing the transmission of sensitive information.
- Scalability: API tokens are scalable and can be easily managed. They allow the system to handle multiple users simultaneously while ensuring that each user's actions are associated with their unique identifier.
- Session Management: Unlike traditional session-based authentication, where the server maintains the session state, API tokens are stateless. This means the server doesn't need to store information about the user's session, making it more scalable and suitable for distributed systems.
In summary, using API tokens in your project enhances security, facilitates user authentication and authorization, and provides a scalable solution for managing user sessions and permissions, especially when accessing detailed item information and contacting sellers.
Below is a simplified example of how you might structure your API documentation for the web marketplace project:
Serv Marketplace API Documentation
Introduction
Welcome to the Serv Marketplace API documentation. This API allows developers to integrate and interact with the Serv web marketplace programmatically.
Base URL
The base URL for all API endpoints is: https://api.servmarketplace.com/v1
Authentication
The Serv API uses API tokens for authentication. To obtain an API token, users must authenticate through the web application.
Endpoints
1. User Information
GET /v1/user
- Description: Retrieve information about the authenticated user.
- Authentication: Required
- Request:
- Response:
2. Item Listing
GET /v1/items
- Description: Retrieve a list of items available in the marketplace.
- Authentication: Not required (Guest access)
- Request:
- Response:
3. Item Details
GET /v1/items/{item_id}
- Description: Retrieve detailed information about a specific item.
- Authentication: Not required (Guest access)
- Request:
- Response:
4. Create Item (Seller)
POST /v1/items
- Description: Create a new item listing in the marketplace.
- Authentication: Required (Seller or Admin access)
- Request: