An Advanced Telemedicine Application built with Django and React/Typescript
This project contains three main components: docnet_backend
, docnet_frontend
, and docnet_website
. The backend is built with Django, while the frontends are built with React. Follow the steps below to set up and run the project locally.
Ensure you have the following installed on your machine:
- Python 3.x
- Node.js and npm
- PostgreSQL
(optional)
-
Clone the project locally: Open a terminal and clone the repository:
git clone https://github.com/Ronnie5562/DOCNET.git
-
Navigate to the Project Directory: Change into the project directory:
cd DOCNET
-
Navigate to the Backend Directory: Open a Terminal for the Backend and paste this command
cd docnet_backend
-
Create a Virtual Environment: Open your terminal and navigate to where you clone the project to:
python -m venv myvenv
Replace
myvenv
with the name you want for your virtual environment. -
Activate the Virtual Environment:
-
On Windows:
myvenv\Scripts\activate
-
On macOS and Linux:
source myvenv/bin/activate
-
-
Install Dependencies: Ensure you have a
requirements.txt
file in your project directory. Then, install the dependencies:pip install -r requirements.txt
-
Create Enviroment Variables: Copy the content of
.env.sample
file, create a new.env
file and paste what you copied inside this file. Then, change thexxxxxxxxxx
you find in the file with your real credentials. if you plan to use a local database, you can leave out theNEON DATABASE CREDENTIALS
section in the.env
file. Also specify if you want to use the default detabase by givingUSE_DEFAULT_DATABASE
a value ofTrue
/False
-
Apply Migrations: Set up the initial database by running migrations:
python manage.py migrate
-
Create a Superuser (Optional): If you want to access the Django admin site, create a superuser:
python manage.py createsuperuser
Then, visit
http://localhost:8000/admin
and use the credentials your used in creating you superuser to login here. -
Run the Development Server: Start the development server to see your project in action:
python manage.py runserver
By default, the server runs at
http://localhost:8000/
.
-
Updating Dependencies: If you need to update your dependencies or add new ones, you can use
pip
and then update yourrequirements.txt
file:pip freeze > requirements.txt
-
Version Control: Ensure your project is under version control (e.g., using Git) to manage changes and collaborate with others.
These steps should help you get started with docnet. Let's go to the frontend
-
Navigate to the Frontend Directory Open a new Terminal for the Frontend and paste this command
cd docnet_frontend
-
Install Dependencies: Install the dependencies required to run the frontend
npm install
-
Run the Development Server:
npm run dev
By default, the server runs at
http://localhost:5173/
.
-
Navigate to the Website Directory Open a new Terminal for the Website and paste this command
cd docnet_website
-
Install Dependencies: Install the dependencies required to run the website
npm install
-
Run the Development Server:
npm run dev
By default, the server runs at
http://localhost:5174/
.
- Website: The website will be running at http://localhost:5174.
- Backend: The backend server will be running at http://localhost:8000.
- Frontend: The frontend application will be running at http://localhost:5173.
- Admin: You can login to the admin panel from http://localhost:8000/admin
- Swagger API: To test the API http://localhost:8000/api/docs/swagger
- Redoc API: To have a graps of how the API works http://localhost:8000/api/docs/redoc