This is a web application that allows users to shorten URLs. It includes a frontend built with React and a backend built with NestJS, with MongoDB as the database.
Ensure you have node version 16 and MongoDB installed.
To set up the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/NatalieTanML/govtech-gw.git
and runcd govtech-gw
- Install the dependencies for the server:
cd server
and runnpm install
- Install the dependencies for the client:
cd ../client
and runnpm install
- Create a
.env
file in./server
and add the following environment variables:
DB_HOST=localhost
DB_PORT=27017
DB_NAME=govtechgw
- Run MongoDB as a service.
To start the server, run the following on the terminal:
cd ../server
npm run start:dev
To start the client, run the following in another terminal:
cd ../client
npm start
The server will run on http://localhost:5000
and the client will run on http://localhost:3000
.
To run the tests, run:
cd ../server
npm run test
This will run the tests and output the results in the terminal.