This is an Employee time tracking system
To get a local copy up and running follow these simple steps.
- Clone the repo
git clone https://github.com/ajferrell/time-tracking-system.git
- From the api directory, install NPM packages
npm install
- From the client directory, install NPM packages
npm install
- From the client directory, create a production build
npm run build
- Start the server from the api directory:
node server.js
-
Download and Install PostgreSQL and pgAdmin: https://www.postgresql.org/download/
-
Create a server and database in pgAdmin:
Open pgAdmin and create a new server. Within the server, create a new database. Remember the database name, username, and password for later use. -
Create a ".env" file in the api directory with the following content:
DB_USER=your_username DB_HOST=localhost DB_DATABASE=your_database_name DB_PASSWORD=your_password DB_PORT=your_port_number
-
Run the database initialization script using your username for the database in place of "your_username":
psql -f tracking.sql -U your_username
-
Start the server from the api directory:
node server.js
-
After running server, should see message
Server running on port 3000 Table created successfully!
- This currently only runs locally on port 3000.
- To have access to psql commands, make sure to add PostgreSQL's
binandlibdirectories to your system's PATH environmental variable.- For Windows, this is usually
C:\Program Files\PostgreSQL\<version>\binandC:\Program Files\PostgreSQL\<version>\lib. - For macOS and Linux, it's often
/usr/local/bin/and/usr/local/lib/.
- For Windows, this is usually
- To drop and recreate the database, run the command
psql -f tracking.sql -U your_username.