This is a fullstack application that allows therapists to keep a list of patients' sessions, fees and payments.
Built with Next.js using React (frontend), Express and Prisma Client (backend). It uses a SQLite database file with some initial dummy data which you can find at ./prisma/dev.db
.
Install npm dependencies:
npm install
npm run dev
The app is now running, navigate to http://localhost:3000/
in your browser to explore its UI.
Expand for a tour through the UI of the app
Dashboard (located in ./pages/index.tsx
)
New Session (located in ./pages/new.tsx
)
You can also access the REST API of the API server directly. It is running on the same host machine and port and can be accessed via the /api
route (in this case that is localhost:3000/api/
, so you can e.g. reach the API with localhost:3000/api/feed
).
/api/sessions
: Fetch all sessions
/api/session
: Create a new session- Body:
date: DateTime
(required): The date of the sessionpatient: String
(required): The patient's namefee: Int
(required): The fee for the session
- Body:
/api/payment
: Create a new payment- Body:
sessionId: Int
(required): The ID of the sessionamount: Int
(required): The amount of the payment
- Body:
If you want to try another database than SQLite, you can adjust the the database connection in prisma/schema.prisma
by reconfiguring the datasource
block.
Learn more about the different connection configurations in the Prisma docs.