This is a full-stack food delivery application with a React Native frontend and a Node.js backend. The backend uses TypeScript, Prisma, and PostgreSQL for database management. The frontend is styled with Tailwind CSS and supports push notifications using Expo Notifications.
- User authentication (register, login, logout) with JWT.
- CRUD operations for establishments, products, and orders.
- WebSocket notifications for real-time updates.
- Prisma ORM for database management.
- React Native app with Expo.
- Product listing and details.
- Cart management and checkout.
- Push notifications for order status updates.
- Tailwind CSS for styling.
- Node.js (v18 or later)
- Docker and Docker Compose
- Expo CLI (for frontend development)
-
Clone the repository:
git clone <repository-url> cd food
-
Install dependencies:
npm install
-
Set up the database:
- Ensure Docker is running.
- Start the database using Docker Compose:
docker-compose up -d db
-
Apply Prisma migrations:
npx prisma migrate dev
-
Start the backend server:
npm run dev
The backend will be available at http://localhost:3000.
-
Navigate to the frontend directory:
cd front -
Install dependencies:
npm install
-
Start the Expo development server:
npm run start
-
Follow the instructions in the terminal to open the app on your device or emulator.
To run the entire application with Docker:
-
Build and start the services:
docker-compose up --build
-
Access the services:
- Backend:
http://localhost:3000 - Adminer (Database Manager):
http://localhost:8080
- Backend:
-
Run unit tests:
npm test -
Lint and format the code:
npm run lint npm run format
- The backend is configured to build a Docker image and push it to GitHub Container Registry.
- Deployment to Render is automated via GitHub Actions.
- The frontend is built for production using the provided Dockerfile.
The project includes a GitHub Actions workflow for:
- Running tests, linting, and type-checking.
- Building and publishing Docker images.
- Deploying to Render after merging to the
mainbranch.
Create a .env file in the root directory with the following variables:
DATABASE_URL=postgres://<user>:<password>@localhost:5432/food_db
JWT_SECRET=your_jwt_secret