Camagru is a simple image editing and posting web-app similar to instagram. I created this in order to learn how to build a website.
For installation on your local system follow these instructions.
- Install requirements for your system.
- Clone the repository into the htdocs folder of Wamp, Lamp or Mamp. From now on we will reffer to the cloned folder name as "Camagru"
- configure the php.ini file to send emails
- Enter database credentials into config/database.php.
- Navigate to localhost/Camagru/config/setup.php to create the database.
- Navigate to localhost/Camagru/modal/addSticker.php. There will be a single text field.
- Input an absolute path to a local image file that will be uploaded as a sticker and press enter.
- Repeat step 7 for all stickers you wish to upload.
The server should now be up and running in full.
It is recommended to run these tests once the server is set up in order to ensure that everything is working properly
- Navigate to localhost/Camagru/
- Click signup and create an account. make sure to use a valid email address
- Check your inbox for a verification email and verify your account. If you do not recieve one check that you have configured your php.ini and hmail server correctly
- Log in to your account.
- click on Camagru in the top left corner and attempt to take a photo.
- Select a sticker and enter a title.
- click post
- Comment on, and like your post, then refresh. If the comment and like are still present all is well.
- Attempt to delete the post.
- Lastly log out and test the signup and login forms with erronious data
- The webpage should load.
- The account should appear in the database.
- You should recieve an email and once you follow the link you should see a page stating that your account is verified
- your username should appear in the top-right corner
- a screen should appear with a preview of your webcam. this preview should be replaced with an image once you take the photo.
- the sticker should appear over your image.
- the feed should load with your new post at the top
- Your comment should appear on the post after a refresh
- the post should disappear
- Invalid emails, incorrect credentials and short/simple passwords should be caught
If all these steps passed then the website is fully functional
In addition here is the marking sheet for the project
The files in this project are split into 4 main categories:
- config: These are files used for the setup of the website. Not for users.
- control: These are .js files that contain all the client-side functionality of the website.
- modal: These are server-side .php files that handle modification of the database and retrieval of information
- view: These are .php files that render out into webpages and are sent to the user. AKA the frontend.
The flow of the webite is as follows:
- The user navigates to the website and requests a view. (home, gallery, profile...)
- The server checks privilages and either returns the view or the user is rerouted.
- The returned html requests the required control files.
- The user interacts with the website.
- The control files send post requests with the relevant information to modal files.
- The modal files update the database accordingly and return relevant information
- The control files update the webpage with the new information
- repeat steps 4 through 7 until the user navigates away or to a different view
The database is structured as follows:
int
id (primary key)varchar(255)
email (unique)varchar(40)
username (unique)tinyint(1)
active (has the user confirmed their email?)varchar(1000)
password (the user's hashed password)timestamp
creationDatevarchar(1000)
verif (a token to validate the user's email with)tinyint(1)
notify (does the user want notifications?)
int
id (primary key)varchar(255)
path
int
id (primary key)varchar(255)
pathint
uploaderID (foreign key tousers
.id
)timestamp
creationDatevarchar(255)
description
int
uploaderID (foreign key tousers
.id
)int
postID (foreign key toposts
.id
)
int
id (primary key)int
uploaderID (foreign key tousers
.id
)int
postID (foreign key toposts
.id
)timestamp
creationDatevarchar(1000)
content