https://github.com/fzn0x/62teknologi-backend-test-muhammad-fauzan
Around Me Backend
https://github.com/fzn0x/62teknologi-backend-test-muhammad-fauzan
Last synced: 2 months ago
JSON representation
Around Me Backend
- Host: GitHub
- URL: https://github.com/fzn0x/62teknologi-backend-test-muhammad-fauzan
- Owner: fzn0x
- Created: 2024-06-09T15:09:03.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T05:17:39.000Z (11 months ago)
- Last Synced: 2024-12-31T06:42:04.662Z (4 months ago)
- Language: TypeScript
- Homepage: https://aroundme.fzn0x.rocks/
- Size: 209 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Around Me!
Find businesses around your location.
## Recommended Versions
```sh
$ docker -v
Docker version 20.10.20, build 9fdeb9c$ node -v
v18.20.2$ bun -v
1.1.8$ yarn -v
1.22.19
```## Development
To install dependencies:
```bash
bun install # or `yarn`
```To run:
```bash
bun run dev # or `yarn dev`# or for production
bun run prod
```## Production
```sh
# Build dockerfile
docker build -f ./Dockerfile . -t developerfauzan/aroundme:latest
docker push developerfauzan/aroundme:latest# Copy .env.example as .env.production.local and setup production environment
# Make sure .gitignore has .env.production.local before push to any version control system
cp .env.example .env.production.local# Build docker compose file to run all
docker compose up -d# Backup Database
docker exec -u postgres pg_dump -Fc aroundme > db.dump
```## Updating schema
Avoid losing data in production
> :warning: **If you are using production environment**: Avoid losing data in production, use `prisma migrate deploy` instead.
```sh
prisma migrate dev --create-only# Edit the autogenerated migration file (you will need to write some SQL yourself to avoid losing data)
# Development
prisma migrate dev# Production
prisma migrate deploy# or with Docker
# build dockerfile
docker build -f ./Dockerfile . -t developerfauzan/aroundme:latest
docker push developerfauzan/aroundme:latest# Seeding
# find container id
docker ps
# seed
docker exec -it 3b560e5e30e2 bun run seed
```