This project is a monorepo built with Turborepo. To run all apps from the apps folder
run:
npm run dev
You can also execute the above command inside each app folder to run them separately.
Built with Vite and TypeScript.
Built with Node.js, TypeScript, Express and MongoDB.
You need to create a .env
file in each app:
- Server: Place it inside
root
folder with the following variables:- PORT: The port where the server will be listening. E.g.
8000
- MONGODB_URI: The URI to connect to MongoDB. E.g.
mongodb://<user>:<password>@<host>/<db>?<options>
- CLIENT_URL: The base url of the client app. E.g.
http://localhost:5173
- PORT: The port where the server will be listening. E.g.
- Client: Place it inside
src
folder with the following variables:- VITE_API_URL: The base url of the server app. E.g.
http://localhost:<PORT_OF_SERVER_APP>
- VITE_API_URL: The base url of the server app. E.g.
Tip: If you want to use json-server as a mock server with the file db.json, you can use
http://localhost:3000/contacts
as VITE_API_URL and run the corresponding npm script in another terminal inside the client folder.