ICT PHP Expenses Management: API to manage records of expenses of users

Recommend this page to a friend!
  Info   View files View files (80)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-09-05 (6 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 17 This week: 17All time: 10,373 This week: 9Up
Version License PHP version Categories
expenses-management 1.0Shareware5PHP 5, Web services, Finances
Description Author

This package provides an API to manage records of expenses of users.

It can handle requests to several API endpoint URLs to perform operations with financial expansions done by application users. Currently, it can:

- Record new expenses
- Return the list of previously recorded expenses

Picture of Ahmad Mustapha
Name: Ahmad Mustapha <contact>
Classes: 13 packages by
Country: Nigeria Nigeria
Innovation award
Innovation award
Nominee: 5x

 

Details

ITC Expenses Management

Installation

The installation of this project requires composer

  • Step 1: Clone this repository
    git clone git@github.com:ahmard/ict-expenses-management.git
    
  • Step 2: Change directory ownership
    chown www-data:www-data ict-expenses-management -R
    
  • Step 3: Install composer dependencies
    cd ict-expenses-management
    composer update
    
  • Step 4: Configure database connection, duplicate .env.example to .env and make following changes to .env * DB_DATABASE = your_database_name * DB_USERNAME = your_database_user * DB_PASSWORD = your_database_user_password
  • Step 5: Generate application key
    php artisan key:generate
    
  • Step 6: copy config/dev.conf to /etc/nginx/conf.d/dev.conf to configure nginx
  • Step 7: Restart nginx
    service nginx restart
    

You can alternatively use PHP's built-in server

cd ict-expenses-management
php artisan serve

And all your requests should be sent to http://localhost:8000

Usage

List expenses

Send GET request to /api/expenses endpoint

Create expenses

Send POST request to /api/expenses endpoint with following json-payload

{
    "user": 1,
    "reason" : "Your expense reason",
    "value": "Your expense value",
    "date": "YYYY-MM-DD"
}

If your expense is created, you'll receive something like

{
    "success": true,
    "status": 200,
    "data": {
        "user": 1,
        "reason": "Fri",
        "value": 2384,
        "date": "2021-08-19",
        "updated_at": "2021-08-19T11:44:27.000000Z",
        "created_at": "2021-08-19T11:44:27.000000Z",
        "expense_id": 8
    }
}

In case of any validation error, you'll receive response similar to below

{
    "success": false,
    "status": 500,
    "data": {
        "reason": [
            "The reason must be at least 3 characters."
        ]
    }
}

Testing the application

php artisan test
  Files folder image Files  
File Role Description
Files folder imageapp (1 file, 5 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (16 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (4 files)
Files folder imageresources (3 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file requests.http Data Auxiliary data
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:17
This week:17
All time:10,373
This week:9Up

For more information send a message to info at phpclasses dot org.