To start the application in dev mode, please run:
git clone https://github.com/tobslob/sleep-duration-tracker-server.git cd sleep-duration-tracker-server yarn install add `.env` to root folder, copy the .env.exampleTo ensure port 5432 is free.
sudo lsof -i:5432sudo kill -15 <pid>Install PostgreSQL on local machine using the following command:
docker pull postgresdocker run -d --name dev-postgres \
--restart=always \
-e POSTGRES_PASSWORD=secret123 \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=simple-chart \
-p 5432:5432 postgresdocker psnpx prisma migrate dev --name inityarn seed:dbyarn watchyarn start:devApplication is ready to receive connection @ http://localhost:8080
- POST /api/v1/users Create user entry
curl -X POST -H "Content-Type: application/json" \
-d '{
"emailAddress": "kazeem.o.odutola@gmail.com",
"name": "Kazeem Odutola",
"gender": "male",
"sleepTimeDuration": 2,
"date": "26-07-26"
}' http://localhost:8080/api/v1/users- GET /api/v1/users Get a user entry
curl -X GET "http://localhost:8080/api/v1/users?emailAddress=kazeem.o.odutola@gmail.com"- GET /api/v1/users Get users entry count
curl -X GET "http://localhost:8080/api/v1/users"- Add more unit testing to ensure functions work accordingly
- Add pagination from the backend, though pagination is been done from the frontend currently.