A full stack php application that manages user authentication, registration, login and even password forgotten.
Technologies/tools/languages used :
- Table of contents
- Overview
- Login Page
- Register Page
- Home Page
- Profile Tab
- Log out Tab
- Space Calculator ๐
- Comprehensive Weather app โก๐๐ช
- Full snake Game ๐
- Tic tac Toe โญโ
- Shifumi game โ๐๐
- Images slider ๐ผ
- Dynamic Stopwatch โฑ
- New York Simple Clock โ
- Classic To do List ๐
- Forgotten Password Management
- Installation : Run locally
- Project Roadmap
This project is initially an exercise to practice Php, Ajax, Tailwindcss, Typescript and sass in a real life application like. It has 3 major pages:
As database, for the registration, login, and other utilities, I used PostgreSQL. On the home page, I added my main projects I built when I was learning JavaScript :
- Space Calculator ๐
- Comprehensive Weather app โก๐๐ช
- Full snake Game ๐
- Tic tac Toe โญโ
- Shifumi game โ๐๐
- Images slider ๐ผ
- Dynamic Stopwatch โฑ
- New York Simple Clock โ
- Classic To do List ๐
Because I used tailwindcss CLI, I put SASS in the project for a more pragmatically way to write CSS (especially mixins)
A fully responsive login page with a purple design.
- This page have two many fields :
- Username
- password (has hide/show password)
- A forgot (link to the forgotten password section) password link that lead to another page to reset the password
- A link to send the user to the register page if he is not registered yet
As the login page, it is also responsive and will adapt depending of your screen.
-
Here, three fields:
- Email address
- Username
- Password (at least 8 characters) and also hide/show ๐ option
-
A link to the login page if the user has already signed in
Responsive (naturally). The purple design is kept.
-
A navbar that will change depending of the screen you have.It has 5 tabs :
- Home ๐
- Profile ๐ค
- Tools โ
- About
- Log out
On big screens (width >= 640px), it will be a normal navbar horizontal.
On small screens, it is a menu burger that displays a vertical navbar.
- The main title has an animation of cursor typing. It loops infinitely
- A bouncing button that leads to the project grid
- Project grids : all my JS projects are displayed as a grid of card.
- A logout button. It opens a dialog that ask the user to confirm the logout
- A "back to top" button able to scale depending of the user's screen width.
This tab is quite special, it will open a dialog that make a brief recap of the user current stats. Here are the stats shown :
- Username
- Number of visits : this counter will increment each time you visit the main page
- Best Score at snake game
- Best Score at Rock-Paper-Scissors game (shifumi)
- And also the date
It behaves exactly like the logout button at the bottom of the page
A calculator with a good-looking design that performs basic operations : addition, substraction, multiplication, division
As a personal touch, I added a clock on the top of the calculator (the clock).
If you click on it, it will change and display the date in DD/MM/YYYY format. Click an another time to go back to default state.
A readaptation of my weather app project on github(link). Enter the name of the city and GO ! A simple design with animated icons to add some style. List of all parameters rendered when you query a city :
- Location (city, town, ...) & Country
- Temperature in Celsius degrees
- Feels Like also in Celsius degrees
- Humidity
- Wind Direction
- Speed Direction
- Description (clear sky, rainy, foggy, ...)
- The date and time at the place queried
A complete snake game with many features. You can choose one between three levels of difficulty : easy, normal and hard
Here, audios are integrated. Different sounds will play (start, movement, eating, lose). If you lose, an another dialog will open
And ask you if you want to replay. Your best score will be registered, store in the database and shown, as I mentioned before, in your profile dialog. It is not responsive, so you need a screen at least 600 px large.
Tic tac toe game, but with swipe SFX. Play and admire the bright city behind you.
This game need two players. When one of them wins, a dialog will popup and ask for retry or quit the game.
Rock Paper Scissors game against the Computer. Purple design is back.
The rules are simple : to win, your score must be higher than computer's score. You can stop a any moment by pressing the "Quit game" button. A dialog (another one) will popup and ask you to confirm.
Similarly to the snake game, your best score will be registered in the database and shown on the home page in the user's profile
Welcome in my short collection of city images.
You can stop the scrolling effect by clicking on the admire button. To navigate through the slider, you can use the arrow buttons or directly the LEFT and RIGHT arrow key. This project is fully responsive.
A stopwatch with three (3) main options:
- Start
- Pause
- Reset
Lighting effect when you hover the clock image.
A simple clock that display :
- current time code HH:MM:SS and you can add the milliseconds
- A greeting depending of the moment of the day
- The date on, the format DayOfWeek Month Day Year
- an option to show or hide milliseconds
The classic
On the login page you have the option Forgot password
Click on it and you will be redirected to a page that asks you your email address. Provide it and submit. You will receive an email Friedrich Corner that gives you a code to reset the password.After entered the right code, you will be redirected to the last page that needs the new password. Confirm it and submit.
You will be back on the login page. Congratulations, your password has been reset.
You can run the project locally. Start by cloning the repository with the command :
git clone https://github.com/Friedrich482/php-fullstack-app.git
After install the npm dependencies via :
npm install
Also install php on your local machine.
You will need a local server. Because it is PHP, I recommend you applications like MAMP or XAMPP. They will install a local Apache Server to serve the project. Personally I prefer MAMP.
After that, you also need PHP dependencies installed via Composer. Install them with the command :
composer update
Then run by opening the login
folder and open the login.php
file.
If you are running the project locally, you will need to create two .env files
based on the .env.example files in the login
and the include
folders.
-
login folder :
mailUsername = "example@gmail.com" # The email address goes here mailPassword = "xxxx xxxx xxxx xxxx" # Your code for smtp server mailAddress = "example@gmail.com" # The email address also goes here mailName = "example Example" # Your email username
I need to add some precisions here. In fact, I used the PHPMailer package in order to send mail for the reset password option. To run in local, you'll need tour own SMTP Server. Create one using Gmail. And fill the template with the data specified.
- include folder :
dbServer = "localhost"
dbUser = "postgres" # This is the username by default with a postgres database
dbPass = "password" # The password for your database goes here
dbName = "users_data" # The database name, I named it users_data
And also there is a apiKey.example.json
file in the projects/fetch-weather-app
{"API_KEY" : "YOUR_OPENWEATHER_MAP_API_KEY"}
I used a key from openweathermap.org. So to run
locally, you'll need your own key. Go there and subscribe (it is free) to get
yours. After come back and just rename the apiKey.example.json
into apiKey.json
and paste your API key inside.
You need to have postgreSQL installed. Create a database called users_data.
After that you'll need to create a table called users
I put the .sql file in the database
folder
-
Add a forgot password ๐
-
I need two pages here :
- The first one to ask the email to the user
- The second one will be a page to say him that a mail has been sent to him and to check his mails. He will now fill
- two fields and pass only if the two passwords matches.
-
Inside the forgot password, I will ask your email address
-
Then send a random number with 6 digits (so between 100000 and 999999)
-
The user will enter that number and will pass only if the number matches. After that the number will be put to zero in the DB.
-
For the registration, I will do the same thing. -
a nice animation to the welcome message ๐ when logging or registering. It needs to be multicolor and chars will display one after the other
-
a navbar (if possible) on the home page
-
the tools will be classified by category : game ๐ฎ, weather app โ, calculator ๐ฉ, to do-list, and so on -
All the games and utilities as
flexgrid ๐ช elements (and their behavior should be responsive) (Here improvements are coming ) -
a different page for each tool
-
the background image may change depending of the moment of the day : sunrise ๐ , day โ, sunset ๐, night ๐(canceled) -
The counter of visits will be attached to an other element (possibly the navbar, and so it will no more be so messy positionned) -
I should think to make the footer ๐ฆถ mobile (animation ๐) -
display the time in the navbar, eventually -
The time will now appear in the Profile tab.
-
the to-do-list must use the LocalStorage
-
For the log out, a dialog ๐ฌ should pop up ( maybe a blur effect will be interesting, in background )
-
The navbar should contain profile with infos about user, tools ( in many sections ) and logout
-
The infos like counter of visits will be in Profile
-
The "go back to top" button may be set as fixed element, so it will display at the bottom of the page as soon as we quit the top
-
If we click on the DOM elements that have the notification ping, it disappears and for the Profile sections, a dialog ๐ฌ will open and display infos about the users
-
If the user has already checked the one of the ping elements(especially the logout elements for the small and large screens navbars), if he reduce or increase the size of his screen and so, for example the display for small or large sreens occurs, the ping WILL NO LONGER BE PRESENT
-
Added the simple calculator file
-
Add Typescript instead of vanilla JavaScript for the calculator
-
Add Typescript instead of vanilla JavaScript for the home page
-
Correct all the errors for the home.ts page
-
Now the next mission is to add ts for the login page
-
And correct all the (potential) errors
-
And after that the register page
-
And there too, fix every single squiggled line
-
Now it is the turn of the weather app. This is probably the biggest ๐ช refactor of all
-
Firstly, let's use tailwindcss in the project
-
And after typescript
-
By the way refactor the structure of the page for a better experience
-
Turn of the snake game
-
Much easier because it has less code
-
The same : tailwindcss first
-
And after typescript
-
Disable the buttons on the the when the player is focused on the game. What I want to say is that if the game starts, the movement buttons can't interact with other parts of the page -
Open a dialog when the player arrives to ask him level of difficulty. They will be ranked in :
- easy
- normal
- hard ๐ช
-
For each level of difficulty, the speed of the snake will increase. Add that into the setInterval method by changing the snakespeed
-
While the player restarts the game and the countdown is displayed, the restart button (Enter key or Restart Button itself) must be disabled to avoid time intervals overlapping
-
My other idea is to play a song when:
- You lose
- You eat a food
- You change direction
- Game over
- []
You beat your own high score (PHP needed)
-
Now the Tic Tac Toe Game...
-
As always tailwind CSS first
-
And after TypeScript
-
Maybe here too, I will add sounds ๐ต
-
The 5th project is the shifumi game. Also not too much code...
-
Tailwind CSS
-
TypeScript
-
After the images slider project
-
Tailwind CSS
-
TypeScript
-
The stopwatch is the following project
-
Like always:
- Tailwind CSS
- Typescript
-
New york clock : all the habitual stuff
-
To do list : the same thing here
-
improve LightHouse score on each single page of the app:
- replace the rocket gif image by another one
- replace all images by their .avif of .webP version
-
The app will be deployed by default on vercel
-
Todo : add the lighthouse score for the main pages
This list will be updated depending on my progression through it.