This is a simple web app built for demo and learning purposes.
You can view a live demo of the app here: https://time-tracker-demo.herokuapp.com. For convenience, the login page is pre-populated with credentials of a demo account.
- Single-page web application frontend built with:
- Backend rest api built using:
- MySQL for data storage
- Build and development tools include:
- Demo app deployed using:
- Security
- Passwords stored in hashed form using bcrypt.
- Stateless authentication managed using JSON Web Tokens
- Environment variables are used to keep sensitive data out of the source code.
To run the app locally, you'll need to:
- Install mysql locally
- Run mysql
- Create a database to be used
- Create a user with all permissions for the database
- Setup an environment variable so the app knows what database to access (see Envionrment Variables below)
Create a file named ".env" in the root directory. There are some environmental variables that need to be defined here for the app to work correctly.
Define the following variables:
NODE_ENV='development'
PORT=3000
API_URL=http://localhost:3000/api
API_DB_URL=mysql://username:password@localhost:3306/db_name
SECRET="something"
ADMIN_PASSWORD="whatever"
After setting up your database and environment variables, you can load some default data by running:
npm run load-fixtures
To compile server code to es5 (build directory) and rebuild in response to changes:
npm run build-server-watch
To run the server, and restart on any changes:
npm run dev-server-watch
To recompile frontend on change:
npm run build-frontend-watch
Make sure the server is built and running:
npm run build-server
npm run dev-server
Then run the test suite:
npm test