Guide to (usage and description of) the Faansy application.
Table of Contents
- What Faansy Is
- Features of the Application
- Technical Features of the Application
- Technologies Utilized in Crafting Faansy 1. Server-side 2. Client-side
- API Documentation
- Database Structure
- How to Install and Run the Faansy Application Locally On Your Device 1. Requirements 2. Installation Procedure 1. Server-side Terminal 2. Client-side Terminal
- Footnotes !important
Faansy is a social media / content creation application, where content creators can create content / share their thoughts ranging from texts to pictures and videos of moments. (gif image showing working application comes here)
- There are 4 roles: generic user, creator, admin and superadmin. These roles have different levels of authorization.
- All user roles can register and add images (profile picture and background picture) to their profile.
- Users can opt to become creators only after approval by the superadmin/admin.
- Only creators (and admin and superadmin) can create posts.
- Admin can attend to users queries from their level of authorization.
- Superadmin have a higher authorization with more capabilities than the admin role.
Here is a link to some of the main features of the application in full
- Authentication
- Authorization (multiple roles)
- Mailing/Notifications
- Access tokens
- Soft-delete function so that data is never really lost (all deleted data can be retrieved/re-activated)
- Laravel Pint for code uniformity and consistency
- Accessors
- Scopes
- API Resources for custom JSON responses
- Observers
- Custom Middleware
- Eager-loading
- Customized Exception Handlers (a security step for masking the actual model names on the server from API consumers on the client)
- All incoming requests are validated multiple times on both client side and server-side.
- API requests rate-limiting to prevent attacks like, DoS (Denial of Service).
- Other security measures in place to prevent attacks.
- Multiple error handlers (for both planned and unplanned errors) to catch all errors properly.
Plus much more...
Faansy is crafted in the following programming languages/frameworks and technologies:
- Laravel (PHP) on the server-side. 1. Laravel Tests (for writing comprehensive tests for the application)
- MYSQL (for database).
- Scribe for local API documentation.
- Postman for online API documentation.
- React.JS (JavaScript) library on the client-side.
- Bootstrap5 for styling.
- Vanilla CSS3 for custom styling.
Here are links to the API documentation. You may wish to view the online version if you do not want to install and run the application locally on your device:
Online version: https://documenter.getpostman.com/view/13239911/2s946bCabf
Offline version: http://localhost/docs
("localhost" here stands for your local development environment port. Laravel by default runs on localhost:8000. So you would typically view the docs on http://localhost:8000/docs unless you decided to run on a port you set by yourself)
-
You must have PHP installed on your device. Visit the official PHP website and follow the steps for download and installation.
-
After installing PHP, download and install a text editor (e.g. VS Code) if you do not have one.
Then go to your terminal and follow these steps:
- From your terminal, cd (change directory) into your favorite directory (folder) where you would like to have the application files
cd C:\Users\maxim\Desktop>
Here I changed directory into my personal Desktop space/folder on my Windows Computer. And then;
- Clone this repository from here on Github using either of the 2 commands on your terminal:
git clone https://github.com/maxralph1/faansy-upwork.git
or
git clone git@github.com:maxralph1/faansy-upwork.git
- And to end this section, CD into the newly installed "faansy-upwork" application file with the following commands.
cd faansy-upwork
At this point, you must have 2 terminals running side-by-side (server-side (to run the server side code) and client-side (to consume the server-side API)).
- On the first terminal, change directory into the server file
cd server
- From here, use the command below to install all dependencies I utilized in this application as can be seen from my 'server/composer.json' file
composer install
- Spin up the server with the command:
php artisan serve
Your server traditionally starts on port 8000 (http://localhost:8000), if you have nothing currently running this port.
-
Go to the 'server/.env' file which you must have gotten from modifying the 'server/env.example' file and make sure the database name is what you want it to be.
-
You should already have a MySQL database installed and running. Create a database instance with same name as that for the database above. I use XAMPP (you can get XAMPP here). It makes it easier for me.
-
Go back to your server terminal and run the command to migrate and seed your database:
php artisan migrate --seed
- On the second terminal, change directory into the server file
cd client
- Use the command below to install all dependencies I utilized in this application as can be seen from my 'client/package.json' file
yarn
- Spin up the client-side (front-end) to consume the back-end API using the following command:
yarn dev
Your application should be up on http://localhost:5173/ if you have nothing previously running on the port. Check your terminal to confirm the actual port.
This application is still in the beta-phase; even though it is production-ready.
We will continue to gradually update this project.
Finally, contributions/suggestions on how to improve this project are welcome.