Skip to content

Commit

Permalink
Feature/vite migration (#5)
Browse files Browse the repository at this point in the history
* removed gatsby

* vite init

* added react router

* imported tailwind

* reintroduced components

* fixed summary position

* fixed test file name, added to roadmap

* removed loader from summary route

* updated environment instructions and env.example for vite

* updated node version in instructions

* updated node version in test ci

* refactored folder structure, refactored avatar and login modal

* added persist gate component

* changed deploy target directory

* added rewrite config for single page app

* removed unused hook

* added ts node for jest config file
  • Loading branch information
Alen Ajam authored Apr 22, 2023
1 parent 6ee8359 commit e906e1e
Show file tree
Hide file tree
Showing 153 changed files with 8,458 additions and 18,227 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GATSBY_FIREBASE_CONFIG={ "apiKey": "-", "authDomain": "-", "projectId": "-", "storageBucket": "-", "messagingSenderId": "-", "appId": "-", "measurementId": "-"}
VITE_FIREBASE_CONFIG={ "apiKey": "-", "authDomain": "-", "projectId": "-", "storageBucket": "-", "messagingSenderId": "-", "appId": "-", "measurementId": "-"}
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: Test

on:
push:
branches: [master]
branches: [ master ]

pull_request:
branches: [master]
branches: [ master ]

jobs:
test:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'

- name: Install dependencies
run: npm ci
Expand Down
32 changes: 29 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
node_modules/
.cache/
public
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.env.development
.env.production

yarn.lock

coverage
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.21.1
v18.15.0
56 changes: 38 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

MyOrder allows you to track food orders effortlessly and provides a summary ready to be exported.

Read the story behind it on [Medium](https://medium.com/@alen.ajam/how-i-took-control-of-my-companys-lunchtime-with-an-app-f6d70c31cb89).
Read the story behind it
on [Medium](https://medium.com/@alen.ajam/how-i-took-control-of-my-companys-lunchtime-with-an-app-f6d70c31cb89).

![screenshot 1](https://miro.medium.com/max/300/1*Vk0dtrl4eHHAKmUhKkryMw.png)
![screenshot 2](https://miro.medium.com/max/300/1*XsmPd_zjpHLbfnaIt0oROw.png)

## Table of contents

1. [Demo](#demo)
1. [Run on your machine](#run-on-your-machine)
1. [Build for production](#build-for-production)
Expand All @@ -22,15 +24,17 @@ Read the story behind it on [Medium](https://medium.com/@alen.ajam/how-i-took-co
1. [Maintainers](#maintainers)

## Demo

You can find a demo [here](https://myorderdemo-80b12.web.app/).

You may try out everything except for the `Submit to Google Sheets` feature located at `/summary` because [it costs money](https://media.tenor.com/5Z-o3OKSPFIAAAAC/adult-swim-monkey.gif).
You may try out everything except for the `Submit to Google Sheets` feature located at `/summary`
because [it costs money](https://media.tenor.com/5Z-o3OKSPFIAAAAC/adult-swim-monkey.gif).

## Run on your machine

1. Use the right node version (`14.x`). I suggest using [nvm](https://github.com/nvm-sh/nvm).
1. Use the correct node version (`18.x`). I suggest using [nvm](https://github.com/nvm-sh/nvm).

If you have that you can just run:
If you have that you can just run:

```
nvm use
Expand All @@ -44,19 +48,21 @@ You may try out everything except for the `Submit to Google Sheets` feature loca

1. Setup environment

1. This app is meant to work on top of a [Firebase](https://firebase.google.com/) project, so you should create your own.
1. Initialize [Firestore](https://firebase.google.com/docs/firestore/quickstart).
1. [Obtain the project config object](https://firebase.google.com/docs/web/learn-more#config-object).
1. Create an `.env.development` file in the root of the project.
1. Place inside of it the config object, as a reference see `.env.example`.
1. This app is meant to work on top of a [Firebase](https://firebase.google.com/) project, so you should create your
own.
1. Initialize [Firestore](https://firebase.google.com/docs/firestore/quickstart).
1. [Obtain the project config object](https://firebase.google.com/docs/web/learn-more#config-object).
1. Create an `.env.development` file in the root of the project.
1. Place inside of it the config object, as a reference see `.env.example`.

1. Run the app
```
npm run start
```

## Build for production
1. Use the right node version (`14.x`). I suggest using [nvm](https://github.com/nvm-sh/nvm).

1. Use the correct node version (`18.x`). I suggest using [nvm](https://github.com/nvm-sh/nvm).

If you have that you can just run:

Expand All @@ -65,8 +71,10 @@ You may try out everything except for the `Submit to Google Sheets` feature loca
```

1. Setup environment

The same as the third step of [Run on your machine](#run-on-your-machine) applies, except the app will use `.env.production` this time. Learn more [here](https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/).

The same as the third step of [Run on your machine](#run-on-your-machine) applies, except the app will
use `.env.production` this time. Learn
more [here](https://vitejs.dev/guide/env-and-mode.html).

1. Build the app
```
Expand All @@ -77,16 +85,20 @@ You may try out everything except for the `Submit to Google Sheets` feature loca
```
npm run serve
```

## Contribute
Contributions are most welcome!

Contributions are most welcome!

### Bug fixing

1. Should you find a bug, please open an issue describing thoroughly what you encountered.
2. If you'd like to fix an already existing issue, please leave a comment asking to work on it, so nobody else does.
3. Once you get assigned an issue, you may work on it and then open a pull request titled `fix: #[number of issue] [description of issue]`.
3. Once you get assigned an issue, you may work on it and then open a pull request
titled `fix: #[number of issue] [description of issue]`.

### Feature requests

1. If you have an idea to discuss with the community, feel free to open a discussion.
1. For feature requests, you are free to open a new issue.
1. All feature requests may not fit this project and will be subject to discussion!
Expand All @@ -103,10 +115,18 @@ npm run test

## Roadmap

- [ ] Write unit tests on all components
- [ ] Add a page to consult orders of past days
- [ ] Migrate from Gatsby to React + Vite.
- [ ] Improve the desktop UI/UX.
- [ ] Improve the navigation UX.
- [ ] Lazy load all routes.
- [ ] Write unit tests on all components.
- [ ] Add a page to consult orders of past days.
- [ ] Add an admin panel:
- [ ] Add a page to manage restaurants and their menu.
- [ ] Allow to switch authentication method to one which is more secure

## Maintainers

- [oxcened](https://github.com/oxcened)

## License
Expand Down
8 changes: 8 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
presets: [
'@babel/preset-env',
'@babel/preset-react',
'@babel/preset-flow',
'@babel/preset-typescript',
]
};
8 changes: 7 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"hosting": {
"public": "public",
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
67 changes: 0 additions & 67 deletions gatsby-browser.js

This file was deleted.

39 changes: 0 additions & 39 deletions gatsby-config.js

This file was deleted.

29 changes: 0 additions & 29 deletions gatsby-node.js

This file was deleted.

Loading

0 comments on commit e906e1e

Please sign in to comment.