TransferPro is a football transfer management system that helps club owners and managers manage player transfers, budgets, and team rosters. It provides features such as managing club information, adding players, transferring players between clubs, and tracking transfer budgets.
- Role-based Access: Two roles - Owner and Manager - each with different permissions.
- Owner: Can buy players and manage the club's finances.
- Manager: Can add players but cannot buy them.
- Player Transfer System: Allows clubs to buy players, which updates the player's club and reduces the transfer budget of the buying club.
- Player and Club Management: Club owners and managers can add, edit, and view players and clubs.
- User Authentication: Login and registration with session management, password hashing using bcryptjs, and role-based authorization.
- Node.js and Express.js: Web server and routing.
- Sequelize: ORM for managing PostgreSQL database.
- PostgreSQL: Database for storing user, club, and player information.
- bcryptjs: Password hashing for secure authentication.
- Express-Session: For session management.
- Chart.js: For player statistics visualization.
Before you begin, ensure you have met the following requirements:
- Node.js installed (preferably the latest LTS version).
- PostgreSQL installed and running.
- Git installed to clone the repository.
git clone https://github.com/yourusername/TransferPro.git
cd TransferProRun the following command to install all the necessary dependencies:
npm installEnsure your PostgreSQL server is running and create a new database for the application.
- Update your database configuration in
config/config.jsonwith the correct credentials.
Example config:
{
"development": {
"username": "your_db_username",
"password": "your_db_password",
"database": "transferpro_db",
"host": "127.0.0.1",
"dialect": "postgres"
}
}Use Sequelize to create the necessary tables in the database.
npx sequelize-cli db:migratenpx sequelize-cli db:seedNow you can start the server using:
nodemon app.jsThe application will be running at http://localhost:3000.
- Go to
http://localhost:3000to view the landing page. - You can register, login, and start managing players and clubs.
- As a Manager, you can add players, and as an Owner, you can buy players.
POST /register- Register a new user (Manager or Owner).POST /login- Log in with credentials.GET /logout- Log out the current user.
GET /clubs- Get all clubs.GET /clubs/:clubId- Get details of a specific club.GET /clubs/add- Render add club formPOST /clubs/add- Add a new club (Owner only).GET /clubs/delete/:clubId- Delete listed club.GET /clubs/:clubId/players/:playerId- Get statistics of a player of a specific club.
GET /players- Get all players.GET /platers/add- Render add player formPOST /players/add- Add a new player.GET /players/:playerId/buy- Buy a player
- Can view players.
- Can add players to clubs.
- Cannot buy players.
- Can buy players.
- Can manage their club's transfer budget.
- Sessions are managed using express-session.
- Upon login, the user’s role, ClubId, and transferBudget are saved to the session.
- When the user logs out, the session is destroyed.
- Implement a more robust role-based access control.
- Add team management functionality (e.g., manage the team roster).
- Support more advanced search and filter functionality for players and clubs.
We welcome contributions to this project! If you'd like to help improve TransferPro, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -am 'Add new feature'). - Push to your branch (
git push origin feature-branch). - Create a pull request with a description of what you've done.
This project is licensed under the MIT License - see the LICENSE file for details.