A mobile-optimized web application to generate duty rosters for wards in a hospital.
- Clone the repository
git clone https://github.com/NethumL/roster-scheduler
cd roster-scheduler
-
Install Node.js
-
Install the required dependencies
npm install
- Set up a MongoDB server to use as a database
- Create a
.env.local
file with the required environment variables (see environment variables section) - Run the webapp
npm run dev
- Set up the roster generation service, configure according to the README.md, and run it
npm run build
- The Next.js app can be deployed on Vercel directly as shown in the documentation
- Set the required environment variables on Vercel
- Make sure to set up a MongoDB server and set the corresponding
MONGODB_URI
environment variable - Set up the roster generation service and deploy on a server (eg: render)
- Create a
.env.test.local
file with the required environment variables (see environment variables section)- Additionally, set the
CI
environment variable to1
before running the tests - Make sure to use a different database name in
.env.test.local
- Additionally, set the
- Build the webapp for production
npm run build
- Start the webapp for testing
NODE_ENV=test npm run start
- Separately, run the tests
NODE_ENV=test npx playwright test --workers 1
npm run test:unit
pip install locust
- Start Locust
locust -f tests/load
- Open the Locust web interface (link will be in the output of the previous command)
- Configure the testing parameters and the host
- Run the test
- Title for web application
- Will be shown in navbar and page title
- URI for MongoDB server, eg:
mongodb://admin:password@127.0.0.1:27017/cs3202?directConnection=true&authSource=admin
- Make sure the database name is in the URI itself
- Needs to be a sufficiently long random string, eg:
DSAVDF+BTMgoBszC9zUJwHx1/s4Gc2ebz9oG1VjrBB8=
- Can use the OpenSSL command line tool to generate one
$ openssl rand -base64 32
DSAVDF+BTMgoBszC9zUJwHx1/s4Gc2ebz9oG1VjrBB8=
- Host of service that generates rosters, eg: "https://roster-scheduler-service.onrender.com" (repo available here)
- Shared secret between this webapp and the service
- Needs to be a sufficiently long random string, eg:
DSAVDF+BTMgoBszC9zUJwHx1/s4Gc2ebz9oG1VjrBB8=
- Can use the OpenSSL command line tool to generate one (similar to
TOKEN_SECRET
)
- 190332D Sasitha Kumarasinghe
- 190334K H. R. S. Kumari
- 190349K Nethum Lamahewage