project
.NET
Intro
Learners with build a library in which to sort and share information (i.e. music, photos, recipes etc...). Potential users should be able to view, favourite and upload items as well as make collections and view ones created by other users.
The frontend of this project will be built using React. For the backend, it will use ASP.NET to handle server-side functionality. User accounts and item lists will be stored in a PostgreSQL or SQLite database.
Project
Your project for the next 3 weeks will be to develop a .NET backend connected to a database and linked to a React frontend. This week you should start by building the backend and testing it with Swagger (.NET equivalent to Postman). Tests should cover the creation users and endpoints related to user content.
Spike
Like the last project you will benefit by building a scheme for your database before you start. Hopefully with what you learned from last projects you are ready to think about how things will connect and consider what sorts of endpoints you will want. Finally, think about what you have done for stretch goals on previous projects and see if you can come up with a different sort of goal this time. For example if you've been stretching yourself by adding technical complexity try focusing on design or UX/UI instead.
Questions to consider
What endpoints will you need for your app?
What sort of classes will you need to match your data and how will these be represented in OOP (object orientated programming)?
Useful resources
User stories
As a user, I want to:
Login to an individual account
See my collections of items and favourites
Search and look at other users collections
View individual items details
Save items or collections from other users
Upload and add items
Stretch user stories
Follow other users
Make sure users can only edit their own collections and items
Stop duplicate items being uploaded
Suggest collections based on favourites
Repository naming convention
Please name your repo following this template: PRO05_Name1_Name2_Name3_Name4
Acceptance criteria
Stretch
PHP
Project Overview: Building a Custom WordPress Site with Theme and Plugin Development
Over the next three weeks, you will develop a fully functional WordPress website from scratch. Starting with setting up your local development environment, you'll create a custom theme tailored to your design preferences, incorporating dynamic content using The Loop and interactive elements with TypeScript. You'll then plan and build a custom plugin to add significant functionality to your site, such as an event manager or testimonials feature, utilizing custom post types, taxonomies, and AJAX for dynamic updates.
In the final week, you'll focus on deploying your site to a live hosting environment, implementing security best practices, and optimizing performance. By integrating your custom plugin with your theme, you'll create a seamless user experience. This project will enhance your proficiency in WordPress development and PHP programming, providing you with valuable skills and a portfolio-worthy website.
Foundations of WordPress and PHP
Monday: Setting Up the Development Environment
Objectives:
Set up a local server environment for WordPress development.
Install and configure WordPress locally.
Understand the WordPress file and folder structure.
Activities:
Download and Install WordPress Locally:
Download WordPress:
Get the latest version from the official website.
Set Up the Database:
Access
phpMyAdmin
viahttp://localhost/phpmyadmin/
.Create a new database (e.g.,
wordpress_db
).
Configure WordPress:
Extract WordPress files into the
htdocs
(XAMPP) orMAMP
directory.Rename
wp-config-sample.php
towp-config.php
.Edit
wp-config.php
with the database details:
Run the Installation Script:
Navigate to
http://localhost/wordpress/
and follow the installation prompts.
Explore WordPress File Structure:
Directories to Explore:
wp-content
: Holds themes, plugins, and uploads.wp-includes
: Core WordPress files.wp-admin
: Backend administration files.
Understanding Core Files:
Review
index.php
,wp-config.php
, and.htaccess
.
Review PHP Basics (If Needed):
PHP Syntax and Structure:
Variables, arrays, loops, functions.
Resources:
Tuesday: Introduction to WordPress Theme Development
Objectives:
Understand how WordPress themes work.
Begin developing a custom theme from scratch.
Activities:
Study the WordPress Template Hierarchy:
Understand the Hierarchy:
Learn how WordPress determines which template file to use.
Review the Template Hierarchy diagram.
Create a New Theme Directory:
Set Up Theme Folder:
Navigate to
wp-content/themes/
.Create a new folder for your theme (e.g.,
my-custom-theme
).
Develop Basic Theme Files:
style.css
:Add theme information at the top:
index.php
:Basic template file that WordPress uses by default.
Add a simple HTML structure:
header.php
andfooter.php
:Separate the header and footer sections.
header.php
:footer.php
:Include them in
index.php
usingget_header()
andget_footer()
functions:
Activate the Theme:
Through WordPress Admin:
Go to
Appearance > Themes
.Find and activate "My Custom Theme".
Use Template Tags and The Loop:
Display Posts:
Implement The Loop in
index.php
:
Wednesday: Advanced Theme Customization
Objectives:
Add features to the custom theme.
Integrate TypeScript for front-end interactivity.
Activities:
Create Custom Page Templates:
Make a Custom Template:
Create
page-custom.php
in your theme folder.At the top, add:
Modify the template as needed, for example:
Implement Custom Menus:
Register Menus in
functions.php
:Display Menus in Templates:
Add Widget Areas (Sidebars):
Register Sidebar in
functions.php
:Display Sidebar in Templates:
Set Up TypeScript Build Process:
Initialize NPM in Theme Folder:
Open a terminal in your theme directory and run
npm init -y
.
Install Dependencies:
Install Webpack and TypeScript:
Configure TypeScript:
Create
tsconfig.json
:
Set Up Webpack Config:
Create
webpack.config.js
:
Add Scripts to
package.json
:
Add Interactive Elements Using TypeScript:
Create
src/index.ts
:Example code:
Build and Include Script:
Run
npm run build
.Enqueue the script in
functions.php
:
Add an Element to Test Interaction:
In your template file (e.g.,
index.php
), add:
Thursday: Presentation Preparation and Delivery
Objectives:
Prepare and deliver a 20-minute presentation showcasing the custom theme.
Continue normal development activities.
Activities:
Morning Development:
Enhance Theme Features:
Refine your theme based on previous work.
Add any additional features or styling improvements.
Debug and Test:
Ensure all features are working as expected.
Test across different browsers and devices.
Presentation Preparation (1 hour):
Summarize Work Done:
Create an outline highlighting key features and customizations.
Prepare Presentation Materials:
Create slides if necessary.
Set up a live demo environment.
Rehearse:
Practice delivering the presentation within the time limit.
Deliver the Presentation (20 minutes):
Presentation Content:
Introduce your custom theme and its purpose.
Demonstrate key features and customizations.
Discuss challenges faced and solutions implemented.
Engage with the Audience:
Encourage questions and feedback.
Afternoon Development:
Implement Feedback:
Incorporate any useful suggestions received during the presentation.
Continue Development:
Proceed with the next planned activities.
Friday: Working with WordPress Database
Objectives:
Learn to interact with the WordPress database using PHP.
Understand data sanitization and security best practices.
Activities:
Using
$wpdb
for Database Queries:Global
$wpdb
Object:Access the database using
$wpdb
.
Retrieve Data:
Display Data in the Theme:
Create a custom template or modify an existing one to display the data.
Create a Custom Table:
Register Activation Hook:
Create a Form to Save Data:
Display Form Using Shortcode:
Handle Form Submission:
Display Submitted Data:
Create a shortcode or admin page to display the data from the custom table.
Understand Data Sanitization and Security:
Sanitize Inputs:
Use
sanitize_text_field()
,sanitize_email()
, etc.
Prevent SQL Injection:
Always prepare queries or use helper methods.
Use Nonces:
Protect against CSRF attacks by using nonces.
Escape Outputs:
Use
esc_html()
,esc_attr()
, etc., when outputting data.
Last updated