https://github.com/naimcode/stratagemstodo
https://github.com/naimcode/stratagemstodo
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/naimcode/stratagemstodo
- Owner: NaimCode
- Created: 2024-06-06T19:06:50.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-06T22:24:51.000Z (about 2 years ago)
- Last Synced: 2024-11-21T00:04:32.910Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://stratagems-todo.vercel.app
- Size: 163 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React + Express + MongoDB
## Getting Started
https://stratagems-todo.vercel.app/
### Prerequisites
- [Node.js](https://nodejs.org/en/)
- [Vite](https://vitejs.dev/)
- [MongoDB](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/)
- [Radix](https://www.radix-ui.com/)
### Installation
1. Clone the repo
```sh
git clone https://github.com/NaimCode/stratagemsTodo
```
2. Install client packages
```sh
cd app
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=
ENV=
PORT=
MULTI_SESSIONS=
SESSION_DURATION=
API_KEY=
```
5. Create a `.env` file in the root of the client folder and add the following
```sh
VITE_API_URL=
VITE_API_KEY=
```
## Setup Database (MongoDB) with Prisma
1. Create a new mongoDB database and copy the connection string into the `.env` file.
2. Push the schema into the database
```sh
cd server
pnpm db:push
```
3. Generate type definitions
```sh
pnpm db:generate
```
4. To view the database
```sh
pnpm studio
```
## Usage
1. Start the server
```sh
cd server
pnpm dev
```
2. Start the client
```sh
cd app
pnpm dev
```
## Unit testing and end-to-end testing
1. Server unit test
```sh
pnpm test
```
2. client e2e test
Make sure to add a valid credential inside **e2e/todos.specs.ts** and **e2e/auth.specs.ts** for login e2e
```sh
pnpm e2e:test
```
## License
Distributed under the MIT License. See `LICENSE` for more information.
## Contact
Naim - [@naimcode](https://github.com/NaimCode)