- Use zod for input validation
- Abstract when you can
- use the standardApiCall middleware on the frontend whenever using the api
If you have a better idea for anything we do let us know!
Follow these steps to set up and run the application locally.
Run the following command in the root directory of the project:
npm run devThis will attempt to install dependencies for both the frontend and backend (npm i).
Install MySQL version 8 or above on your machine. During installation:
Remember the username and password you set.
Note the server configuration (e.g., localhost:3306).
Navigate to the @backend/config/secrets.js file to see the required environment variables.
Create a secrets.env file in the root directory of the project.
Add the following variables to the secrets.env file:
NODE_ENV="local"
SESSION_SECRET="some_long_uuid"
MADDOX_MYSQL_USERNAME="your_mysql_username"
MADDOX_MYSQL_PASSWORD="your_mysql_password"
MADDOX_MYSQL_SERVER="your_mysql_server"
MADDOX_MYSQL_DB="your_database_name"Replace the placeholders with your actual MySQL credentials and configuration.
Use the provided init.sql file to create the necessary tables in your MySQL database.
Run the following command to seed the master tables:
npm run seedNavigate back to the root directory of the project:
cd ..Start the application:
npm run devOpen your browser and navigate to:
http://localhost:3001
And You should see the application running.
Notes:
Additional environment variables may be required for other parts of the application, but the ones listed above are sufficient for the base app to function.
Database migrations will be added in the future for easier setup.
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request, and be sure to check the Allow edits from maintainers option while creating your PR. This allows maintainers to collaborate with you on your PR if needed.
- If possible, link your pull request to an issue by adding the appropriate keyword (e.g.
fixes issue #XXX) - Before requesting a review, please make sure that all Github Checks have passed and your branch is up-to-date with the
mainbranch. After doing so, request a review and wait for a maintainer's approval.
All PRs should target the main branch.