Share Square is a website which allow its member to share any kind of information. Register members can create a post to share their information. Members can also interact with each other through comment, rating, messaging etc.
Admin of website can manage all information on the system including but not limited to member's post related information, account information, role, category etc.
Currently, the system support on web and android. Some feature has been completed. Many other features are under developing
Setup laravel framework for the project. Configure the Voyager plugin to function the admin site of the website. With supporting of Voyager plugin, the admin site can manage CRUD for all model in database. Need to implement model class in project source code Then do some configuration in Voyager in order to create CRUD feature for the database model.
The Voyager also support create the dynamic menu system which return the json of dynamic menu. The Front side of website can consume that json and manipulate with html to create dynamic menu.
Create data migrate to all tables in database and create all table seeder to generate testing data for the project.
- app/all model class
- composer.json
- Setup laravel project
- Laravel Database migration
- Laravel Database seeder, and Data factory
- Setup plugin for laravel project
- Understand and use the Voyager plugin
Create common layout and side menu bar which is applied for features of login user
The common layout is utilized the blade master template
The side menu bar is developed by using Vue.js which consumes the menu json collection that is configured in Voyager feature
- app/Menu.php
- public/css/profile.css
- public/js/slide-menu-bar.js
- resources/js/components/user_menu.vue
- resources/views/dashboard/navbar.blade.php
- resources/views/dashboard/sidebar.blade.php
- resources/views/layouts/user-master.blade.php
- Understand blade template and laravel layout management
- Understand bootstrap
- Understand Vuejs component.
The dashboard present some statistic information about user's posts as following
- Total posts, views, and ratings
- The monthly post chart
- The monthly statistic chart of all comments, rating, and views
- The summary of rating statistic
Upon login, the dashboard show the statistic of current year. User can select another year by the dropdown box on the top of page.
The charts are generated by using consoletvs/charts plugin
- Go to http://kientran.herokuapp.com/
- Login with email: [email protected] - pass: 123456
- The website will navigate to user dashboard
- Router
- routes/web.php
- Support class
- app/Charts/UserChart.php
- app/Helpers/helpers.php
- Controller
- app/Http/Controllers/User/UserDashboardController.php
- Model
- app/Post.php
- app/Comment.php
- app/PostView.php
- app/Rating.php
- View
- resources/views/user/dashboard.blade.php
- Laravel Security
- Laravel Route
- Eloquent Model, Model Relationship, Query
- Laravel View
- consoletvs/charts plugin
The list page present different kind of posts of current user.
- Draft Post: The post is created but has not published.
- Pending Post: The post is published and waiting for approval for publishing
- Public Post: The post is visible to all member of system
- Closed Post: The post is set as private which can only view by post owner.
The user can only view those information after login
- Go to http://kientran.herokuapp.com/
- Login with email: [email protected] - pass: 123456
- On the slide menu bar, select appropriate menu for each type of post.
- Router
- routes/web.php
- Support class
- app/Helpers/helpers.php
- Controller
- app/Http/Controllers/User/MyPostController.php
- Model
- app/Post.php
- app/Comment.php
- app/Favorite.php
- app/PostView.php
- app/Rating.php
- View
- resources/views/user/post-list.blade.php
- Laravel Security
- Laravel Route
- Eloquent Model, Model Relationship, Query
- Laravel View
- Bootstrap css
Create several api endpoint which allow mobile application can access post information
- Retrieve a list of different type of post such as public, pending, closed, draft and favorite.
- Retrieve the post detail information
- Retrieve list of image belong to a post
- Retrieve the post attribute key-value pair
- Retrieve the rating of post
- Retrieve all comments of the post
- Retrieve post' viewing information
- Retrieve statistic information related to all post of current user.
- Change the status of a post
- Add comment to a post
- Rating for a post
- Add a view to a post when a user view the post detail.
The API endpoint is secure by using Laravel Passport. User from mobile app must login to the system through provided login route in order to receive api token. For each request to the api, the user have to add the token to header of request in other to authenticated by backend.
- Install Postman Rest Tool
- Create a post request to http://kientran.herokuapp.com/api/login
- The request body must include two key-value pare as followiing
- email : [email protected]
- password: 123456
- Send the request and get the [api token] in response
- In subsequence post/get request, include following key-value pairs as follow
- Accept : application/json
- Authorization: Bear [api token]
- Router
- routes/api.php
- Support class
- app/Helpers/helpers.php
- Controller
- app/Http/Controllers/Auth/ApiLoginController.php
- app/Http/Controllers/Api/DashboardController.php
- app/Http/Controllers/Api/PostApiController.php
- Model
- app/Post.php
- app/Comment.php
- app/Favorite.php
- app/PostView.php
- app/Rating.php
- app/PostDetail.php
- app/Image.php
- app/User.php
- Resources
- app/Http/Resources/CommentResource.php
- app/Http/Resources/ImageResource.php
- app/Http/Resources/PostCollection.php
- app/Http/Resources/PostDetailResource.php
- app/Http/Resources/PostResource.php
- app/Http/Resources/UserProfileResource.php
- View
- Mobile Client
- Laravel Security using Passport to secure API
- Laravel API authentication middelware
- Laravel Route
- Eloquent Model, Model Relationship, Query
- Eloquent composite keys relationship using awobaz/compoships plugin
- Laravel API handling
- Laravel API Resource transformation
| Task Name | POC | Due Date | Status |
|---|---|---|---|
| Setup Laravel Framework | Kien | Week 8 | Done |
| Setup Admin Landing page and layout | Kien | Week 8 | Done |
| Admin: CRUD for Category | Kien | Week 8 | Done |
| Admin: CRUD for Post | Kien | Week 8 | Done |
| Admin: CRUD User | Kien | Week 8 | Done |
| Admin: CRUD Role | Kien | Week 8 | Done |
| Admin: Website configuration | Kien | Week 8 | Done |
| Admin: Website configuration | Kien | Week 8 | Done |
| User registration - basic | Kien | Week 8 | Done |
| User Authentication - basic | Kien | Week 8 | Done |
| User Authorization - basic | Kien | Week 8 | Done |
| Homepage layout | Chi | Week 8 | Done |
| Merge Home page layout to laravel template | Kien | Week 8 | Done |
| Update Readme.md file to guideline on how to setup project on local environment | Kien | Week 8 | Done |
| Define commit process and update the process to Readme.md | Kien | Week 8 | Done |
| Add UI mockup for advanced search page | Tuong | week 8 | Done |
| Individual Feature Pages(Car,RealEstate,Jobs) | Chi | Week 9 | In Progress |
| Create Add post form | Chi | week9 | In Progress |
| Integrate and structure main layout using blade template | Kien | week 09 | Done |
| Create User Main Layout (Including Dynamic Menu Side Bar and Navigation Bar) | Kien | Week09 | Done |
| Create User Dashboard Layout (Statistic and Charts) | Kien | Week09 | Done |
| Create User Profile Layout | Kien | Week09 | Done |
| Create User Public Posts Layout | Kien | Week09 | Done |
| Create User Pending Post Layout | Kien | Week09 | Done |
| Create User Closed Post Layout | Kien | Week09 | Done |
| Create User Favorite Post Layout | Kien | Week09 | Done |
| Create User Recent View Post Layout | Kien | Week09 | Done |
| Create Post Detail layout (include rating, comments) | Pradeep | Week 9 | In Progress |
| Create Create Post layout | Pradeep | Week 9 | In Progress |
| Create API Endpoint for post | Kien Tran | Week 11 | Done |
| Create database mirgration and dummy data for comments, ratings, favorite, post images-list | Kien Tran | week11 | Done |
| Create database seeder to comments, ratings, views, user tables | Kien Tran | week11 | Done |
| Complete User Dashboard page include charts and statistic | Kien Tran | week11 | Done |
| Create common search function for search post | Kien Tran | week11 | Done |
| Create MyPostController which handle all public, pending, draft, close, favorite post | Kien Tran | week11 | Done |
| Create Seeder for favorite post | Kien Tran | week11 | Done |
| Merging home page and details page using Laravel | Chi Bui | week11 | Done |
| Add Post via home page | Chi Bui | week11 | Done |
| Update Post in details page | Chi Bui | week11 | InProgess |
| Create Search Post helper function for post searching, filtering purpose include paging | Kien Tran | week12 | Done |
| Create Post List layout for public, pending, draft, close, favorite | Kien Tran | week12 | done |
| Do pagination for all the page and search on home page and add validation | Chi Bui | week13 | Done |
| Setup awobaz/compoships library to implement composite keys relationship between model | Kien Tran | week13 | done |
| Create Mobile Api for post list, post detail, post images, post attributes, and post comment | Kien Tran | week13 | done |
| Setup Passport to secure API endpoint, create login endpoint for android app | Kien Tran | week13 | done |
| Deploy the website on Heroku | Kien Tran | week14 | done |
| Create the Markdown document on github | Kien Tran | week14 | done |
Following is step to setup project on local environment:
-
Install Composer : https://getcomposer.org/ .
Run following comment to make sure you have composer in your environment. Please pay attention on version .
composer -v.
Composer version 1.9.0 2019-08-02 20:55:32. -
Install NodeJS: https://nodejs.org/en/ .
- Check version by command
node -v
v12.11.1 - Check laravel is installed by command
laravel.
Laravel Installer 2.1.0
- Check version by command
-
Clone the project to a local folder (ex: C:\Project): https://github.com/2019-fall-ite-5330-0na/project-user-interface-sharesquare.git
-
Use command line to go to C:\Project folder
cd C:\Project -
Install Composer Dependencies:
composer install -
Install NPM Dependencies:
npm install -
Generate an app encryption key:
php artisan key:generate -
Create an empty database for our application in MYSQL Database:
ex: project -
In the .env file, Edit database information to connect to the database according to your database configuration. You can file .env file in the project root folder .
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=projectDB_USERNAME=rootDB_PASSWORD=root
-
Migrate the database: It means create database table in your database based on migrate feature of laravel
- In project folder, run command:
php artisan migrate
- Add dummy data to database:
- In project folder, run command:
php artisan db:seed
- Run the project
- In project folder, run command:
php artisan serve
- Access the website: http://127.0.0.1:8000
- Access the admin page: http://127.0.0.1:8000/admin (email: [email protected]/pass: password)
- Enjoy :)
We are working in the project where serveral members will coding and commit contemporarily. As the result, code conflict will happen and one member might overide the code of other member when he commit if we don't have a process of how we commit code to github. Fortunately, github gives us the feature to handle it. Please strickly compliance with following process when working in the project
- Go to github website of our repository. Create a new branch from the master branch and named with your task name.
- Go to local environment, pull the repository
- Switch to your new created branch
- Coding for your task in your branch
- Before commit your code: merge the master branch to your branch then test whether your code work normally
- Commit code to your branch
- Push the code to github repository
- Go to github website to create a pull request to merge your branch to the master branch.
- Assign the pull request to other member of the team for review and merge code.
- To reviewer, please review the code then -> merge master branch to the branch being merged by the pull request. If there is any conflict, please ask member who created the pull request to resolve the conflict. If there is not any conflict, please merge the pull request.
