Giter Club home page Giter Club logo

mohdaazam / employee-management-system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from loveliiivelaugh/employee-management-system

0.0 1.0 0.0 578 KB

Employee management system built with React, MaterialUI, Firebase for auth and for the noSql Firestore database. This is an attempt to build this project ahead of having to build it as part of a coding bootcamp curriculum I am about to begin.

Home Page: https://fire-react-employee-management.netlify.app

JavaScript 99.44% HTML 0.56%

employee-management-system's Introduction

Employee Management System

Description

A sample employee management system built to simplify the organization of administrative data respective to the end user. Application features authenticated routing based on user roles and permissions. Built with React.js, MaterialUI for the user interface, Firebase for user authentication, Firestore to persist data in a noSql database, and Netlify for hosting.

Screenshot

Deployment

Deployed using Netlify

Live URL

Netlify Status

Credits

Inspiration

Inspiration came from this repo ( Found it just searching Github for relevant concept. ) --> fenil29/employee-management-system-frontend-react

To Dos

  1. Update all forms to reflect dataa required in tables
  2. Deploy a live site
  3. Set up cd/ci
  4. update styling
  5. lock auth so only the 3 profiles can access (Admin, HR, Employee)
  • Allow for new users to be created. Build welcome screen with mock welcome wizard/flow.
  1. Update landing page to SignInSide landing page
  2. Hide navbar on landing page, and show on rest of site ---> SOLVED reference: https://docs.divjoy.com/Hide-Navbar-and-Footer-on-some-pages-4b6697d1b70a410884f5b42a7b1ecb20
  3. Update all forms to include enchanced UI by featuring MUI custom pickers etc..

๐Ÿ‘‰ Get Started

Install dependencies

npm install

Update your .env file with values for each environment variable

API_KEY=AIzaSyBkkFF0XhNZeWuDmOfEhsgdfX1VBG7WTas
etc ...

Install the Netlify CLI

npm install netlify-cli -g

Run the development server

netlify dev

When the above command completes you'll be able to view your website at http://localhost:8888

Note: You can run just the front-end with npm run start, but netlify dev also handles running your API endpoints (located in the /api directory).

๐Ÿฅž Stack

This project uses the following libraries and services:

๐Ÿ“š Guide

Routing

This project uses React Router and includes a convenient useRouter hook (located in src/util/router.js) that wraps React Router and gives all the route methods and data you need.

import { Link, useRouter } from './../util/router.js';

function MyComponent(){
  // Get the router object
  const router = useRouter();

  // Get value from query string (?postId=123) or route param (/:postId)
  console.log(router.query.postId);

  // Get current pathname
  console.log(router.pathname)

  // Navigate with the <Link> component or with router.push()
  return (
    <div>
      <Link to="/about">About</Link>
      <button onClick={(e) => router.push('/about')}>About</button>
    </div>
  );
}

Authentication

This project uses Firebase Auth and includes a convenient useAuth hook (located in src/util/auth.js) that wraps Firebase and gives you common authentication methods. Depending on your needs you may want to edit this file and expose more Firebase functionality.

import { useAuth } from './../util/auth.js';

function MyComponent(){
  // Get the auth object in any component
  const auth = useAuth();

  // Depending on auth state show signin or signout button
  // auth.user will either be an object, null when loading, or false if signed out
  return (
    <div>
      {auth.user ? (
        <button onClick={(e) => auth.signout()}>Signout</button>
      ) : (
        <button onClick={(e) => auth.signin('[email protected]', 'yolo')}>Signin</button>
      )}
    </div>
  );
}

Database

This project uses Cloud Firestore and includes some data fetching hooks to get you started (located in src/util/db.js). You'll want to edit that file and add any additional query hooks you need for your project.

import { useAuth } from './../util/auth.js';
import { useItemsByOwner } from './../util/db.js';
import ItemsList from './ItemsList.js';

function ItemsPage(){
  const auth = useAuth();

  // Fetch items by owner
  // Returned status value will be "idle" if we're waiting on 
  // the uid value or "loading" if the query is executing.
  const uid = auth.user ? auth.user.uid : undefined;
  const { data: items, status } = useItemsByOwner(uid);

  // Once we have items data render ItemsList component
  return (
    <div>
      {(status === "idle" || status === "loading") ? (
        <span>One moment please</span>
      ) : (
        <ItemsList data={items}>
      )}
    </div>
  );
}

Deployment

Install the Netlify CLI

npm install netlify-cli -g

Link codebase to a Netlify project (choose the "create and deploy manually" option)

netlify init

Add each variable from your .env file to your Netlify project (skip ones prepended with "REACT_APP_"). You can also use the Netlify UI for this by going to your Site settings โ†’ Build & Deploy โ†’ Environment.

netlify env:set VARIABLE_NAME value

Build for production

npm run build

Then run this command to deploy to Netlify

netlify deploy

See the Netlify docs for more details.

Other

This project was created using Divjoy, the React codebase generator. You can find more info in the Divjoy Docs.

employee-management-system's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.