The Camagru Project
The Camagru Project
The Camagru Project
Pedago pedago@42.fr
coton coton@42.fr
Summary: The goal of this project is to build a web application a little more complex
than the previous ones with a little less means.
Contents
I Forewords 2
II Introduction 3
III Objectives 4
IV General instructions 5
V Mandatory Part 6
V.1 Common features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
V.2 User features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
V.3 Gallery features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
V.4 Editing features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
V.5 Constraints and Mandatory things . . . . . . . . . . . . . . . . . . . . 9
VI Bonus part 10
1
Chapter I
Forewords
History of communication is as old as the history of Humanity and Mankind has managed
to evolve it along centuries throughout incredible revolutions.
The Paris-Lille line was operational the same year and allows transmissions between
the two cities at a speed of 9 minutes per letter throughout 15 towers. Obviously, trans-
mission time depends of its length.
In 1844, 534 towers were dispersed on the French territory linking on more than
5000km, the most important cities.
But, this system had 2 big disadvantages: it couldn’t be functionnal by night because,
obviously, of the bad visibility, and the number of operators per tower (2 every 15 km).
2
Chapter II
Introduction
Now you are ready to build your fist web applications, like pros. If you didn’t mind, the
web is a vast and rich world, allowing you to release quickly data and content to everyone
around the world.
Now you know the basics, here comes the time to leave those old fashioned to-do lists
and eBusiness websites, and fly away toward bigger projects.
Also, here comes the time for you to discover new notions and the beauty of :
• Responsive design
• DOM Manipulation
• SQL Debugging
• ...
3
Chapter III
Objectives
This web project is challenging you to create a small web application allowing you to
make basic photo and video editing using your webcam and some predefined images.
We will, for instance, picture the precise moment of an intergalactical cat launch,
here’s the evidence:
App’s users should be able to select an image in a list of superposable images (for
instance a picture frame, or other “we don’t wanna know what you are using this for”
objects), take a picture with his/her webcam and admire the result that should be mixing
both pictures.
4
Chapter IV
General instructions
• This project will be corrected by humans only. You’re allowed to organise and name
your files as you see fit, but you must follow the following rules.
• You’ll have to submit a file called author containing your login followed by a newline
at the root of your repository.
$> cat -e author
xlogin$
• Your web application must produce no errors, no warning or log line in any console,
server side and client side. Nonetheless, due to the lack of HTTPS, any error related
to getUserMedia() are tolerated.
• You must use ony PHP language to create your server-side application, with just
the standard library.
• Every framework, micro-framework or library that you don’t create are totally
forbidden, except for CSS frameworks that doesn’t need forbidden JavaScript.
• You must use the PDO abstraction driver to communicate with your database,
that must be queryable with SQL. The error mode of this driver must be set to
PDO::ERRMODE_EXCEPTION
• Your application must be free of any security leak. You must handle at least cases
mentioned in the mandatory part. Nonetheless, you are encouraged to go deeper
into your application’s safety, think about your data’s privacy !
• You are free to use any webserver you want, like Apache, Nginx or even the built-in
webserver1 .
• Your web application should be at least be compatible with Firefox (>= 41) and
Chrome (>= 46).
1
http://php.net/manual/en/features.commandline.webserver.php
5
Chapter V
Mandatory Part
Your website should have a decent page layout (meaning at least a header, a main section
and a footer), be able to display correctly on mobile devices and have an adapted layout
on small resolutions.
All your forms should have correct validations and the whole site should be secured.
This point is MANDATORY and shall be verified when your application would be eval-
uated. To have an idea, here are some stuff that is NOT considered as SECURE:
6
Web The Camagru Project
• At the end of the registration process, an user should confirm his account via a
unique link sent at the email address fullfiled in the registration form.
• The user should then be able to connect to your application, using his username
and his password. He also should be able to tell the application to send a password
reinitialisation mail, if he forget his password.
• The user should be able to disconnect in one click at any time on any page.
• Once connected, an user should modify his username, mail address or password.
• When an image receives a new comment, the author of the image should be notified
by email. This preference must be set as true by default but can be deactivated in
user’s preferences.
• The list of images must be paginated, with at least 5 elements per page.
7
Web The Camagru Project
This part should be accessible only to users that are authentified/connected and gen-
tly reject all other users that attempt to access it without being successfully logged in.
• A main section containing the preview of the user’s webcam, the list of superposable
images and a button allowing to capture a picture.
• A side section displaying thumbnails of all previous pictures taken.
• Superposable images must be selectable and the button allowing to take the pic-
ture should be inactive (not clickable) as long as no superposable image has been
selected.
• The creation of the final image (so among others the superposing of the two images)
must be done on the server side, in PHP.
• Because not everyone has a webcam, you should allow the upload of a user image
instead of capturing one with the webcam.
• The user should be able to delete his edited images, but only his, not other users’
creations.
8
Web The Camagru Project
• Authorized languages:
◦ [Server] PHP
• Authorized frameworks:
◦ [Server] None
• A index.php file, containing the entering point of your site and located at the root
of your file hierarchy.
<?php
$DB_DSN = ...;
$DB_USER = ...;
$DB_PASSWORD = ...;
DSN (Data Source Name) contains required information needed to connect to the
database, for instance ’mysql:dbname=testdb;host=127.0.0.1’. Generally, a DSN is
composed of the PDO driver name, followed by a specific syntax for that driver. For
more details take a look at the PDO doc of each driver1 .
1
For more info see the documentation of the PDO constructor
9
Chapter VI
Bonus part
If the required part is done entirely and perfectly, you can add any bonus you wish; They
will be evaluated by your reviewers. You should however still respect the requirements
in the bonus parts (i.e. image processing should be done on server side).
• Propose a live preview of the edited result, directly on the webcam preview. We
should note that this is much easier than it looks.
10
Chapter VII
Submit your work on your GiT repository as usual. Only the work on your repository
will be graded.
The following requirements are evaluated in the scale. Be very attentive and consider
them carefully as they will be sanctioned by a 0 (zero) if not respected.
11