Code Monkey home page Code Monkey logo

simple-portfolio's Introduction

Simple-Portfolio for full stack web developer

This simple portfolio automatically sends an email when a contact arrives from this portfolio page. and can also directly reply to incoming contacts

This simple portfolio uses the simple concept of mvc in php(Development of mvc concept learning in php from Mr. Sandhika Galih). Instead of using PHP's built-in mail() function. This simple portfolio uses the PHPmailer library to send email via the SMTP Protocol to a local or remote SMTP server.

Features

  • Authentication login and register with code verification using email
  • Contact the creator of the page via the email mechanism
  • Login multi user

Requirement

You need the PHPMailer library for this simple application. Otherwise, some errors will occur because the init.php and Mails\BaseMail file requires the PHPMailer library.

Installation

You can download Simple-Portfolio as a zip file. or clone this repo

git clone https://github.com/nsmle/simple-portfolio

To be able to use the PHPMailer library, you must install it. Read the PHPMailer Installation documentation

or add this line to your composer.json file:

"phpmailer/phpmailer": "^6.5"

or run

composer require phpmailer/phpmailer

Configuration

Database & Table

You can import the simple_portfolio.sql database into your database.

Config File

  • Rename the Example.Config.php file in app/Config/ to Config.php

  • Replace with your base url.

    // Base Url
    const BASEURL = 'YOUR BASE URL';
  • Replace with your database configuration.

    // Configuration Database
    const DB_HOST = 'YOUR DATABASE HOST';
    const DB_USER = 'YOUR DATABASE USER';
    const DB_PASS = 'YOUR DATABASE PASSWORD';
    const DB_NAME = 'YOUR DATABASE NAME';
  • For database error logs. Fill true if you want to enable error logging in the database and false to disable it.

    const DB_ERROR_LOG = true;

    This is related to the logs() function in app/Config/Constant.php

  • Email Configuration, This is related to Mail\BaseMail. You can see an example from PHPMailer here or more examples here

    • Replace with your smtp host. If you use gmail then fill it with smtp.gmail.com
    const MAIL_HOST = 'HOST YOUR MAIL';
    • Replace with your email and email password
    const MAIL_USERNAME = 'EMAIL YOUR MAIL';
    const MAIL_PASSWORD = 'PASSWORD YOUR MAIL';
    • Replace with your sender name and sender email
    const MAIL_FROMNAME  = 'YOUR SEENDER NAME';
    const MAIL_FROMEMAIL = 'YOUR SEENDER EMAIL';
    const MAIL_DEBUG = false;

    As a side note, if you are using gmail then you have to go to myaccount.google.com -> Log in & security -> Apps with account access, and change Allow less secure apps to ON (near the bottom page). Alternatively you can follow this direct link to these settings

  • Registration features

    If you allow other people to manage your site(http://yourbaseurl/admin) then give it a value of true and if you don't allow it then give it a value of false. Note, that before you set the value to false, make sure that you are registered and able to log in.

    const REGISTRATION_FEATURE = true;

    For the default user role. You can customize it with your users table in the role column

    const DEFAULT_ROLE_USER    = 'Admin';

Ajax Configuration

You have to change the ajax url in app/assets/js/main.js manually. in line

url: '[YOUR_BASE_URL]/home/contact',

Replace [YOUR_BASE_URL] with your base url, as an example :

// AJAX FOR SEND DATA
$.ajax({
  url: 'http://localhost:8000/home/contact',
  data: {name : name, email : email, phone : phone, message : message},
  method: 'post',
  success: function(data){
      document.getElementById('form-contact').innerHTML = data;
      console.log(data);
  },
  error: function(msg) {
      console.log(msg);
  }
});

simple-portfolio's People

Contributors

nsmle avatar

Stargazers

 avatar

Watchers

 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.