Git Product home page Git Product logo

eskimi-ssp's Introduction

Eskimi SSP

Adedayo Matthews

This a submission of task for the role of Senior full-stack PHP developer at Eskimi. Task description can be found here.

Features

  • Create and edit advertising campaign
  • List all created advertising campaigns: name, date, daily budget, total budget
  • Multiple image upload with the advertising campaign
  • Preview of each advertising campaign
  • API endpoint to list campaigns
  • API endpoint to create new campaign

Stack

  • Laravel - PHP framework
  • Vue3 - Javascript frontend framework
  • Nginx - An open source web server
  • MySQL - Database service
  • Redis - Data storage for cache.

Dependencies

In addition to the Laravel framework, the following dependencies were also used in the application:

  • InertiaJS - A library that allows you to render single-file Vue components from your Laravel backend.
  • Jetstream - Application starter kit for Laravel.
  • Sanctum - Laravel package that provides a featherweight authentication system.
  • Ziggy - Provides helper functions to access all of our named Laravel routes from the frontend.
  • TailwindCSS - A utility-first CSS framework.

Installation and deployment

Docker containers were used to setup the environment, thanks to Laradock.

Docker version used: Docker Desktop version 20.10.8

Follow the instructions to set up the app in Docker.

Clone repo with submodules

git clone --recursive https://github.com/adedayomatt/eskimi-ssp.git

Navigate to eskimi-ssp dir

cd eskimi-ssp

Make a copy of the app .env

copy .env.example .env

Navigate to laradock dir

cd laradock

Make a copy of Laradock .env

copy .env.example .env

Create and start the containers

We need nginx, mysql, redis and workspace containers running. The workspace container already contains necessary softwares requires to successfully run a Laravel project, e.g PHP CLI, Composer, Node, e.t.c.

docker-compose up -d nginx mysql workspace redis

Open workspace bash

docker-compose exec workspace bash

Continue running the following commands In the workspace bash...

Install composer dependencies

composer install

Set App key

php artisan key:generate

Migrate database

php artisan migrate

Seed Database

This create a user account to login in with and some sample campaigns

php artisan db:seed

Create storage symlink

php artisan storage:link

Install Javascript depencies

npm install

Build resources for production

npm run prod

Update App .env

In app .env file, set the following...

DB_CONNECTION=mysql
DB_HOST=mysql
DB_DATABASE=default
DB_USERNAME=root
DB_PASSWORD=root

CACHE_DRIVER=redis
REDIS_HOST=redis
QUEUE_HOST=beanstalkd

The app should now be running at the address:

http://localhost

Authentication

Login to the system with the credentials already seeded.

Email: [email protected] Password: eskimi

For API authentication, an access token needs to be created at http://localhost/user/api-tokens with the right permissions; by default, read and create permissions are added to allow listing of campaigns and creating new campaign respectively via API. Copy the token and pass it as Bearer token in request header.

API Routes

API Path Verb
Authenticated user /api/user GET
List of campaigns /api/campaigns GET
Single campaign /api/campaigns/{campaign_id} GET
Create new campaign /api/campaigns/store POST

Testing

The following tests are available:

  • User authentication
  • Creating of API token
  • Deleting of API token
  • Password reset and update
  • Updating of Profile information
  • Listing campaigns via web and api
  • Creating new campaign via web and api
  • Updating campaign via web an api

Run test:

php artisan test

Design Structure

To ensure the code extensibility and maintainablility, the code base was designed in modules such that other features can be built in as separate modules and be maintained independently. To achieve this, the modules directly was added to Laravel file structure which would house different modules in the application. The campaign module was created and structured to contain models, controllers, routes, migrations, requests, views and components for campaign. The campaign service provider was created to configure the module and is registered with the application in config/app

The modules directory was added to the psr-4 autoload with a namespace here

=============================================================================================================================

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

eskimi-ssp's People

Contributors

adedayomatt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.