- Project context
- Contributors
- My contributions
- Demo and screenshots
- Installation
- Usage
- Initialisation of the database
- To see the postgres database
Pair project for Semester 6 Web Programming course in 2023-2024 at Université Paris Cité (Campus Grands Moulins). The project is about creating a loyalty card system for a retro video game store. The project is divided into two parts: the client side and the manager side. The client side allows customers to view their transactions, points, and available gifts. The manager side allows the manager to manage clients, gifts, and transactions.
This project is developed using the following technologies:
- Front-end: HTML, CSS, JavaScript, EJS, Bootstrap
- Back-end: Node.js, Express.js
- Database: PostgreSQL
Nom | Prénom |
---|---|
RAOUL | Théo |
SELVAKUMAR | MATHUSAN |
- Project setup
- Database setup
- Home page (Front-end and Back-end)
- Client login page (Front-end and Back-end)
- Manager login page (Front-end and Back-end)
- Client dashboard (Front-end and
Back-end) - Manager dashboard (Front-end and Back-end)
- Clone the repository
git clone git@github.com:mathusanm6/RetroGameGems.git
- Install the dependencies
npm install express ejs bcryptjs express-session connect-pg-simple pg dotenv http-status-codes multer sharp csv-parser
- Create the database and the user needed for the project
psql -U postgres
CREATE ROLE myuser LOGIN PASSWORD 'mypassword';
CREATE DATABASE loyalty_card_db WITH OWNER = myuser;
- Launch the database setup script
node db_setup.js
- Launch the server
npm start
- Open a web browser and go to
http://localhost:3000
To access the manager dashboard, you need to log in as an administrator. The following administrators are added to the database:
password | first_name | last_name | |
---|---|---|---|
rtheo@mail.com | theo | Theo | Raoul |
smathusan@mail.com | mathusan | Mathusan | Selvakumar |
To add a new administrator, you need to add a record in the admin
table of the database or use the db_setup.js
script after modifying the db_setup.js
file by adding a new administrator to the admins
list.
When initializing the database, the following clients are added:
last_name | first_name | password | points | birth_date | |
---|---|---|---|---|---|
Doe | John | john.doe@mail.com | john123 | 1210 | CURRENT_DATE |
Smith | Jane | jane.smith@mail.com | jane123 | 750 | CURRENT_DATE |
Jones | Alice | alice.jones@mail.com | alice123 | 500 | CURRENT_DATE |
Brown | Bob | bob.brown@mail.com | bob123 | 3140 | CURRENT_DATE |
Davis | Charlie | charlie.davis@mail.com | charlie123 | 1050 | CURRENT_DATE |
The birth date (birth_date
) is set to CURRENT_DATE
to simulate the birthday of the clients. The points
field is initialized with random values.
psql -U myuser -d loyalty_card_db