Skip to content

brianwachira/AATA

Repository files navigation

Access Afya Technical Assessment Test Dashboard

This is an analytics dashboard for the measurement and optimization of key metrics that are fundamental for operational efficiency of the healthcare clinics spread country-wide.

screenshot

The project uses Apollo Server + MongoDB for the Backend GraphQL API & ReactJS + Apollo Client for the Frontend.

Built With

Backend

Folder structure

 
└───Controllers
│   └───ExampleController.ts
|    
└───models
|   └───ExampleModel.ts
|
└───Mutations
|   └───ExampleMutation.ts
|
└───queries
|   └───ExampleQuery.ts
|
└───resolvers
|   └───index.ts
|   └───ExampleResolver.ts
|
└───schemas
│   └───index.ts
│   └───ExampleSchema.ts
|
└───graphql.ts
|
└───app.ts
└───index.ts

Frontend

Folder structure

src 
└───Components
│   └───Example
│       │   Example.js
│       │   Example.scss
│   └───Example2
│       │   Example2.js
│       │   Example2.scss
|
└───graphql
|   └───mutations
│   │   |───index.js
|   |
|   └───queries
│       │───index.js
|
|
|
└───Pages
│   └───Example
│       │   
│       └───Example.js
│       │   
│       └───Example.scss
|

Live Demo

DASHBOARD
GRAPHQL API

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

- NodeJS required

Setup


  • Choose AWS provider and any free-tier data center


cluster 1
  • use the database access tab for creating user credentials for the database. Please note that these are not the same credentials you use for logging into MongoDB Atlas. These will be used for your application to connect to the database.


cluster 1
  • grant the user with permissions to read and write to the databases.


cluster 1
  • Define the IP addresses that are allowed access to the database.
    cluster 1

  • For the sake of simplicity we will allow access from all IP addresses:


cluster 1
  • Finally we are ready to connect to our database. Start by clicking connect:


cluster 1
  • Choose Connect your application:


cluster 1
The view displays the MongoDB URI, which is the address of the database that we will supply to the MongoDB client library we will add to our application.
cluster 1
The address looks like this: ```mongodb+srv://:@cluster0-ostce.mongodb.net/?retryWrites=true```
  • Copy the Address
  • Create a .env file in the root of your the backend folder.
  • Use the following syntax to save mongoDB URI as shown in env.example
    MONGODB_URI=MONGODB_URL
    PORT=3001
    SECRET=SECRET_NUMBER
    JWT_SECRET=SECRET_STRING
    
    
  • Replace MONGODB_URL with the address you got from mongoDB cloud atlas
  • Replace SECRET_NUMBER with an integer eg 10 . This will be used when generating a JWT token

Install

  • Navigate to the backend folder cd backend
  • Run npm install . This will install all the dependencies needed for the project
  • Navigate to the frontend folder cd frontend
  • Run npm install . This will install all the dependencies needed for the project

Usage

  • Navigate to the backend folder cd backend
  • Run npm run dev . This will initialize the backend
  • Navigate to the frontend folder cd frontend
  • Run npm start . This will initialize the frontend

Known bugs

  • The database transactions (especially create patient) need to be optimized

commit headers

  • [FEATURE] - New Feature
  • [ENHANCEMENT] - Improvement of an existing feature
  • [FIX] - bug fixes of existing features

Support and contact details

Contact me on brianwachira7@gmail.com for any comments, reviews or advice.

License

This project is licensed under the terms of the MIT license.

You can check out the full license here

Copyright (c) Brian Wachira