https://github.com/praneetrohida/btc-pilot
https://github.com/praneetrohida/btc-pilot
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/praneetrohida/btc-pilot
- Owner: praneetrohida
- Created: 2023-08-04T10:06:48.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-07T11:19:48.000Z (almost 2 years ago)
- Last Synced: 2025-03-17T17:21:35.645Z (3 months ago)
- Language: TypeScript
- Size: 1.15 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ****BTC Pilot π****
[btc-pilot.praneet.dev](https://btc-pilot.praneet.dev)
## App Flow
## Getting Started
Run database migrations on your local database. Make sure your Postgres service is running and the Environment Variables are set correctly
```
yarn migrate:dev
```Run your app in the development mode.
```
yarn dev
```Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## Environment Variables
Ensure the `.env.local` file has required environment variables:
```
DATABASE_URL=postgresql://@localhost:5432/btc-pilot
CMC_API_KEY=
```Ensure the `.env.test.local` file has required environment variables:
```
DATABASE_URL=postgresql://@localhost:5432/btc-pilot_test
CMC_API_KEY=
```[Generate CoinMarketCap API Key](https://coinmarketcap.com/api/)
## Tests
Runs your tests using Vitest.
```
yarn test
```## Commands
Blitz comes with a powerful CLI that is designed to make development easy and fast. You can install it with `npm i -g blitz`
```
blitz [COMMAND]dev Start a development server
build Create a production build
start Start a production server
export Export your Blitz app as a static application
prisma Run prisma commands
generate Generate new files for your Blitz project
console Run the Blitz console REPL
install Install a recipe
help Display help for blitz
test Run project tests
```You can read more about it on the [CLI Overview](https://blitzjs.com/docs/cli-overview) documentation.
## Directory Structure
```
btc-pilot
βββ src/
β βββ auth/
β β βββ components/
β β β βββ LoginForm.tsx
β β β βββ SignupForm.tsx
β β βββ mutations/
β β β βββ changePassword.ts
β β β βββ forgotPassword.test.ts
β β β βββ forgotPassword.ts
β β β βββ login.ts
β β β βββ logout.ts
β β β βββ resetPassword.test.ts
β β β βββ resetPassword.ts
β β β βββ signup.ts
β β βββ pages/
β β β βββ forgot-password.tsx
β β β βββ login.tsx
β β β βββ reset-password.tsx
β β β βββ signup.tsx
β β βββ validations.ts
β βββ core/
β β βββ components/
β β β βββ Form.tsx
β β β βββ LabeledTextField.tsx
β β βββ layouts/
β β βββ Layout.tsx
β βββ game/
β β βββ components/
β β β βββ Game.tsx
β β β βββ GameInput.tsx
β β β βββ GameResult.tsx
β β β βββ ...
β β βββ quries/
β β βββ ...
β β βββ mutations/
β β βββ ...
β βββ pages/
β β βββ _app.tsx
β β βββ _document.tsx
β β βββ 404.tsx
β β βββ index.tsx
β β βββ leaderboard.tsx
β βββ users/
β βββ hooks/
β β βββ useCurrentUser.ts
β βββ queries/
β βββ getCurrentUser.ts
βββ db/
β βββ migrations/
β βββ index.ts
β βββ schema.prisma
β βββ seeds.ts
βββ integrations/
βββ mailers/
β βββ forgotPasswordMailer.ts
βββ public/
β βββ favicon.ico
β βββ logo.png
βββ test/
β βββ setup.ts
β βββ utils.tsx
βββ .eslintrc.js
βββ babel.config.js
βββ blitz.config.ts
βββ vitest.config.ts
βββ package.json
βββ README.md
βββ tsconfig.json
βββ types.ts
```These files are:
- The `src/` folder is a container for most of your project. This is where youβll put any pages or API routes.
- `db/` is where your database configuration goes. If youβre writing models or checking migrations, this is where to go.
- `public/` is a folder where you will put any static assets. If you have images, files, or videos which you want to use in your app, this is where to put them.
- `integrations/` is a folder to put all third-party integrations like with Stripe, Sentry, etc.
- `test/` is a folder where you can put test utilities and integration tests.
- `package.json` contains information about your dependencies and devDependencies. If youβre using a tool like `npm` or `yarn`, you wonβt have to worry about this much.
- `tsconfig.json` is our recommended setup for TypeScript.
- `.babel.config.js`, `.eslintrc.js`, `.env`, etc. ("dotfiles") are configuration files for various bits of JavaScript tooling.
- `blitz.config.ts` is for advanced custom configuration of Blitz. [Here you can learn how to use it](https://blitzjs.com/docs/blitz-config).
- `vitest.config.ts` contains config for Vitest tests. You can [customize it if needed](https://vitejs.dev/config/).
You can read more about it in the [File Structure](https://blitzjs.com/docs/file-structure) section of the documentation.
### Tools included
Blitz comes with a set of tools that corrects and formats your code, facilitating its future maintenance. You can modify their options and even uninstall them.
- **ESLint**: It lints your code: searches for bad practices and tell you about it. You can customize it via the `.eslintrc.js`, and you can install (or even write) plugins to have it the way you like it. It already comes with the [`blitz`](https://github.com/blitz-js/blitz/tree/canary/packages/eslint-config) config, but you can remove it safely. [Learn More](https://blitzjs.com/docs/eslint-config).
- **Husky**: It adds [githooks](https://git-scm.com/docs/githooks), little pieces of code that get executed when certain Git events are triggerd. For example, `pre-commit` is triggered just before a commit is created. You can see the current hooks inside `.husky/`. If are having problems commiting and pushing, check out ther [troubleshooting](https://typicode.github.io/husky/#/?id=troubleshoot) guide. [Learn More](https://blitzjs.com/docs/husky-config).
- **Prettier**: It formats your code to look the same everywhere. You can configure it via the `.prettierrc` file. The `.prettierignore` contains the files that should be ignored by Prettier; useful when you have large files or when you want to keep a custom formatting. [Learn More](https://blitzjs.com/docs/prettier-config).## Learn more
Read the [Blitz.js Documentation](https://blitzjs.com/docs/getting-started) to learn more.
The Blitz community is warm, safe, diverse, inclusive, and fun! Feel free to reach out to us in any of our communication channels.
- [Website](https://blitzjs.com)
- [Discord](https://blitzjs.com/discord)
- [Report an issue](https://github.com/blitz-js/blitz/issues/new/choose)
- [Forum discussions](https://github.com/blitz-js/blitz/discussions)
- [How to Contribute](https://blitzjs.com/docs/contributing)
- [Sponsor or donate](https://github.com/blitz-js/blitz#sponsors-and-donations)