Skip to content
dali546 edited this page Jul 8, 2019 · 3 revisions

Community Server

This is the PHP server used to host and run the concept social media platform dubbed "Community"

Project Info

The 'Community' Project is a concept social media platform I am working on. It serves for me to enhance my skills in all aspects of the development stages, and tech stacks.

This and the Community App will serve as the foundation for this project.

Community Server

The Community Server will house database configuration, models, authentication and logic required to run the application. It is written in PHP, using the Laravel Framework.

Components

The server comprises of the following tools and frameworks:

  • PHP 7.x
  • Laravel 5.7+
  • Laravel Passport
  • PostgreSQL 11
  • Lighthouse GraphQL 3

Setup

To setup the server please follow the instructions below

  1. Clone repository.
  2. install composer using composer install
  3. run php artisan key:generate to generate keys
  4. run php artisan migrate:fresh --seed to seed the database (after environment configuration)
  • The default user details are:
username: test
email: test@tester.com
password: secret

If you want to change this, edit UserTableSeeder.php 5. run php artisan passport:install 6. take the Password Grant Token Client details and add them to your .envfile. 7. Done. visit/graphql-playground` to mess around with the schema.

Authentication

Laravel GraphQL uses Passport auth tokens to give access. Currently all GraphQL queries require authorization. Make sure after logging in, to add the following header to your requests:

{
 "Authorization": "Bearer ...token"
}

Schema

Below is an image of the database Schema. right now it isn't much, but will grow to fully accomplish what the app will be able to do

Database Schema

Clone this wiki locally