This Project is the frontend of the Fusion - IIITDMJ's ERP Portal. We've migrated the frontend of fusion from Django templates to a modern React-based architecture.
- ReactJS as the main frontend library
- Mantine UI for UI components
- Redux for state management
- Phosphor-icons for icons
- Mantine-React-Table for tables
Check the package.json file for more information about all the libraries being used.
This project is using Eslint and Prettier for linting and formatting the code.
- Fork the repository
- Clone your forked repository
- Change directory to the project folder(
cd path/to/project) - Run
npm installto install all the dependencies - Run
npm run devto start the development server. The development server will start athttp://localhost:5173/
Make sure that your backend server is running properly before starting the frontend server.
- All the required assets(images, audio, videos) for the project are in the
src/assetsfolder. - The routes for all the web pages are defined in the
src/App.jsxfile. - All the API routes are stored as constants in the
src/routes/api_routes.jsxfile. - Only the global components are in the
src/componentsfolder. - Only the global web pages are in the
src/pagesfolder. - All the web pages related to a a module are in
src/modules/<module-name>folder. - All the components related to a module are in the
src/modules/<module-name>/componentsfolder. - All the styles related to a module are in the
src/modules/<module-name>/stylesfolder. - All the state management related code is in the
src/reduxfolder. Thesrc/redux/userSlice.jsxfile contains user-related states.
- Note: You can access the username and role of the user using the
useSelectorhook.
import { useSelector } from 'react-redux';
const ExampleComponent = () => {
const role = useSelector(state => state.user.role);
const username = useSelector(state => state.user.username);
return (
<div>
{username}
{role}
</div>
);
}- For styles, you can use the
mantinelibrary for components and css-modules for custom styles(Refer this guide).
- All the folder names should be in kebab-case.
- All the file names should be in camelCase.
- All the constants should be in UPPERCASE.
Note: Please make sure to follow the project structure and naming conventions while adding new files or folders to the project.