TicketLog is the place where you collect all your movie tickets in form of electronic movie tickets with options for styles and notes of your choice.
TicketLog is built using the following technologies:
- Front-end: React.js
- Back-end: Express.js
- Database: MariaDB
- Other Dependencies/Libraries: MUI and you can find others on package.js
Feature | Description |
---|---|
login/register |
register and login to the website |
update profile |
edit account data |
show all tickets |
show all the tickets of logged in user in the home page |
view ticket and note |
view a ticket detail and note of a ticket |
sort |
sort the shown tickets by created date, alphabet, ticket date |
search |
search the name of ticket |
create ticket |
create a ticket with information and choose ticket style |
create note |
create a note of a ticket |
update ticket and note |
edit the detail of ticket and note |
delete ticket |
delete a ticket |
show collection |
show the collection of tickets by year |

-
Clone the repository:
git clone https://github.com/minklim47/TicketLog.git
-
Install node modules for frontend :
cd ticketlog/client npm i
-
Install node modules for backend :
cd ticketlog/server npm i
Frontend -> ticketlog/client
npm run dev
Backend -> ticketlog/server
nodemon server.js
Parameter | Type | Description |
---|---|---|
success |
boolean |
status of request |
message |
string |
message for each request |
data |
JSON |
the actual data |
URL
POST /auth/login
Parameter | Type | Description |
---|---|---|
email |
string |
email address |
password |
string |
password must be at least 8 characters with uppercase letter, lowercase letter and number. |
Example
{
email: "minklim47@gmail.com",
password: "Password12300"
}
Response
200
login successful
Parameter | Type | Description |
---|---|---|
id |
int |
user id |
email |
string |
email address |
token |
string |
the token contains user id and email address |
Example
{
id: 1,
email: "minklim47@gmail.com",
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ..."
}
If success, the Response will be sent with cookie named user and token and userId will be store in localStorage
URL
POST /auth/register
Parameter | Type | Description |
---|---|---|
name |
string |
display name |
email |
string |
email address |
password |
string |
password must be at least 8 characters with uppercase letter, lowercase letter and number. |
location |
string |
location |
Example
{
name:"MinkLim",
email: "minklim47@gmail.com",
password: "Password12300",
location:"Bangkok"
}
Response
200
login successful
Parameter | Type | Description |
---|---|---|
id |
int |
user id |
email |
string |
email address |
token |
string |
the token contains user id and email address |
Example
{
id: 1,
email: "minklim47@gmail.com",
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ..."
}
URL
GET /auth/checklogin
Parameter | Type | Description |
---|---|---|
user |
string |
token "user" in the cookies |
Example
{
user: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ...""
}
Response
200
"User is logged in with ID: " +
decoded.userId +
" with email: " +
decoded.email,
URL
GET /user/:userId
Parameter | Type | Description |
---|---|---|
userId |
int |
user id |
Response
200
get logged in user successful
Parameter | Type | Description |
---|---|---|
id |
int |
user id |
name |
string |
display name |
email |
string |
email address |
location |
string |
location |
Example
{
id: 1,
name: "MinkLim",
email: "minklim47@gmail.com",
lcoation: "Bangkok"
}
URL
PATCH /user/:userId
Parameter | Type | Description |
---|---|---|
userId |
int |
user id |
name |
string |
display name |
location |
string |
location |
currentPassword |
string |
current password |
newPassword |
string |
new password |
Response
200
change information and/or password successful
URL
GET /ticket/home/:userId
Parameter | Type | Description |
---|---|---|
userId |
string |
user id |
Response
200
get tickets successful
in the data there is an array of object with properties below:
Parameter | Type | Description |
---|---|---|
id |
int |
ticket id |
title |
string |
ticket title |
cinema |
string |
cinema |
seat |
string |
seat number |
date |
string |
ticket date |
time |
string |
ticket time |
movie_id |
int |
id of a movie associated with the ticket |
is_private |
boolean |
the visibility of the ticket |
created_at |
datetime |
datetime the ticket is created at |
style |
string |
style of a ticket |
user_id |
int |
user id of ticket's owner |
Example
{
{
cinema: "aff",
created_at: "2023-06-01T08:43:01.000Z",
date: "2023-05-31T17:00:00.000Z",
id: 60,
is_private: 0,
movie_id: null,
seat: "asf",
style: "style-1",
time: "08:42:57",
title: "sfaf",
user_id: 56
}
}
URL
GET /ticket/:ticketId
Parameter | Type | Description |
---|---|---|
ticketId |
int |
ticket id |
Response
200
get ticket successful
in the data there is an array of object with properties below:
Parameter | Type | Description |
---|---|---|
id |
int |
ticket id |
title |
string |
ticket title |
cinema |
string |
cinema |
seat |
string |
seat number |
date |
string |
ticket date |
time |
string |
ticket time |
movie_id |
int |
id of a movie associated with the ticket |
is_private |
boolean |
the visibility of the ticket |
created_at |
datetime |
datetime the ticket is created at |
style |
string |
style of a ticket |
user_id |
int |
user id of ticket's owner |
Example
{
cinema: "aff",
created_at: "2023-06-01T08:43:01.000Z",
date: "2023-05-31T17:00:00.000Z",
id: 60,
is_private: 0,
movie_id: null,
seat: "asf",
style: "style-1",
time: "08:42:57",
title: "sfaf",
user_id: 56
}
URL
POST /ticket/
Parameter | Type | Description |
---|---|---|
title |
string |
ticket title |
cinema |
string |
cinema |
seat |
string |
seat number |
date |
string |
ticket date |
time |
string |
ticket time |
isPrivate |
boolean |
the visibility of the ticket |
selectedStyle |
string |
style of a ticket |
userId |
int |
user id of ticket's owner |
note |
JSON |
note object of the ticket |
body of note
Parameter | Type | Description |
---|---|---|
title |
string |
note title |
content |
string |
note content |
Response
200
create ticket successful
in the data there is an array of object with properties below:
Parameter | Type | Description |
---|---|---|
ticketId |
int |
ticket id |
noteId |
int |
note id |
Example
{
ticketId: 1,
noteId: 1
}
URL
PATCH /ticket/:ticketId
Parameter | Type | Description |
---|---|---|
ticketId |
int |
ticket id |
updates |
JSON |
object of updated ticket properties |
note |
JSON |
object of updated note properties |
body of updates
Parameter | Type | Description |
---|---|---|
title |
string |
ticket title |
cinema |
string |
cinema |
seat |
string |
seat number |
date |
string |
ticket date |
time |
string |
ticket time |
isPrivate |
boolean |
the visibility of the ticket |
selectedStyle |
string |
style of a ticket |
body of note
Parameter | Type | Description |
---|---|---|
title |
string |
note title |
content |
string |
note content |
ticketId |
int |
ticket id |
Response
200
ticket and note update successful"
URL
DELETE /ticket/:ticketId
Parameter | Type | Description |
---|---|---|
ticketId |
int |
ticket id |
Response
200
ticket id ${ticketId} deleted successful
URL
GET /note/:ticketId
Parameter | Type | Description |
---|---|---|
ticketId |
int |
ticket id |
Response
200
get note of ticket ${ticketId} successful
in the data there is an array of object with properties below:
Parameter | Type | Description |
---|---|---|
id |
int |
note id |
title |
string |
note title |
content |
string |
note content |
ticket_id |
string |
ticket id |
Example
{
id: 20,
title: "The best movie ever!"
content: "This movie deserve an oscar, yes, the movie I'm talking about is เสือเผ่น๑",
ticket_id: 61
}