Coronatime is a website where you can register/login and then view covid statistics by country or worldwide summed up data.
- React @18.1.0 - Front-end framework
- Typescript @4.7.2 - Superset of Javascript
- TailwindCss @3.0.24 - CSS framework
- React Router @6.3.0 - Client side router
- React Hook Form @7.31.3 - Form validation library
- Cypress @10.0.3 - JS testing tool
- I18next @21.8.8 - JS language changing tool
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
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
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
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