Skip to content

mamatsa/coronatime

Repository files navigation

Coronatime

Coronatime is a website where you can register/login and then view covid statistics by country or worldwide summed up data.

Table of Contents

Prerequisites

  • Node JS @12.X and up
  • npm @6 and up

Tech Stack

Getting Started

To run this application locally you need to follow the steps below:

1. First of all you need to clone repository from github:

git clone https://github.com/RedberryInternship/coronatime-otomamatsashvili.git

2. Next step requires installing all the dependencies:

npm install

or

yarn install

3. Then copy env example file. You can change environment variables inside .env with your preferences:

cp .env.example .env

4. After that you can run Coronatime from terminal:

npm start

or

yarn run start

5. You can also build project for production if you need to:

npm run build

Testing

This application is test driven. To write e2e and integration tests @cypress is used. You can find all of the tests into following path: /cypress/e2e/*.cy.ts

You can run cypress tests using following commands:

1. Copy cypress configuration file and if you need feel free to change it:

cp cypress.config.ts.example cypress.config.ts

2. Open cypress:

npx cypress open

Project Structure

Every file is not included

├─── cypress # test files
│   ├─── e2e      # all e2e tests
│   ├─── support  # library configuration files
├─── public  # entry folder
├───├─── locales # translation files
│   ├─── index.html     # main html file
├─── readme  # readme assets
├─── src  # project source codes
│   ├─── assets      # project images
│   ├─── components  # reusable components for whole app
│   ├─── pages  # application pages
│   ├───├─── page-folder  # pattern for each application page
│   ├───├───├─── page-component-file.tsx  # page component file
│   ├───├───├─── index.ts                 # exports page
│   ├───├───├─── page-components-folder   # [OPTIONAL] stores page specific components
│   ├───├─── index.ts  # exports all pages
│   ├─── services  # backend request files
│   ├─── types     # type files
│   ├─── App.tsx   # main component with routing
│   ├─── app.css   # main css file
│   ├─── index.tsx # root TS file
│   ├─── i18n.ts   # i18n configuration
├─── .env                # environment variables
├─── .eslintrc.json      # eslint config file
├─── .prettierrc.js      # prettier config file
├─── package.json        # dependency manager configurations
├─── cypress.config.ts   # cypress config file
├─── tailwind.config.js  # tailwind config file

Deployment

Application is deployed on digitalocean server with ngnix. You can view it here

If you want to deploy this application on your own:

1. You need to copy env example file on server. You should update env variables with your needs:

cp .env.example .env

2. And then just build:

npm run build

Resources