This program is a database management system for the UNO card game. The system is designed to store information about the players, games, and cards. The system is designed to be user-friendly and easy to use.
The system provides features such as:
- Player registration and information management
- Game creation and management including logging the game history
- Card management.
- Game shopping and inventory management
A well-designed front-end interface is provided to interact with the backend MySQL database using Node.js and Express.js
-
Requirements:
Node.jsandnpmmust be installed on your local machine.MySQLmust be installed on your local machine with a user account and password set up.
-
.envfile:- The
.envfile is used to store the environment variables for initializing the database connection. - Please create a
.envfile in the root directory of the project with the following content with appropriate values:LOGIN_USERNAME=admin LOGIN_PASSWORD=admin123 DATABASE_HOST=db DATABASE_USER=root DATABASE_PASSWORD=password DATABASE=UNOGameSystem SESSION_SECRET=uno JWT_SECRET=uno JWT_EXPIRES_IN=90d JWT_COOKIE_EXPIRES=90
- The
Note: for DATABASE_PASSWORD use the same password you set up during the MySQL installation or Configuration process on your computer.
-
Run
npm installinside the terminal when you have navigated to this directory to install thenode_modulesdirectory which is required to run the application locally. -
Use the command
npm run devStartto start a local session of the application (which useslocalhostand port 3001 as specified in theserver.jsfile). The session will run inside the browser set as default. (You may usenpm run start, as well.)
Please refer to the uno.sql file, for information about the Database.
The Dockerfile and compose.yaml files are provided to run the application in a Docker container.
After you've set up the .env file, run docker compose up to start the application in a Docker container. The application will be available at localhost:3000.
A ER diagram of the database schema is available here. The database schema is normalized to BCNF and is designed to store information about the players, games, and cards. The database schema consists of the following tables:
The project is structured as follows:
publicdirectory contains the front-end utilities such as CSS, JavaScript, and icons.viewsdirectory contains the front-endejstemplates.routesdirectory handles the request routing and response handling, and authentication.modelsdirectory contains the database models and queries.controllersdirectory links the routes and models.configdirectory contains codes for setting up the database connection and client session.uno.sqlfile contains the SQL code to initialize the database schema.server.jsfile is the entry point of the application that sets up the server.
Thanks for Yuchen Gu and Daud Virk for their contributions to this project.
The project was inspired by UBC's CPSC 304 course project.