Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naimcode/authtest
https://github.com/naimcode/authtest
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/naimcode/authtest
- Owner: NaimCode
- Created: 2023-08-28T22:24:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-29T00:07:38.000Z (over 1 year ago)
- Last Synced: 2023-08-29T06:56:35.926Z (over 1 year ago)
- Language: TypeScript
- Size: 108 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React + Express + MySQL
## Getting Started
### Prerequisites
- [Node.js](https://nodejs.org/en/)
- [Vite](https://vitejs.dev/)
- [MySQL](https://www.mysql.com/)
- [PNPM](https://pnpm.js.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Express](https://expressjs.com/)
- [React](https://reactjs.org/)
- [Prisma](https://www.prisma.io/)
- [PlanetScale](https://planetscale.com/)### Installation
1. Clone the repo
```sh
git clone https://github.com/NaimCode/authTest
```2. Install client packages
```sh
pnpm install
```3. Install server packages
```sh
cd server
pnpm install
```4. Create a `.env` file in the root of the server folder and add the following
```sh
DATABASE_URL=
SESSION_SECRET=
JWT_SECRET=
CLIENT_URL= #dev http://localhost:5173
SMTP_USER=
SMTP_PASSWORD=
```5. Create a `.env` file in the root of the client folder and add the following
```sh
VITE_API_URL= #dev http://localhost:3000
```## Setup Database (MySQL) with Prisma and PlanetScale
1. Create a new database on PlanetScale and copy the connection string into the `.env` file. [PlanetScale](https://planetscale.com/)
2. Push the schema to PlanetScale
```sh
cd server
pnpm prisma db push
```3. Generate type definitions
```sh
pnpm prisma generate
```4. To view the database
```sh
pnpm prisma studio
```## Usage
1. Start the server
```sh
cd server
pnpm dev
```2. Start the client
```sh
pnpm dev
```## License
Distributed under the MIT License. See `LICENSE` for more information.
## Contact
Naim - [@naimcode](https://github.com/NaimCode)