Create a RESTful application that manages appointments for a dental clinic.
In the application, there are four types of users: 'user', who is the default patient; 'dentist', who are the available dentists to attend appointments; 'admin', who are responsible for creating 'dentists' and managing business data, and the 'superadmin' that is the only one capable of creating others 'admin'.
For a patient to request an appointment, they must be registered with complete profile information. The patient must choose a service to request the appointment.
Once an appointment is requested, it can be confirmed or canceled by an 'admin'. The administrator must choose a date and time to confirm the appointment.
The patient also has the ability to cancel their own appointment. Also the dentist assigned to the appointment can cancel it. A reason message must be sent by the one canceling it.
Finally, an administrator marks the appointment as completed and records the patient's evaluation within the appointment.
Clone the repository.
git clone https://github.com/Edkiri/dental-api.gitThen, install the project's dependencies:
npm installThis project uses MongoDB as its database.
The project has a docker-compose.yml file ready to use if you have Docker installed.
You can also install MongoDB on your local machine directly or use a cloud service.
copy .env.example to .env. This file contains variables to connect to MongoDB, and some other for the app, like jwt secret token, email and password of superadmin user.
cp .env.example .envMONGO_DATABASE=your_database_nane
MONGO_USERNAME=your_database_user
MONGO_PASSWORD=your_database_password
MONGO_PORT=your_database_port
MONGO_DATABASE_URL=your_database_urlIf you are using Docker, you can use the following values:
MONGO_DATABASE=dentaldb
MONGO_USERNAME=root
MONGO_PASSWORD=secret
MONGO_PORT=27017
MONGO_DATABASE_URL=mongodb://root:secret@localhost:27017If you have Docker installed, you can use the following command to start a MongoDB container:
docker-compose up -dNow run the seeder to create superadmin user and default services.
npm run seedTo run the project in development mode, run the following command:
npm run devThis project uses eslint and prettier to style and format the code. Make sure to install those extensions on your IDE if you want to use them.
