This project is organized in the following structure: v1/ ├── frontend/ └── backend/
- Open a terminal and run:
cd backend
npm install express pg dotenv cors bcryptjs
node server.js- Rename the file:
v1/backend/.envcopy→v1/backend/.env
- Open another terminal and run:
cd frontend
npm install
npm run dev- React.js
- React Router DOM
- Fetch API
- CSS Modules / Custom CSS
- Node.js
- Express.js
- bcryptjs
- jsonwebtoken (JWT)
- crypto
- pg (node-postgres)
- PostgreSQL
- Jest
To run all the test, go to the root of the v1/ project directory,
npm run test:allIf you want to test either backend or frontend:
FRONTEND
Go to the v1/frontend
npx jest --config jest.config.cjsBACKEND
Go to the v1/backend
npx jest --config jest.config.cjsCoverage
npx jest --config jest.config.cjs --coverageUse these prefixes for your commit messages:
feat: new features added fix: resolving bugs docs: update usage instructions in README style: updating styles in a page refactor: simplify database query logic
classNames: this-sample-classname id: this-is-sample-id folder: this_is_sample_folder imports: FirstLetterIsUpperCaseSampleImport files: this.foldername.filename
- Ensure both backend and frontend run on compatible ports.
- Modify your environment variables in the .env file.
- Follow Conventional Commits for consistent history.
- Philippine Standard Geographic Code (PSGC)
If you are using GitHub Actions, create the file: .github/workflows/test.yml
And paste this:
name: Run Backend Tests
on: push: branches: [ main ] pull_request: branches: [ main ]
jobs: test: runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd v1/backend
npm ci
- name: Run tests
run: |
cd v1/backend
npm test -- --passWithNoTests
Author: Tristan Ehron Abogadie Tumbaga Version: v1 License: MIT