arrow-left

All pages
gitbookPowered by GitBook
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

week12-project05-DOTNET-deploy

Learning Outcomes

hashtag
Testing

hashtag
Deployment

project

hashtag
.NET

Your task this week is to deploy and test the library app you have completed in the previous two weeks.

hashtag
Spike

Resources

  • hashtag
    Some insight on how build tools process .env files

Understand the process of building and optimising a .NET application for production (S10, S14, B3)
  • hashtag
    .NET Deployment Cheat Sheetarrow-up-right A quick guide to a basic deploy of a Core API to a EC2 instance
    Guide ENV variables and file in Vitearrow-up-right
    Before you start you need to create a testing and deployment plan. We would like you to plan a testing strategy that will have broad coverage of your project. The tools we would like you to use to achieve this can include Cypress, Postman and the Node built in testing library.

    We would also like you to deploy this project using an EC2 instance for you server and a S3 bucket to serve your static files using CloudFront. You should also utilise Github actions to allow you to automatically deploy changes on merges to your main branch.

    hashtag
    Questions to consider

    • What parts of the application logic are the most critical to cover with unit tests?

    • How will you mock external dependencies (like databases or APIs) during unit testing?

    • What are the key user journeys and flows within the application that must be covered by end-to-end tests?

    • Where will the code that represents your infrastructure live and how will it be organised?

    • How will you manage configuration variables for different environments (development, staging, production)?

    • What are the different AWS products you will need to configure to make your deployment successful?

    hashtag
    Acceptance Criteria

    hashtag
    Stretch


    hashtag
    PHP

    hashtag
    Deployment and Advanced Topics

    Monday: Exploring Deployment Options

    • Objectives:

      • Learn about standard WordPress hosting solutions.

      • Compare AWS with managed WordPress hosting providers.

    • Activities:

      1. Research Hosting Providers:

        • Managed WordPress Hosts:

          • SiteGround:

    • Resources:


    Tuesday: Preparing for Deployment

    • Objectives:

      • Set up the chosen hosting environment.

      • Migrate the local WordPress site to the hosting server.

    • Activities:

      1. Set Up Hosting Environment:

        • Sign Up for Hosting:

          • Follow the sign-up process for your chosen hosting provider.

    • Resources:


    Wednesday: Securing and Optimizing the Site

    • Objectives:

      • Implement security best practices.

      • Optimize the site's performance.

    • Activities:

      1. Install SSL Certificate:

        • Use Let's Encrypt (if supported):

          • Access Control Panel:

    • Resources:


    Thursday: Final Adjustments and Presentation

    • Objectives:

      • Finalize the deployment of the WordPress site.

      • Prepare and deliver the final 20-minute presentation.

      • Allocate time for presentation preparation.

      • Engage in normal development activities.

    • Activities:

      1. Morning Development:

        • Finalize Deployment:

    • Resources:


    hashtag
    Additional Learning Opportunities and Resources

    • Advanced PHP Concepts:

      1. Learn Object-Oriented Programming (OOP):

        • Implement Classes and Objects in Your Plugin:

          • Refactor parts of your plugin to use classes.

          • Example Class Structure:

        • Benefits of OOP:

          • Encapsulation of functionality.

          • Easier maintenance and scalability.

        • Resources:

      2. Use Namespaces and Autoloading:

        • Organize Code Using Namespaces:

          • Add namespaces to your classes.

    • Security Best Practices:

      • Deep Dive into WordPress Security:

        • Further Hardening WordPress:

    Week of November 25th

    .NET Path

    This week focuses on deploying and testing the library management system, emphasizing comprehensive testing strategies and cloud deployment using AWS services.

    hashtag
    Core Topics

    Testing strategies and methodologies
  • AWS deployment architecture

  • CI/CD with GitHub Actions

  • Infrastructure as Code

  • Environment configuration management

  • Cloud service integration

  • hashtag
    Project Development Focus

    • Implementing unit tests

    • Creating integration tests

    • Setting up end-to-end testing with Cypress

    • Deploying to AWS EC2 and S3

    • Configuring CloudFront distribution

    • Setting up CI/CD pipelines

    • Writing deployment documentation

    hashtag
    Learning Objectives

    • Understanding different testing approaches

    • Implementing comprehensive test coverage

    • Managing cloud infrastructure

    • Setting up automated deployments

    • Configuring AWS services

    • Writing technical documentation

    PHP Path

    This week focuses on WordPress deployment, security, and optimization, covering hosting solutions, migration processes, and performance tuning.

    hashtag
    Core Topics

    • WordPress hosting options

    • Site migration and deployment

    • Security implementation

    • Performance optimization

    • DNS configuration

    • Project documentation

    hashtag
    Project Development Focus

    • Selecting appropriate hosting solutions

    • Migrating WordPress installations

    • Implementing SSL certificates

    • Setting up security measures

    • Optimizing site performance

    • Configuring DNS settings

    • Creating project documentation

    hashtag
    Learning Objectives

    • Understanding WordPress deployment options

    • Implementing security best practices

    • Optimizing WordPress performance

    • Managing DNS and domains

    • Creating technical documentation

    • Presenting project outcomes

    Visit SiteGround WordPress Hostingarrow-up-right.

  • Note features like WordPress-specific optimizations, staging environments, and support.

  • Bluehost:

    • Visit Bluehost WordPress Hostingarrow-up-right.

    • Check for one-click WordPress installs, free domain, and SSL certificate.

  • WP Engine:

    • Visit WP Enginearrow-up-right.

    • Explore managed hosting features like advanced security, global CDN, and development environments.

  • Features to Consider:

    • Performance Optimization:

      • Server configurations.

      • Use of caching technologies.

      • CDN availability.

    • Security Features:

      • SSL certificates.

      • Malware scanning.

    • Customer Support:

      • Availability of 24/7 support.

      • Support channels (chat, phone, email).

    • Pricing Plans:

      • Monthly vs. annual pricing.

      • Introductory offers and renewal rates.

  • Understand Benefits of Managed Hosting:

    • Ease of Use:

      • Simplified setup processes.

      • Pre-configured WordPress environments.

    • Performance:

      • Servers optimized specifically for WordPress.

      • Built-in caching and performance enhancements.

    • Security:

      • Regular security updates.

      • Proactive monitoring for vulnerabilities.

  • Compare with AWS:

    • AWS Flexibility:

      • Ability to customize server environments.

      • Scalability options.

    • Complexity:

      • Requires knowledge of server management.

      • Setup can be more time-consuming.

    • Cost Considerations:

      • Potentially lower costs at scale.

      • Pay-as-you-go pricing model.

  • Decide on Hosting Solution:

    • Factors to Consider:

      • Learning Objectives:

        • Do you want to learn server management alongside WordPress?

      • Budget Constraints:

        • What is the acceptable cost per month/year?

      • Time Available for Setup:

        • Is there time to manage servers, or is a managed solution preferable?

    • Make a Decision:

      • Choose the hosting provider that best fits your project needs.

  • Best Managed WordPress Hosting Providersarrow-up-right

    Note down important details like login credentials, server IP, and nameservers.

  • Set Up Domain (if applicable):

    • Register a Domain:

      • If you need a new domain, register one through your hosting provider or a domain registrar like Namecheaparrow-up-right.

    • Update Nameservers:

      • Point your domain to your hosting provider's nameservers.

  • Export Local Database:

    • Use phpMyAdmin:

      • Access phpMyAdmin via http://localhost/phpmyadmin/.

      • Select your WordPress database (e.g., wordpress_db).

      • Click on the Export tab.

      • Choose the Quick export method and format as SQL.

      • Click Go to download the database export file.

  • Import Database to Server:

    • Access Server's phpMyAdmin:

      • Log in to your hosting account's control panel (e.g., cPanel).

      • Open phpMyAdmin from the control panel.

      • Create a new database (e.g., yourusername_wpdb).

      • Create a new database user and assign it to the database with all privileges.

      • Select the new database.

      • Click on the Import tab.

      • Choose the SQL file exported earlier and click Go to import.

  • Upload WordPress Files:

    • Use FTP Client (e.g., FileZilla):

      • Install FileZilla: If not already installed, download from FileZillaarrow-up-right.

      • Connect to the Server:

        • Host: Your domain or server IP.

        • Username: Your FTP username.

        • Password: Your FTP password.

      • Upload Files:

        • Navigate to the public_html or www directory on the server.

        • Upload all files and folders from your local WordPress directory.

  • Configure wp-config.php:

    • Update Database Credentials:

      • Open wp-config.php in a text editor.

      • Update the following lines with your server database credentials:

    • Update Site URLs:

      • Add the following lines to temporarily define site URLs:

  • Test the Site:

    • Access the Site via Browser:

      • Navigate to http://yourdomain.com.

      • Check if the site loads correctly.

    • Troubleshoot Issues:

      • Common Issues:

        • Database connection errors.

  • Editing wp-config.php (Official Docs)arrow-up-right

    Go to your hosting control panel.

  • Find SSL/TLS Settings:

    • Locate the SSL/TLS or Let's Encrypt option.

  • Install SSL Certificate:

    • Follow the prompts to install a free SSL certificate for your domain.

  • Force HTTPS:

    • Update .htaccess File:

      • Add the following code at the top of your .htaccess file to redirect all traffic to HTTPS:

    • Update WordPress Settings:

      • In the WordPress admin dashboard, go to Settings > General.

      • Update WordPress Address (URL) and Site Address (URL) to use

  • Set Up Security Plugins:

    • Install Wordfence Security Plugin:

      • In the WordPress admin dashboard, go to Plugins > Add New.

      • Search for "Wordfence Security".

      • Install and activate the plugin.

    • Configure Wordfence:

      • Follow the setup wizard.

      • Enable firewall and scan options.

  • Implement Caching for Performance:

    • Install WP Super Cache Plugin:

      • Go to Plugins > Add New.

      • Search for "WP Super Cache".

      • Install and activate the plugin.

    • Configure Caching Options:

      • Go to Settings > WP Super Cache.

      • Enable Caching.

    • Advanced Settings (Optional):

      • Configure CDN support if using a CDN.

      • Enable compression.

  • Optimize Images and Assets:

    • Install Smush Image Compression Plugin:

      • Go to Plugins > Add New.

      • Search for "Smush".

      • Install and activate the plugin.

    • Bulk Optimize Images:

      • Go to Media > Bulk Smush.

      • Optimize existing images.

    • Enable Automatic Optimization:

      • Configure settings to automatically optimize images on upload.

    • Minify CSS and JavaScript with Autoptimize:

      • Install and activate the "Autoptimize" plugin.

      • Go to Settings > Autoptimize.

  • Check Site Performance:

    • Use GTmetrix:

      • Visit GTmetrixarrow-up-right.

      • Enter your site URL and analyze.

    • Use Google PageSpeed Insights:

      • Visit .

      • Enter your site URL and analyze.

    • Review Recommendations:

      • Identify areas for improvement.

      • Implement suggestions as feasible.

  • Caching and Performance (Official Docs)arrow-up-right

    Double-Check Functionality:

    • Test all site features, including custom theme and plugin functionalities.

  • Fix Any Remaining Issues:

    • Address any bugs or errors found during testing.

  • Perform Final Testing:

    • Cross-Browser Testing:

      • Test the site on multiple browsers (Chrome, Firefox, Edge, Safari).

    • Mobile Responsiveness:

      • Test the site on mobile devices or use browser developer tools.

  • Presentation Preparation (1 hour):

    • Summarize Project Journey:

      • Outline the project's objectives, progress, and outcomes.

    • Prepare Presentation Materials:

      • Create slides highlighting key features.

      • Include screenshots and code snippets where appropriate.

      • Prepare a live demo of the deployed site.

    • Rehearse:

      • Practice the presentation to ensure it fits within the 20-minute time limit.

  • Deliver the Presentation (20 minutes):

    • Presentation Structure:

      • Introduction:

        • Briefly introduce yourself and the project.

      • Project Overview:

        • Discuss the project's goals and scope.

      • Demonstration:

        • Showcase the live site.

        • Navigate through key features.

      • Technical Deep-Dive:

        • Explain complex components.

        • Show relevant code snippets.

      • Conclusion:

        • Summarize accomplishments.

        • Mention possible future improvements.

    • Engage with the Audience:

      • Invite questions and feedback.

  • Afternoon Development:

    • Implement Feedback:

      • Address any immediate feedback from the presentation.

    • Begin Project Documentation:

      • Start compiling user guides and technical documentation.

  • Implement PSR-4 Autoloading:
    • Use Composer for autoloading classes.

      • Install Composer:

        • Download from getcomposer.orgarrow-up-right.

      • Create composer.json:

      • Run Composer Dump-Autoload:

      • Include Autoloader in Plugin:

  • Resources:

    • Composer Autoloadingarrow-up-right

    • Namespaces in PHParrow-up-right

  • Change default table prefixes.

  • Disable file editing from the admin dashboard.

  • Limit login attempts.

  • Stay Updated:

    • Regularly update WordPress core, themes, and plugins.

  • Resources:

    • Hardening WordPress (Official Docs)arrow-up-right

    • WordPress Security Whitepaperarrow-up-right

  • WordPress Hosting Options (WPBeginner)arrow-up-right
    Deploying WordPress on AWS (AWS Docs)arrow-up-right
    Migrating WordPress Sites (Official Docs)arrow-up-right
    File Transfer via FTP (FileZilla Guide)arrow-up-right
    WordPress Security Guide (Wordfence Blog)arrow-up-right
    SSL for WordPress (Let’s Encrypt Guide)arrow-up-right
    Tips for Effective Technical Presentationsarrow-up-right
    Live Demo Best Practicesarrow-up-right
    PHP OOP Conceptsarrow-up-right
    // Add to wp-config.php
    define('DISALLOW_FILE_EDIT', true);
    <?php
    class Event_Manager {
      public function __construct() {
        add_action( 'init', array( $this, 'register_custom_post_type' ) );
      }
    
      public function register_custom_post_type() {
        // Registration code here
      }
    
      // Additional methods
    }
    
    $event_manager = new Event_Manager();
    ?>
    <?php
    namespace MyPlugin;
    
    class Event_Manager {
      // Class code
    }
    ?>

    schedule


    layout: schedule schedule: monday: # - name: Build # start: 10:00 # end: 13:00 # type: project # - name: Thought of the Week # url: https://www.notion.so/foundersandcoders/Personal-Development-91fe75c7e2cc4f989954108729a2c834 # type: personal-development # start: 14:00 # end: 14:45 # - name: Build # start: 14:45 # end: 17:45 # type: project # - name: Check out # start: 17:45 # end: 18:00 tuesday: # - name: Build # start: 10:00 # end: 12:45 # type: project # - name: Role circles # start: 12:45 # end: 13:00 # url: https://foundersandcoders.notion.site/Role-circles-a2371aab24f34955a69904b87ffc1f05 # - name: Build # start: 14:00 # end: 16:00 # type: project # - name: Update READMEs # start: 16:00 # end: 16:15 # - name: Team code review # start: 16:15 # end: 17:45 # url: https://foundersandcoders.notion.site/Code-Reviews-5c3b987ed1204e46b4c738da538a758c wednesday: # - name: Web Science # start: 10:00 # end: 11:00 # type: presentation # - name: Build # start: 11:00 # end: 13:00 # type: project # - name: Build # start: 14:00 # end: 17:45 # type: project - name: Apprenticeship Training EPA type: thought url: https://docs.google.com/presentation/d/1phpxhz6laAZcph84D04u02QaBEeKJ_U_1VLqDNV3hjo/edit#slide=id.g25ece6437ef_0_0 start: 10:30 end: 10:45 thursday: # - name: Update READMEs # start: 10:00 # end: 10:15 # - name: Sprint Review # start: 10:15 # end: 11:45 # - start: 11:45 # end: 13:00 # name: Presentation prep # url: https://foundersandcoders.notion.site/In-House-Project-Presentation-e1936ce95a8041b9b8a93e5d4f638ff6 # - name: Project documentation # start: 15:30 # end: 16:00 friday:

    hashtag
    - name: Progress Log Review

    hashtag
    start: 10:00

    hashtag
    end: 11:30

    hashtag
    type: expert-feedback

    hashtag
    - name: Consolidation day

    hashtag
    start: 11:30

    hashtag
    end: 18:00

    hashtag
    ---

    Firewall protection.

    Port: Usually 21.

    Missing files or permissions errors.
  • Solutions:

    • Double-check database credentials in wp-config.php.

    • Ensure all files are uploaded.

    • Check file permissions (usually folders 755, files 644).

  • https://
    .
    Configure login security settings.
    Choose Simple caching method.
    Enable options to optimize HTML, JavaScript, and CSS.
    Highlight custom theme and plugin functionalities.
    Discuss challenges and how you overcame them.
    PageSpeed Insightsarrow-up-right
    define('DB_NAME', 'yourusername_wpdb');
    define('DB_USER', 'your_db_username');
    define('DB_PASSWORD', 'your_db_password');
    define('DB_HOST', 'localhost'); // Often 'localhost', check with your host
    define('WP_HOME','http://yourdomain.com');
    define('WP_SITEURL','http://yourdomain.com');
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
    {
      "autoload": {
        "psr-4": {
          "MyPlugin\\": "src/"
        }
      }
    }
    composer dump-autoload
    require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';

    Spikes

    There are no defined spikes for this week.

    You may find that you need to manage spikes within your sprints. Remember to follow .

    You're encouraged to continue role circles with those who are playing the same role as you.

    the techniques you followed earlier in the programmearrow-up-right